Skip to main content

Cancel charge

POST/api/v1/bank/wallet/charge/{charge_uuid}/cancel/{wallet_uuid}/Bearer Token

Request headers

HeaderValueRequired
AuthorizationBearer {A55_ACCESS_TOKEN}Yes
Content-Typeapplication/jsonYes
Idempotency-KeyUUID v4Recommended

Path parameters

FieldTypeRequiredDescription
charge_uuidstring (UUID)YesCharge to cancel
wallet_uuidstring (UUID)YesWallet that owns the charge

Request body

FieldTypeRequiredDescription
reasonstringNoCancellation reason for reconciliation

Response fields

FieldTypeDescription
charge_uuidstringCancelled charge identifier
wallet_uuidstringWallet that owned the charge
statusstringcanceled on success
messageobjectAdditional details or empty object on success

HTTP status codes

StatusDescription
200Charge cancelled successfully
400Charge is not in a cancellable state
401Invalid or expired Bearer token
403Insufficient permissions for this wallet
404Charge or wallet not found
409Charge already cancelled or settled
422Validation error
429Rate limit exceeded
500Internal server error — retry with exponential backoff

Code examples

curl -s -X POST "https://core-manager.a55.tech/api/v1/bank/wallet/charge/a1b2c3d4-e5f6-7890-abcd-ef1234567890/cancel/f47ac10b-58cc-4372-a567-0e02b2c3d479/" \
-H "Authorization: Bearer $A55_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-d '{"reason": "Customer requested cancellation before shipment"}'

Error response example

{
"charge_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "error",
"message": [
{
"code": "CANCEL_NOT_ALLOWED",
"source": "charge",
"description": "Charge has already been settled and cannot be cancelled. Use refund instead."
}
]
}