Cancel payment
This section describes the payment cancellation process and applicable scenarios. Both the merchant and the user may cancel a scheduled payment plan. The cancellation rules are as follows:
- Cancel payment on the merchant side: When a merchant needs to stop a specific scheduled payment due to business needs or other reasons, the merchant can initiate a payment cancellation request. The merchant must submit the cancellation request before 22:00 on the day before the scheduled debit date, that is, before 22:00 on T-1, to successfully cancel the next scheduled payment. If the merchant submits the cancellation request after 22:00 on T-1, the request will still be accepted, but it will not affect the payment already scheduled for the next day. The cancellation will only take effect for the following payment cycle. This operation cancels only one specific scheduled payment and does not cancel the entire subscription.
For example, if the scheduled debit date is November 10 and the merchant submits the cancellation request at 23:00 on November 9, the payment on November 10 will still be processed as scheduled, the payment in the next cycle will be canceled, and subsequent payments will continue according to the original schedule. If the payment plan is billed weekly, the payment on November 17 will be canceled, while payments after November 17 will not be affected and will continue as scheduled.
- Cancel payment on the user side: If the buyer wishes to terminate the transaction, the user may cancel the scheduled payment plan before the payment due date. The cancellation will take effect immediately.
Cancel payment on the merchant side
You can initiate payment cancellation request by following the steps below.
Step 1: Call the cancel API
You can cancel a transaction by using the cancel API. You must pass in one of the following parameters in your request:
Note: The cancellation can only be initiated before the due date.
Parameter | Required | Description |
paymentId | No | The unique identifier that Antom assigns to a transaction. |
paymentRequestId | No | The unique identifier that you assign to a request. |
The following code shows a sample of the request message:
{
"paymentId": "2019061218401080010018882020035XXXX"
}The following code shows a sample of the response:
{
"result": {
"resultCode": "SUCCESS",
"resultStatus": "S",
"resultMessage": "Success"
},
"paymentRequestId": "pay_2089760038715669_20277574507XXXX",
"paymentId": "2019061218401080010018882020035XXXX",
"cancelTime": "2019-06-12T19:07:11+08:00"
}The table below shows the possible values of result.resultStatus in the response. Please handle the result according to the guidance provided:
resultStatus | Description | Further action |
S | The cancellation request has been accepted. | Indicates the cancellation request is initiated successfully, please refer to the "Step 2: Obtain the cancellation result" to retrieve the cancellation result. |
F | The cancellation failed. | |
U | The cancellation is unknown. | Resend the API request with the same value of paymentRequestId. Contact Antom Technical Support if the value of result.resultStatus is still U after three consecutive retries. |
Step 2: Obtain the cancellation result
Once the subscription is canceled, Antom will use the notifyPayment (Subscription) API to send you an asynchronous notification to the paymentNotifyURL which passed in during the subsequent deduction request.
The following code shows a sample of the asynchronous notification request:
{
"paymentAmount": {
"currency": "BRL",
"value": "1406"
},
"paymentCreateTime": "2025-10-13T01:31:09-07:00",
"paymentTime": "2025-10-13T03:10:47-07:00",
"result": {
"resultCode": "SUCCESS",
"resultMessage": "success",
"resultStatus": "S"
},
"paymentId": "2019061218401080010018882020035XXXX",
"subscriptionId": "20251013110000000000000600000004616",
"subscriptionOrderId": "20251013110000000000000600000005838",
"subscriptionOrderStatus": "CANCEL",
"subscriptionRequestId": "PAYMENT_21b774f2-84ed-4a7e-b2bd-5f5b2599eb52"
}Cancel payment on the user side
Once the user canceled the payment, Antom will use the notifyPayment (Subscription) API to send you an asynchronous notification to the paymentNotifyURL which passed in during the subsequent deduction request.
Note: For successful payments, users are not allowed to initiate a payment cancellation.
The following code shows a sample of an asynchronous notification:
{
"paymentAmount": {
"currency": "BRL",
"value": "1406"
},
"notifyType": "CANCEL_RESULT",
"paymentCreateTime": "2025-10-13T01:31:09-07:00",
"paymentTime": "2025-10-13T03:10:47-07:00",
"paymentId": "2019061218401080010018882020035XXXX",
"result": {
"resultCode": "SUCCESS",
"resultMessage": "success",
"resultStatus": "S"
},
"subscriptionId": "20251013110000000000000600000004616",
"subscriptionOrderId": "20251013110000000000000600000005838",
"subscriptionOrderStatus": "CANCEL",
"subscriptionRequestId": "PAYMENT_21b774f2-84ed-4a7e-b2bd-5f5b2599eb52"
}