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

# Obter cobrança

# 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}": {
      "get": {
        "summary": "Obter cobrança",
        "description": "",
        "operationId": "obter-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_6NXoYXyiNfP3A54l\",\n    \"code\": \"ABCDE123\",\n    \"amount\": 1490,\n    \"paid_amount\": 1490,\n    \"status\": \"paid\",\n    \"currency\": \"BRL\",\n    \"payment_method\": \"credit_card\",\n    \"paid_at\": \"2019-01-22T14:31:36Z\",\n    \"created_at\": \"2019-01-22T14:30:12Z\",\n    \"updated_at\": \"2019-01-22T14:31:36Z\",\n    \"customer\": {\n        \"id\": \"cus_PYwJvWgOTmiqvW8m\",\n        \"name\": \"Tony Stark\",\n        \"email\": \"toinhodalua@nasa.com\",\n        \"delinquent\": false,\n        \"created_at\": \"2019-01-18T11:50:37Z\",\n        \"updated_at\": \"2019-01-18T15:46:38Z\",\n        \"phones\": {}\n    },\n    \"last_transaction\": {\n        \"id\": \"tran_QGXDnycJdHKnoVa3\",\n        \"transaction_type\": \"credit_card\",\n        \"funding_source\": \"prepaid\",\n        \"amount\": 1490,\n        \"status\": \"captured\",\n        \"success\": true,\n        \"installments\": 1,\n        \"statement_descriptor\": \"AVENGERS\",\n        \"acquirer_tid\": \"cb42d188-aca6-46f2-a2c9-046cb6342f5d\",\n        \"acquirer_nsu\": \"cb42d188-aca6-46f2-a2c9-046cb6342f5d\",\n        \"acquirer_auth_code\": \"416\",\n        \"acquirer_message\": \"Transação capturada com sucesso\",\n        \"acquirer_return_code\": \"00\",\n        \"operation_type\": \"capture\",\n        \"card\": {\n            \"id\": \"card_jdK2O53TqfnxwRDY\",\n            \"first_six_digits\": \"400000\",\n            \"last_four_digits\": \"0010\",\n            \"brand\": \"Visa\",\n            \"holder_name\": \"Tony Stark\",\n            \"exp_month\": 1,\n            \"exp_year\": 2020,\n            \"status\": \"active\",\n            \"type\": \"credit\",\n            \"created_at\": \"2019-01-18T12:25:41Z\",\n            \"updated_at\": \"2019-01-22T14:30:12Z\"\n        },\n        \"created_at\": \"2019-01-22T14:31:36Z\",\n        \"updated_at\": \"2019-01-22T14:31:36Z\",\n        \"gateway_response\": {\n            \"code\": \"200\",\n            \"errors\": []\n        }\n    },\n    \"metadata\": {\n        \"code\": \"123\"\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "ch_6NXoYXyiNfP3A54l"
                    },
                    "code": {
                      "type": "string",
                      "example": "ABCDE123"
                    },
                    "amount": {
                      "type": "integer",
                      "example": 1490,
                      "default": 0
                    },
                    "paid_amount": {
                      "type": "integer",
                      "example": 1490,
                      "default": 0
                    },
                    "status": {
                      "type": "string",
                      "example": "paid"
                    },
                    "currency": {
                      "type": "string",
                      "example": "BRL"
                    },
                    "payment_method": {
                      "type": "string",
                      "example": "credit_card"
                    },
                    "paid_at": {
                      "type": "string",
                      "example": "2019-01-22T14:31:36Z"
                    },
                    "created_at": {
                      "type": "string",
                      "example": "2019-01-22T14:30:12Z"
                    },
                    "updated_at": {
                      "type": "string",
                      "example": "2019-01-22T14:31:36Z"
                    },
                    "customer": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "cus_PYwJvWgOTmiqvW8m"
                        },
                        "name": {
                          "type": "string",
                          "example": "Tony Stark"
                        },
                        "email": {
                          "type": "string",
                          "example": "toinhodalua@nasa.com"
                        },
                        "delinquent": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2019-01-18T11:50:37Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2019-01-18T15:46:38Z"
                        },
                        "phones": {
                          "type": "object",
                          "properties": {}
                        }
                      }
                    },
                    "last_transaction": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "tran_QGXDnycJdHKnoVa3"
                        },
                        "transaction_type": {
                          "type": "string",
                          "example": "credit_card"
                        },
                        "funding_source": {
                          "type": "string",
                          "example": "prepaid"
                        },
                        "amount": {
                          "type": "integer",
                          "example": 1490,
                          "default": 0
                        },
                        "status": {
                          "type": "string",
                          "example": "captured"
                        },
                        "success": {
                          "type": "boolean",
                          "example": true,
                          "default": true
                        },
                        "installments": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        },
                        "statement_descriptor": {
                          "type": "string",
                          "example": "AVENGERS"
                        },
                        "acquirer_tid": {
                          "type": "string",
                          "example": "cb42d188-aca6-46f2-a2c9-046cb6342f5d"
                        },
                        "acquirer_nsu": {
                          "type": "string",
                          "example": "cb42d188-aca6-46f2-a2c9-046cb6342f5d"
                        },
                        "acquirer_auth_code": {
                          "type": "string",
                          "example": "416"
                        },
                        "acquirer_message": {
                          "type": "string",
                          "example": "Transação capturada com sucesso"
                        },
                        "acquirer_return_code": {
                          "type": "string",
                          "example": "00"
                        },
                        "operation_type": {
                          "type": "string",
                          "example": "capture"
                        },
                        "card": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "card_jdK2O53TqfnxwRDY"
                            },
                            "first_six_digits": {
                              "type": "string",
                              "example": "400000"
                            },
                            "last_four_digits": {
                              "type": "string",
                              "example": "0010"
                            },
                            "brand": {
                              "type": "string",
                              "example": "Visa"
                            },
                            "holder_name": {
                              "type": "string",
                              "example": "Tony Stark"
                            },
                            "exp_month": {
                              "type": "integer",
                              "example": 1,
                              "default": 0
                            },
                            "exp_year": {
                              "type": "integer",
                              "example": 2020,
                              "default": 0
                            },
                            "status": {
                              "type": "string",
                              "example": "active"
                            },
                            "type": {
                              "type": "string",
                              "example": "credit"
                            },
                            "created_at": {
                              "type": "string",
                              "example": "2019-01-18T12:25:41Z"
                            },
                            "updated_at": {
                              "type": "string",
                              "example": "2019-01-22T14:30:12Z"
                            }
                          }
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2019-01-22T14:31:36Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2019-01-22T14:31:36Z"
                        },
                        "gateway_response": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "example": "200"
                            },
                            "errors": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {}
                              }
                            }
                          }
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "example": "123"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "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    // 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.GetCharge(chargeId);\n",
              "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->getCharge($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.*;\nimport com.mundipagg.api.models.GetChargeResponse;\n\npublic class GetChargeById {\n\t\n\tpublic static void main(String[] args) {\n\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        String chargeId = \"ch_Dzk8rbVSynuM80Ad\";\n\n        ChargesController charges_controller = new ChargesController();\n\n        charges_controller.getChargeAsync(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 found!\");\n                System.out.println(\"Charge ID: \" + response.getId());\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\n}",
              "name": "SDK JAVA"
            }
          ],
          "samples-languages": [
            "csharp",
            "text",
            "java"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": false
  },
  "x-readme-fauxas": true,
  "_id": "5aba89f6b169810058a71e9a:5aba89f6b169810058a71ede"
}
```