Cancel Transaction
Cancel Transaction
PATCH {{Environment_URL}}/vendors/v1/charges/:id/cancel
This endpoint is responsible for canceling a transaction. However, there are two important restrictions:
Only transactions with a status of
PENDINGcan be canceled.Only users with an administrator account type are authorized to perform cancellations. Operators are not allowed to cancel charges.
Headers
Name
Value
Authorization
Bearer <token>
Path Params
Name
Type
Description
Value
id
string
Charge ID
ch_01jrtq9nc0atjfww227t411kpp
Response
{
"id": "ch_01jrtq9nc0atjfww227t411kpp",
"amount": 77700,
"currency": "USD",
"metadata": null,
"quotation": {
"id": "f096981860b1bbb892792a88777e04f487aa30ba",
"tax": {
"iof": {
"total": {
"value": 1510,
"divisor": 100,
"currency": "BRL",
"precision": 2
},
"percentage": 0.38
}
},
"total": {
"withTax": {
"value": 398944,
"divisor": 100,
"currency": "BRL",
"precision": 2
},
"withoutTax": {
"value": 397434,
"divisor": 100,
"currency": "BRL",
"precision": 2
},
"withFutureTax": {
"value": 399937,
"divisor": 100,
"currency": "BRL",
"precision": 2
},
"withTaxesAndFees": {
"value": 399937,
"divisor": 100,
"currency": "BRL",
"precision": 2
}
},
"currency": {
"code": "USD",
"fees": [
{
"name": "VENDOR NAME",
"type": "absolute",
"value": 200,
"netValue": {
"value": 993,
"divisor": 100,
"currency": "BRL",
"precision": 2
},
"receiver": "VENDOR_FEE"
}
],
"name": "Dólar Americano",
"offer": {
"value": 77700,
"divisor": 100,
"currency": "USD",
"precision": 2
},
"price": {
"withTax": {
"value": 51344,
"divisor": 10000,
"currency": "BRL",
"precision": 4
},
"withoutTax": {
"value": 51150,
"divisor": 10000,
"currency": "BRL",
"precision": 4
},
"withFutureTax": {
"value": 51472,
"divisor": 10000,
"currency": "BRL",
"precision": 4
},
"withTaxesAndFees": {
"value": 51472,
"divisor": 10000,
"currency": "BRL",
"precision": 4
}
},
"spreads": [
{
"name": "SPREAD_FC",
"type": "percentage",
"netValue": {
"value": 7717,
"divisor": 100,
"currency": "BRL",
"precision": 2
},
"receiver": "PLATFORM_FEE",
"percentage": 2
},
{
"name": "SPREAD_VENDOR",
"type": "percentage",
"netValue": {
"value": 3859,
"divisor": 100,
"currency": "BRL",
"precision": 2
},
"receiver": "VENDOR_FEE",
"percentage": 1
}
],
"offerUSD": {
"value": 77700,
"divisor": 100,
"currency": "USD",
"precision": 2
},
"levelingRate": {
"value": 49660,
"divisor": 10000,
"currency": "BRL",
"precision": 4
},
"countryFlagUrl": "https://s3.amazonaws.com/simple-exchanges-demo/new-flags/united-states.svg",
"commercialExchangeRate": {
"value": 49660,
"divisor": 10000,
"currency": "BRL",
"precision": 4,
"updatedAt": "2023-08-14T20:08:25.000Z"
}
},
"metadata": {
"externalId": "vnd_02txjjx5cj1cmdpbjxz0zsmhjh"
},
"createdAt": "2025-04-14T17:59:28.946Z",
"futureTax": {
"ir": {
"total": {
"value": 0,
"divisor": 100,
"currency": "BRL",
"precision": 2
},
"percentage": 0
}
}
},
"nature": "CRYPTO_ACTIVES",
"status": "CANCELED",
"createdAt": "2025-04-14T17:59:31.442Z",
"updatedAt": "2025-04-14T18:00:19.292Z",
"vendor": {
"id": "vnd_02txjjx5cj1cmdpbjxz0zsmhjh",
"businessType": "INDIVIDUAL",
"businessClass": [
"RESTAURANT"
],
"name": "Frente Vendor",
"vendorResponsiblePhone": "+55323232323",
"commercialPhone": "+5532323232",
"fullNameResponsible": "42231323232",
"address": {
"city": "dasdasd",
"state": "3dasdas",
"street": "dasdasd 3123",
"country": "sc",
"latitude": "312312",
"longitude": "312312",
"neighborhood": "dasdasdas",
"openingHours": "312"
},
"email": "[email protected]",
"metadata": {
"additionalInformation[0].field": "",
"additionalInformation[0].value": ""
},
"controller": {},
"defaultCurrency": "USD",
"natures": [
"CRYPTO_ACTIVES"
],
"vendorResponsible": {},
"notificationsEmail": "[email protected]",
"commercialEmail": "[email protected]",
"externalAccounts": [],
"status": "PENDING",
"payoutsEnabled": true,
"settings": {},
"createdAt": "2024-05-15T00:37:14.728Z",
"updatedAt": "2024-12-04T14:36:08.053Z",
"financialData": {
"bankPath": [
{
"bankPath": "MATERA"
}
],
"vendorBankDetails": {
"country": "as",
"currency": "USD",
"accountName": "312"
},
"metaData": [
{
"field": "BANCO KAINAN",
"value": "66263413"
},
{
"field": "AGENCIA KAINAN",
"value": "12332212"
}
]
},
"agentId": "20",
"logo": "https://simple-pay-vendors-demo.s3.amazonaws.com/logos/frente_vendor/1715733433079.png",
"minimumValueForFinanceBatch": null
},
"account": {
"id": "acc_01hxwv1bytd7p8qktyxrd5gp61",
"chargesEnable": true,
"loginEnable": true,
"provider": null,
"providerId": "7173E5C8-3053-DD03-F21F-90420CF65D60",
"accountNumber": null,
"bankNumber": null,
"agencyNumber": null,
"defaultPix": null,
"externalAccounts": [],
"vendor": {
"id": "vnd_02txjjx5cj1cmdpbjxz0zsmhjh",
"name": "Frente Vendor",
"logo": "https://simple-pay-vendors-demo.s3.amazonaws.com/logos/frente_vendor/1715733433079.png",
"commercialPhone": "+5532323232",
"address": {
"city": "dasdasd",
"state": "3dasdas",
"street": "dasdasd 3123",
"country": "sc",
"latitude": "312312",
"longitude": "312312",
"neighborhood": "dasdasdas",
"openingHours": "312"
}
},
"externalId": null,
"status": "WAITING_ACCOUNT_CREATION",
"name": "Frente Vendor",
"logo": null,
"address": null,
"contact": null,
"metadata": null,
"type": "ADMINISTRATOR"
},
"fsmEvents": {
"status": [
{
"to": "PENDING",
"from": "CREATED",
"timestamp": "2025-04-14T17:59:33.439Z",
"transition": "charge"
},
{
"from": "PENDING",
"to": "CANCELED",
"transition": "cancel",
"timestamp": "2025-04-14T18:00:19.290Z"
}
]
},
"expire": 1752,
"expiredAt": "2025-04-14T18:29:31.445Z"
}
