---
agentTools:
  projectIndex: https://docs.mundipagg.com/llms.txt
---

# Retentar uma cobrança manualmente

<br>

[block:callout]
{
  "type": "success",
  "title": "A Mundipagg oferece métodos de RETENTATIVA AUTOMÁTICA !",
  "body": "* **Retentativa Automática**: reprocessa **automaticamente** na mesma ou em outra adquirente, as transações não autorizadas, de acordo com a configuração programada.\n\n* **Retentativa Offline**: visa recuperar cobranças não autorizadas, sendo configuradas através da unidade de medida **hora**, tendo como base a última tentativa.\n\nSaiba mais sobre os retentativas através de nossa [documentação de negócios](https://docs.mundipagg.com/v1/docs/retentativa-autom%C3%A1tica) ou entrando em contato conosco através de **suporte@mundipagg.com**!"
}
[/block]

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Mundipagg API",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.mundipagg.com/core/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/charges/{charge_id}/retry/": {
      "post": {
        "summary": "Retentar uma cobrança manualmente",
        "description": "",
        "operationId": "rententar-uma-cobrança",
        "parameters": [
          {
            "name": "charge_id",
            "in": "path",
            "description": "Código da cobrança.",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"id\": \"ch_exRAY21fvNFVD9EX\",\n  \"code\": \"8M2OT2SRX8\",\n  \"gateway_id\": \"c5d71b01-174e-453f-8563-fd089cf7b39b\",\n  \"amount\": 14900000,\n  \"status\": \"failed\",\n  \"currency\": \"BRL\",\n  \"payment_method\": \"credit_card\",\n  \"due_at\": \"2017-04-04T00:00:00\",\n  \"created_at\": \"2017-04-04T22:29:33\",\n  \"updated_at\": \"2017-04-04T22:29:54\",\n  \"customer\": {\n    \"id\": \"cus_aEkwKv0SmNHMR931\",\n    \"name\": \"Luke Skywalker\",\n    \"email\": \"lskywalker@r2d2.com\",\n    \"delinquent\": false,\n    \"created_at\": \"2017-04-04T19:41:31\",\n    \"updated_at\": \"2017-04-04T19:41:31\"\n  },\n  \"last_transaction\": {\n    \"id\": \"tran_dZm79oYT0ckRlw1o\",\n    \"transaction_type\": \"credit_card\",\n    \"funding_source\": \"prepaid\",\n    \"gateway_id\": \"f3c316f7-3f6c-47bc-ac03-da01e51444aa\",\n    \"amount\": 14900000,\n    \"status\": \"not_authorized\",\n    \"success\": false,\n    \"installments\": 1,\n    \"statement_descriptor\": \"Spotify\",\n    \"acquirer_name\": \"simulator\",\n    \"acquirer_affiliation_code\": \"MUNDI\",\n    \"acquirer_tid\": \"\",\n    \"acquirer_nsu\": \"\",\n    \"acquirer_auth_code\": \"\",\n    \"acquirer_message\": \"Simulator|Transação de simulação não autorizada\",\n    \"acquirer_return_code\": \"1\",\n    \"operation_type\": \"auth_only\",\n    \"credit_card\": {\n      \"id\": \"card_2bKzdEGsYYFkymqG\",\n      \"first_six_digits\": \"542501\",\n      \"last_four_digits\": \"5322\",\n      \"brand\": \"Visa\",\n      \"holder_name\": \"Luke Skywalker\",\n      \"exp_month\": 5,\n      \"exp_year\": 2030,\n      \"status\": \"active\",\n      \"created_at\": \"2017-04-04T19:41:31\",\n      \"updated_at\": \"2017-04-04T19:41:31\",\n      \"billing_address\": {\n        \"zip_code\": \"90265\",\n        \"city\": \"Malibu\",\n        \"state\": \"CA\",\n        \"country\": \"US\",\n         \"line_1\": \"10880, Malibu Point, Malibu Central\"\n      }\n    },\n    \"created_at\": \"2017-04-04T22:29:33\",\n    \"updated_at\": \"2017-04-04T22:29:33\"\n  },\n  \"metadata\": {\n    \"id\": \"my_charge_id\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "ch_exRAY21fvNFVD9EX"
                    },
                    "code": {
                      "type": "string",
                      "example": "8M2OT2SRX8"
                    },
                    "gateway_id": {
                      "type": "string",
                      "example": "c5d71b01-174e-453f-8563-fd089cf7b39b"
                    },
                    "amount": {
                      "type": "integer",
                      "example": 14900000,
                      "default": 0
                    },
                    "status": {
                      "type": "string",
                      "example": "failed"
                    },
                    "currency": {
                      "type": "string",
                      "example": "BRL"
                    },
                    "payment_method": {
                      "type": "string",
                      "example": "credit_card"
                    },
                    "due_at": {
                      "type": "string",
                      "example": "2017-04-04T00:00:00"
                    },
                    "created_at": {
                      "type": "string",
                      "example": "2017-04-04T22:29:33"
                    },
                    "updated_at": {
                      "type": "string",
                      "example": "2017-04-04T22:29:54"
                    },
                    "customer": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "cus_aEkwKv0SmNHMR931"
                        },
                        "name": {
                          "type": "string",
                          "example": "Luke Skywalker"
                        },
                        "email": {
                          "type": "string",
                          "example": "lskywalker@r2d2.com"
                        },
                        "delinquent": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2017-04-04T19:41:31"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2017-04-04T19:41:31"
                        }
                      }
                    },
                    "last_transaction": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "tran_dZm79oYT0ckRlw1o"
                        },
                        "transaction_type": {
                          "type": "string",
                          "example": "credit_card"
                        },
                        "funding_source": {
                          "type": "string",
                          "example": "prepaid"
                        },
                        "gateway_id": {
                          "type": "string",
                          "example": "f3c316f7-3f6c-47bc-ac03-da01e51444aa"
                        },
                        "amount": {
                          "type": "integer",
                          "example": 14900000,
                          "default": 0
                        },
                        "status": {
                          "type": "string",
                          "example": "not_authorized"
                        },
                        "success": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "installments": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        },
                        "statement_descriptor": {
                          "type": "string",
                          "example": "Spotify"
                        },
                        "acquirer_name": {
                          "type": "string",
                          "example": "simulator"
                        },
                        "acquirer_affiliation_code": {
                          "type": "string",
                          "example": "MUNDI"
                        },
                        "acquirer_tid": {
                          "type": "string",
                          "example": ""
                        },
                        "acquirer_nsu": {
                          "type": "string",
                          "example": ""
                        },
                        "acquirer_auth_code": {
                          "type": "string",
                          "example": ""
                        },
                        "acquirer_message": {
                          "type": "string",
                          "example": "Simulator|Transação de simulação não autorizada"
                        },
                        "acquirer_return_code": {
                          "type": "string",
                          "example": "1"
                        },
                        "operation_type": {
                          "type": "string",
                          "example": "auth_only"
                        },
                        "credit_card": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "card_2bKzdEGsYYFkymqG"
                            },
                            "first_six_digits": {
                              "type": "string",
                              "example": "542501"
                            },
                            "last_four_digits": {
                              "type": "string",
                              "example": "5322"
                            },
                            "brand": {
                              "type": "string",
                              "example": "Visa"
                            },
                            "holder_name": {
                              "type": "string",
                              "example": "Luke Skywalker"
                            },
                            "exp_month": {
                              "type": "integer",
                              "example": 5,
                              "default": 0
                            },
                            "exp_year": {
                              "type": "integer",
                              "example": 2030,
                              "default": 0
                            },
                            "status": {
                              "type": "string",
                              "example": "active"
                            },
                            "created_at": {
                              "type": "string",
                              "example": "2017-04-04T19:41:31"
                            },
                            "updated_at": {
                              "type": "string",
                              "example": "2017-04-04T19:41:31"
                            },
                            "billing_address": {
                              "type": "object",
                              "properties": {
                                "zip_code": {
                                  "type": "string",
                                  "example": "90265"
                                },
                                "city": {
                                  "type": "string",
                                  "example": "Malibu"
                                },
                                "state": {
                                  "type": "string",
                                  "example": "CA"
                                },
                                "country": {
                                  "type": "string",
                                  "example": "US"
                                },
                                "line_1": {
                                  "type": "string",
                                  "example": "10880, Malibu Point, Malibu Central"
                                }
                              }
                            }
                          }
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2017-04-04T22:29:33"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2017-04-04T22:29:33"
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "my_charge_id"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "csharp",
              "code": "     // Neste exemplo estamos utilizando A sdk C# MundiAPI.PCL\n\t\t// Secret key fornecida pela Mundipagg\n    string basicAuthUserName = \"sk_test_4tdVXpseumRmqbo\";\n    // Senha em branco. Passando apenas a secret key\n    string basicAuthPassword = \"\";\n            \n    var client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);\n    string chargeId = \"ch_exRAY21fvNFVD9EX\";\n\n    var response = client.Charges.RetryCharge(chargeId);",
              "name": "SDK C#"
            },
            {
              "language": "text",
              "code": "//This example was built using MundiAPI-PHP SDK.\n//For more information, please refer to https://github.com/mundipagg/MundiAPI-PHP\n\n$secretKey = 'sk_test_4tdVXpseumRmqbo'; //the secret key will be provided by MundiPagg.\n$basicAuthPassword = ''; //fill it with an empty string\n\n$apiClient = new \\MundiAPILib\\MundiAPIClient(\n    $secretKey,\n    $basicAuthPassword\n);\n\n$chargesController = $apiClient->getCharges();\n\n$chargeId = \"ch_exRAY21fvNFVD9EX\";\n\n$result = $chargesController->retryCharge($chargeId);\n\necho json_encode($result, JSON_PRETTY_PRINT);",
              "name": "SDK PHP"
            },
            {
              "language": "java",
              "code": "package examples.charge;\n\nimport com.mundipagg.api.MundiAPIClient;\nimport com.mundipagg.api.controllers.ChargesController;\nimport com.mundipagg.api.http.client.APICallBack;\nimport com.mundipagg.api.http.client.HttpContext;\nimport com.mundipagg.api.models.GetChargeResponse;\n\npublic class RetryCharge {\n\t\n\tpublic static void main(String[] args) {\n\t\t\n        String basicAuthUserName = \"sk_test_4tdVXpseumRmqbo\"; // The username to use with basic authentication\n        String basicAuthPassword = \"\"; // The password to use with basic authentication\n\n        MundiAPIClient client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);\n\n        ChargesController charges_controller = new ChargesController();\n\n        String chargeId = \"ch_8dla503fAUdNXgz2\";\n\n        charges_controller.retryChargeAsync(chargeId, new APICallBack<GetChargeResponse>() {\n            @Override\n            public void onSuccess(HttpContext context, GetChargeResponse response) {\n\n                System.out.println(\"Status response: \" + context.getResponse().getStatusCode());\n                System.out.println(\"Charge retry!\");\n                System.out.println(\"Charge ID: \" + response.getId());\n                System.out.println(\"Charge status: \" + response.getStatus());\n                System.out.println(\"Last transaction status: \" + response.getLastTransaction().getStatus());\n\n            }\n\n            @Override\n            public void onFailure(HttpContext context, Throwable error) {\n\n                System.out.println(\"Status response: \" + context.getResponse().getStatusCode());\n                System.out.println(error.getMessage());\n                error.printStackTrace();\n\n            }\n        });\n    }\n\n}",
              "name": "SDK JAVA"
            }
          ],
          "samples-languages": [
            "csharp",
            "text",
            "java"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": false
  },
  "x-readme-fauxas": true,
  "_id": "5aba89f6b169810058a71e9a:5aba89f6b169810058a71ee4"
}
```