Accept payments with EasySafePay (API)
Antom EasySafePay is a streamlined payment solution designed for low-value, high-frequency payment scenarios. During the first payment, buyers can either bind their wallet or pay directly. For subsequent payments, they can complete the transaction with a single click, without entering a password.
Powered by an industry-leading intelligent risk control system, dynamic routing technology, and payment failure recovery strategies, this solution ensures transaction security while achieving top-tier payment success rates across the industry. It delivers benefits to buyers, merchants, and the broader platform ecosystem by enhancing the payment experience, improving merchant conversion rates, and increasing ecosystem value.
This article mainly introduces how to integrate the EasySafePay product via API.
User experience
The user experience for each payment method differs between PC and mobile devices. For the specific interaction flows, please refer to the table and user experience diagrams below.
Web
Below are the user experience diagrams for the two payment categories, digital wallet and online banking, on desktop browsers (Web).
Digital wallet
In the digital wallet scenario, the user experience diagrams for the first payment and subsequent payments are shown below.
First payment
During the first payment, the buyer needs to complete the payment authorization process to enable password-free payments for future transactions.

Subsequent payments
For subsequent payments, if buyer participation is required, the buyer only needs to submit the order to complete the password-free payment. If buyer participation is not required, you can directly initiate the payment request from the backend.

Online banking
The user experience diagram for the online banking scenario is shown below:
First payment
During the first payment, the buyer needs to complete the payment authorization process to enable password-free payments for future transactions.

Subsequent payments
For subsequent payments, if buyer participation is required, the buyer only needs to submit the order to complete the password-free payment. If buyer participation is not required, you can directly initiate the payment request from the backend.

WAP
Below are the user experience diagrams for the two payment categories, digital wallet and online banking, on mobile browsers (WAP).
Digital wallet
In the digital wallet scenario, the user experience diagrams for the first payment and subsequent payments are shown below.
First payment
During the first payment, the system guides the buyer to complete the transaction either on the merchant page or on the payment method side. After the buyer completes the authorization, subsequent payments can be made without entering a password.
Pay on the merchant page

Pay on the payment method app

Subsequent payments
For subsequent payments, if buyer participation is required, the buyer only needs to submit the order to complete the password-free payment. If buyer participation is not required, you can directly initiate the payment request from the backend.

Online banking
The user experience diagram for the online banking scenario is shown below:
First payment
During the first payment, the buyer must complete the payment authorization process to enable password-free payments for future transactions.

Subsequent payments
Subsequent payments can be completed without re-linking the account.

App
Below are the user experience diagrams for the two payment categories, digital wallet and online banking, on mobile devices (App).
Digital wallet
In the digital wallet scenario, the user experience diagrams for the first payment and subsequent payments are shown below.
First payment
During the first payment, the system will guide the buyer to complete the transaction either on the merchant page or on the payment method side. Once the buyer completes the authorization, subsequent payments can be made without a password.
Pay on the merchant page

Pay on the payment method app

Subsequent payments
For subsequent payments, if buyer participation is required, the buyer only needs to submit the order to complete the password-free payment. If buyer participation is not required, you can directly initiate the payment request from the backend.

Online banking
The user experience diagram for the online banking scenario is shown below:
First payment
During the first payment, the buyer needs to complete the payment authorization process to enable password-free payments for future transactions.

Subsequent payments
Subsequent payments can be completed without re-linking the account.

Payment flow
First payment

- The buyer enters the checkout page.
- The buyer selects a payment method and submits the payment request.
- Create a payment request.
After the buyer selects a payment method and submits the order, the merchant server initiates the payment request by calling the pay (Tokenized Payment) API based on transaction information such as the payment method, amount, currency, and goods. - Process the payment continuation link.
The merchant client is redirected to the URL returned in the payment request, or launches the relevant application to complete the authorized payment. - Obtain the authorization result.
When the authorization is successful, Antom sends you an asynchronous notification via the notifyAuthorization API. - Obtain the payment result.
Obtain the payment result using one of the following methods:
- Asynchronous notification: Specify paymentNotifyUrl in the pay (Tokenized Payment) API to set the address for receiving asynchronous notifications or configure the url for receiving asynchronous notifications in the Antom Dashboard. When the authorization is successful, Antom sends you an asynchronous notification via the notifyPayment API.
- Synchronous inquiry: Call the inquiryPayment API to check the real-time payment status.
Subsequent payments

- The buyer enters the checkout page.
- The buyer selects a payment method and submits the payment request.
- Create a payment request.
After obtaining the buyer’s authorization, you can directly call the pay (Tokenized Payment) API to initiate the payment. - The buyer completes risk verification.
If a transaction is identified as risky, the buyer must be redirected to a frontend page to complete verification. If the merchant initiates a subscription charge directly from the backend, no verification page will be displayed.
- Obtain the payment result.
Obtain the payment result using one of the following methods:
- Asynchronous notification: Specify paymentNotifyUrl in the pay (Tokenized Payment) API to set the address for receiving asynchronous notifications or configure the url for receiving asynchronous notifications in the Antom Dashboard. When the payment is successful or expires, Antom will use notifyPayment API to send asynchronous notifications to you.
- Synchronous inquiry: Call the inquiryPayment API to check the real-time payment status.
Integration preparations
Before you start integrating, read the Integration Guide and API Overview documents to understand the integration steps of the server-side API and the precautions for calling the API. Furthermore, ensure that the following prerequisites are met:
- Obtain a client ID
- Complete the key configuration
- Complete the configuration of paymentNotifyUrl to receive the asynchronous notification
- Integrate the server-side SDK package, install the server-side library, and initialize a request instance. For more details, refer to Server-side SDK.
Integration steps
Start your integration by taking the following steps:
- Create a payment request
- Obtain the payment continuation URL
- Obtain the authorization and payment result.
Step 1: Create a payment request
After the buyer clicks the payment button, call the pay (Tokenized Payment) API and pass in the order information.
The table below describes the API request parameters for the first payment and subsequent payments.
Note:
- The integration flow for PayPay Smart Payment is different. For the specific steps, please refer to Accept payments with PayPay Smart Payment.
- For Express Bank Transfer, the first payment and subsequent payments use the same request parameter format. The buyer only needs to enter their mobile phone number on the payment page to complete the payment.
During the first payment, passing order.buyer.buyerPhoneNo can automatically prefill the buyer’s payment account on the payment page, eliminating the need for manual entry. Below is a comparison of the user experience with and without this parameter:
Payment method login account is provided
When the payment method account is provided, the buyer enters the authorization payment flow or chooses a one-time payment.
Authorize and pay
When the buyer enables the Enable One-Click Payment option during the first payment, password-free payments are enabled after completing authorization, making subsequent transactions faster and more convenient.

One-time payment
When the buyer disables the Enable One-Click Payment option, the buyer is redirected to the payment method provider’s page to complete a one-time payment.

Payment method login account not provided
If the payment method account is not provided, the page will guide the buyer to the payment method side to complete the authorization.

Below are code examples for first and subsequent payments.
First payment
The following code shows a sample of the request message:
The following code shows a sample of the response message:
Please take the next step according to the value of the result.resultStatus.
Note: If you do not receive a response, it may be due to a network timeout. Please close the current transaction or retry the API call with a new paymentRequestId and authstate value.
Subsequent payments
The following code shows a sample of the request message:
The following code shows a sample of the response message:
Please take the next step according to the value of the result.resultStatus.
Note: If you do not receive a response, it may be due to a network timeout. In this case, keep the paymentRequestId unchanged and call the API again to resolve the issue. If the problem persists, please contact Antom technical support.
Common questions
Q: Can I use Chinese characters in the value of the request parameters?
A: To avoid incompatibility of a certain payment method, do not use Chinese characters for parameters in the request.
Q: How to set the URL to receive the payment notification?
A: Specify paymentNotifyUrl in the pay (Tokenized Payment) API to receive the asynchronous notification about the payment result (notifyPayment), or configure the receiving URL in Antom Dashboard. If the URL is specified in both the request and Antom Dashboard, the value specified in the request takes precedence.
Q: What is the difference between paymentAmount and orderAmount?
A: paymentAmount refers to the payment amount, while orderAmount refers to the order amount. The actual charged amount is determined by paymentAmount.
Step 2: Obtain the payment continuation URL
After obtaining the payment continuation URL returned by Antom, the merchant server passes the address to the front end. The merchant front end redirects to the payment method page.
The following is the sample codes for loading payment continuation URL on the merchant front end:
Web
WAP
iOS
Android
Note: The URLs in the sample code refer to the applinkUrl, schemeUrl, and normalUrl returned in Step 1. For how to use these URLs, see Best practices for configuring the authorization URL.
The figure below shows a sample rendering of the payment method checkout page:
First payment

Subsequent payments

In some scenarios, risk control may require the buyer to complete OTP verification.
Step 3: Obtain the authorization and payment result
Return to the payment result page
After the buyer completes the payment, they will be redirected back to the paymentRedirectUrl specified in the pay (Tokenized Payment) API.
Note: Redirection may not occur in certain scenarios. For example, it may fail due to buyer actions or network issues.
Obtain the authorization and payment result
The first payment returns both the authorization result and the payment result, while subsequent payments return only the payment result. Common scenarios are as follows:
Obtain the authorization result
When the authorization is successful during the first payment, Antom sends you the asynchronous notification through the notifyAuthorization API.
- Follow the steps below to set the notification webhook URL:
Log in to Antom Dashboard > Developer > Notification URL. Add the notification URL to alipay.ams.authorizations.notify. Refer to Notification URL for detailed steps.
The following code shows a sample of the asynchronous authorization notification request:
Based on the value of result.resultStatus in the authorization result notification request (only
S
is returned), process as follows:S
: Indicates successful authorization, and the following parameters are returned:The table below shows the token validity period for each payment method:
- The result notification sent by Antom is signed by Antom, it is recommended that you verify the signature to confirm that the notification was sent by Antom. Refer to the following code example to verify the notification:
- After the first or subsequent payment is completed, you can obtain the payment result through one of the following methods:
Obtain the payment result
After the first or subsequent payment is completed, you can obtain the payment result through one of the following methods:
- Receive the asynchronous notification: Receive the payment result delivered by the Antom server.
- Inquire about the result: Call inquiryPayment API to query payment status.
Receive the asynchronous notification
- Follow the steps below to set the notification webhook URL:
When the payment reaches a final status of success or failure, Antom sends an asynchronous notification to your configured webhook URL. You can choose one of the following two methods to set up the Webhook URL for receiving notifications:
- Order-level notification configuration: Specify an independent notification URL for each order through the paymentNotifyUrl parameter in the pay (Tokenized Payment) API request.
- Merchant-level notification configuration: Log in to Antom Dashboard > Developer > Notification URL and add a notification URL for the alipay.ams.payments.payNotify API. For specific operations, refer to Notification URL.
Note: If you have configured notification URLs through both methods mentioned above, the API settings will take precedence.
The following code shows a sample of the notification request:
The table below displays the possible values returned in the resultStatus parameter of the response. Please follow the corresponding instructions for handling:
- The result notification sent by Antom is signed by Antom, it is recommended that you verify the signature to confirm that the notification was sent by Antom. Refer to the following code example to verify the notification:
- After receiving the notification, you are not required to sign the response, but must reply to every notification request in the following standardized format, regardless of whether the payment was successful or not.
Inquire about the payment result
Call the inquiryPayment API to initiate a query on the payment result. The payment status can be checked via polling or scheduled tasks after the payment is initiated.
The following code shows a sample of the request message:
The following code shows a sample of the response message:
Please process the response based on the value of the paymentStatus parameter. For specific return values, refer to the inquiryPayment API documentation.
Common questions
Q: When is the payment notification sent?
A: It depends on whether the payment is completed: If the payment is successfully completed, Antom usually sends an asynchronous notification within 3 to 5 seconds.
Q: Is there an asynchronous notification sent for authorization failure?
A: No. An asynchronous notification will only be sent if the authorization is successful; there will be no notification returned for authorization failure.
Q: Will the asynchronous notification be re-sent?
A: Yes, the asynchronous notification will be re-sent automatically within 24 hours for the following cases:
- If you didn't receive the asynchronous notification due to network reasons.
- If you receive an asynchronous notification from Antom, but you didn't make a response to the notification in the sample code format of Process the notification.
The notification can be resent up to 8 times or until a correct response is received to terminate delivery. The sending intervals are as follows: 0 minutes, 2 minutes, 10 minutes, 10 minutes, 1 hour, 2 hours, 6 hours, and 15 hours.
Q: Are the authorization notification and payment result notification sent separately, and will the authorization notification always be received before the payment result notification?
A: Due to the uncontrollable nature of network stability, it is possible for the authorization notification to arrive later than the payment result notification.
Q: Is authorization result inquiry supported?
A: Currently, calling an API to query the authorization result is not supported.
Q: When responding to an asynchronous notification, do I need to add a digital signature?
A: No. If you receive an asynchronous notification from Antom, you are required to return the response in the sample code format of Process the notification, but you do not need to countersign the response.
After payments
Revoke authorization
After authorization is completed, the buyer can revoke the authorization from either the merchant side or the payment method side. Once revoked, the original authorization token immediately becomes invalid and cannot be used for payments again. For details, refer to Revoke.
Cancel
You can cancel orders through the cancel API within the time window (by D+1 day 00:15 GMT+8). For details, refer to Cancel.
Refund
Reconciliation
After a transaction is completed, use the provided Antom financial reports to perform reconciliation. For settlement rules and reconciliation operations, refer to Reconciliation.
Best practices
Antom provides you with the following best practice solutions. Refer to Best practices for more details.
- Intelligent risk control service
- Order query after redirecting to the merchant result page
- Merchant-initiated transaction cancellation
- Payment failure retry