Cancel a Payment
Cancel an IN_PROGRESS payment. Now only supports PIX/AME/PicPay payment
HTTP Request
POST
/v1/payments/charges/cancel/{{idempotencyKey}}
Request Headers{
"Content-Type": "application/json",
"Authorization": "Bearer {{access_token}}",
"x-api-key": "{{api_key}}"
}
Response
Content-Type: application/json{
"transferStatusCode": 200,
"transferErrorMsg": null,
"idempotencyKey": "20220602-001",
"referenceId": "20220602-001",
"paymentMethod": "PIX_STATIC_QR",
"amount": 100,
"currency": "BRL",
"country": "BR",
"finalAmount": 100,
"finalCurrency": "BRL",
"createTime": "2022-06-02 11:45:44 GMT+08:00",
"scheduledTime": "2022-06-02 12:32:39 GMT+08:00",
"finalStatusTime": "2022-06-02 11:47:23 GMT+08:00",
"payer": {
"name": "Thiago Gabriel",
"document": {
"documentId": "00740886967",
"type": "CPF"
},
"email": "thiago@example.com",
"phone": "5058149876",
"billingAddress": {
"zipCode": "04849333",
"state": "SP",
"city": "sao paulo",
"district": "Jardim Gaivotas",
"street": "Rua 9 de setembro",
"number": "15",
"complement": "casa",
"country": "BR"
}
},
"transferStatus": "CANCELLED",
"description": "hello world",
"callbackUrl": "http://api.client.com/notifications",
"transferDetails": {
"pix": {
"qrCode": "00020101021226580014BR.GOV.BCB.PIX01366b780a05-2659-4c6c-80d2-a8bd20c8396f52040000530398654041.005802BR5925Liquido Brl Pagamentos Di6014Belo Horizonte61083038040362290525ftg0pwqTUpQyFNXEXPzNuWQvL6304B717",
"qrCodeType": "STATIC",
"expirationTime": null
}
}
}
Key |
Value |
Authorization |
"bearer" + " " + {{access_token}} |
x-api-key |
{{api_key}} |
PATH and Query Parameters
Parameter |
Type |
Description |
idempotencyKey |
String |
The idempotency key of the payment which need to cancel |
Response Body Details
Parameter |
Type |
Description |
idempotencyKey |
String |
Unique key of payment record. |
referenceId |
String |
Unique key of payment record which canceled. current scene referenceId is equal idempotencyKey |
amount |
Long |
The payment amount. The minimum settlement granularity of the current currency, such as 100=1BRL |
country |
String |
country code |
currency |
String |
The currency of the transferred fund |
finalAmount |
String |
The final amount that is used for creating the charge order. EX: for charge orders with FX conversion, this field represents the converted amount from the original requested amount. |
finalCurrency |
String |
The currency code of the finalAmount. |
createTime |
String |
The creation time of refund request |
scheduledTime |
String |
Transfer ticket scheduled time |
finalStatusTime |
String |
The settled or failed time of refund transaction |
payer |
JSON |
payer info |
transferDetails |
JSON |
transaction details info |
transferStatus |
String |
Transfer status, should be CANCELED if success. |
transferStatusCode |
int |
Transfer status code, 200 if CANCELED. |
transferErrorMsg |
String |
Transfer error message if failed
|
Payer Object Parameters
Parameter |
Type |
Description |
name |
String |
fullname(Input specification: Only a combination of uppercase and lowercase letters, numbers and spaces is allowed. Spanish and Portuguese letters, and other special characters are not allowed). |
email |
String |
email. |
phone |
String |
Mobile Phone number. |
document |
JSON |
Wallet holder identity proof, such as CPF for Brazil. |
billingAddress |
JSON |
Billing address info. |
document Object Parameters
Parameter |
Type |
Description |
documentId |
String |
identity number |
type |
String |
enum of CPF or CNPJ |
billingAddress Object Parameters
Parameter |
Type |
Description |
zipCode |
String |
zip code. such as CEP in Brazil |
state |
String |
state. should be abbreviation, such as SP in Brazil |
city |
String |
city name. |
district |
String |
district name. |
street |
String |
street name. |
number |
String |
street number. |
complement |
String |
complement info. |
country |
String |
country code. |
transferDetails Object Parameters
Parameter |
Type |
Description |
pix |
JSON |
pix detail info |
pix Object Parameters
Parameter |
Type |
Description |
qrCode |
String |
barcode of pix order |
qrCodeType |
String |
enum value of STATIC, DYNAMIC |
expirationTime |
String |
expird time |