Cancel a payment
Cancels a pending payment. A payment that has already succeeded or failed can’t be canceled.
POST
/payments/{paymentId}/cancelAuthorization
AuthorizationBearer token · headerrequiredYour Apipay secret API key.
Path parameters
paymentIdstringrequiredResponses
200
The canceled payment.
idstringrequiredamountintegerrequiredAmount in the smallest unit of the currency (e.g. Rupiah has no sub-unit, so this is whole Rupiah).
currencystringrequiredmethodPaymentMethodrequiredAllowed:
qrisvirtual_accountcardewalletstatusPaymentStatusrequiredAllowed:
pendingsucceededfailedcanceledcustomer_idstring | nulldescriptionstring | nullcreated_atstring<date-time>required401
The API key is missing, invalid, or revoked.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequired404
No resource exists with that identifier.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequired409
The payment can't be canceled from its current status.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequired