Request to cancel a charge
POST/charge/:merchantChargeId/refund
Cancel all or part of a charge
Request​
Path Parameters
Possible values: >= 6 characters and <= 36 characters, Value must match regular expression ^([a-zA-Z0-9-]+$)$
Unique external identifier for the charge, defined by the merchant's system.
Header Parameters
Optional string that identifies the e-commerce platform or integration system used by the customer to send the request, such as 'vtex', 'irroba', etc.
- application/json
Body
Possible values: >= 1
Payment amount in cents
Responses​
- 200
- 400
- 401
- 415
- 500
OK
- application/json
- Schema
- Example (from schema)
- Example
Schema
- Array [ 
- ] 
Possible values: [CANCELED, DENIED, ERROR, PAID, PARTIAL, PRE_AUTHORIZED, REFUNDED, CHARGEBACK]
transactions
object[]
Possible values: [CREDIT, WALLET, PIX]
Enum [ CREDIT(Credit card), WALLET(QRCode PicPay), PIX(Pix)]
Possible values: [CANCELED, CHARGEBACK, DENIED, ERROR, EXPIRED, PAID, PARTIALLY_REFUNDED, PENDING, PRE_AUTHORIZED, REFUNDED]
Formato ISO 8601. Exemplo: 2022-05-01T16:00:00-03:00 (significa que foi criado em 01/05/2022 às 16h no fuso horário -03:00)
Formato ISO 8601. Exemplo: 2022-05-01T16:00:00-03:00 (significa que foi atualizado em 01/05/2022 às 16h no fuso horário -03:00)
pix
object
pix response object
{
  "merchantChargeId": "string",
  "id": "string",
  "chargeStatus": "PRE_AUTHORIZED",
  "amount": 0,
  "originalAmount": 0,
  "refundedAmount": 0,
  "transactions": [
    {
      "paymentType": "CREDIT",
      "amount": 0,
      "originalAmount": 0,
      "refundedAmount": 0,
      "transactionStatus": "PRE_AUTHORIZED",
      "createdAt": "2022-05-01T16:00:00-03:00",
      "updatedAt": "2022-05-01T16:00:00-03:00",
      "transactionId": "string",
      "errorMessage": "string",
      "pix": {
        "qrCode": "string",
        "qrCodeBase64": "string"
      }
    }
  ]
}
{
  "merchantChargeId": "8086bfd7-6241-4f76-81d8-70460533ce74",
  "id": "ed50d469-ae7d-4a3d-a946-6e399cb981bb",
  "chargeStatus": "REFUNDED",
  "amount": 0,
  "originalAmount": 1000,
  "refundedAmount": 1000,
  "transactions": [
    {
      "paymentType": "CREDIT",
      "amount": 0,
      "originalAmount": 1000,
      "refundedAmount": 1000,
      "transactionStatus": "REFUNDED",
      "createdAt": "2023-11-08T10:42:36-03:00",
      "updatedAt": "2023-11-08T10:42:36-03:00",
      "transactionId": "1100000000000000000",
      "softDescriptor": "teste softDescriptor",
      "errorMessage": null,
      "pix": {
        "qrCode": "00020101021226940014COM.PICPAY.P2B0172......",
        "qrCodeBase64": "data:image/png;base64......",
        "endToEndId": "E00416911112501234429olrr6BQh8vW"
      }
    }
  ]
}
Bad Request
- application/json
- Schema
- Example (from schema)
- Example
Schema
- Array [ 
- ] 
errors
object[]
{
  "message": "string",
  "success": true,
  "businessCode": "string",
  "errors": [
    {
      "message": "must be a well-formed UUID string",
      "field": "merchantChargeId"
    }
  ]
}
{
  "message": "REFUND execution is unauthorized. Check if there is amount available for refund or if it has already been refunded",
  "success": false,
  "errors": null
}
Unauthorized
- application/json
- Schema
- Example (from schema)
- Example
Schema
- Array [ 
- ] 
errors
object[]
{
  "message": "string",
  "success": true,
  "businessCode": "string",
  "errors": [
    {
      "message": "must be a well-formed UUID string",
      "field": "merchantChargeId"
    }
  ]
}
{
  "message": "Authorization token not found.",
  "success": false,
  "errors": {
    "message": "Authorization token not found",
    "field": "Authorization Token"
  }
}
Unsupported Media Type
- application/json
- Schema
- Example (from schema)
- Example
Schema
- Array [ 
- ] 
errors
object[]
{
  "message": "string",
  "success": true,
  "businessCode": "string",
  "errors": [
    {
      "message": "must be a well-formed UUID string",
      "field": "merchantChargeId"
    }
  ]
}
{
  "message": "Request object is invalid or incorrectly formatted",
  "success": false,
  "errors": null
}
Internal Server Error
- application/json
- Schema
- Example (from schema)
- Example
Schema
- Array [ 
- ] 
errors
object[]
{
  "message": "string",
  "success": true,
  "businessCode": "string",
  "errors": [
    {
      "message": "must be a well-formed UUID string",
      "field": "merchantChargeId"
    }
  ]
}
{
  "message": "Internal Server Error",
  "success": false,
  "errors": null
}