1. XCheckout
ANexPay Docs
  • XCheckout
    • Introduction
    • Quick Start
    • Checkout Flow
    • Payment
    • Refund
    • Settlement
    • Webhook
    • Enum Reference
    • Api Reference
      • Authentication
        • Get AccessToken
      • payment order
        • CreateOrder
        • CancelOrder
        • GetOrderInfo
        • GetOrderList
      • refund
        • CreateRefund
        • CancelRefund
        • GetRefundInfo
        • GetRefundList
      • settlement
        • CreateSettlement
        • CancelSettlement
        • GetSettlementInfo
        • GetSettlementList
      • webhook
        • webhook
  • Agentic Payment
  1. XCheckout

Checkout Flow

This document describes the end-to-end payment flow for ANexPay XCheckout, from order creation to payment confirmation and status update.

1. Open the Payment Page#

ANexPay XCheckout supports flexible checkout integration and allows optional customization such as branded pages, logo, and theme color.
Two access methods are supported:
In-App WebView
Open the checkout page inside a mobile application through WebView.
Browser Redirect
Redirect the user to the hosted checkout page using a standard browser.

2. Create a Checkout Order#

Your system must call the CreateCheckoutOrder API to generate a payment order. Once created, the API will return the checkout page URL, which you can use to direct the user to payment.

Request Parameters#

ParameterTypeRequiredDescription
orderNoStringYesUnique order number generated by your system
customerIdStringYesUnique user ID in your system
merchantIdStringNoUnique merchant ID in your system, used for platform or multi-merchant scenarios
orderAmountNumberYesOrder amount in USD
tokenStringYesPayment token selected by the user, such as ETH_USDT
expiredInNumberYesOrder expiration time in seconds

Notes#

orderNo must be unique to prevent duplicate order creation
orderAmount is denominated in USD and converted into the selected stablecoin based on the real-time exchange rate
expiredIn controls how long the payment page remains valid

3. Display Payment Information#

After the order is created, the checkout page will display the payment details automatically.

Key Information Shown to the User#

Payable Amount (payableAmount)
The amount of stablecoin the user needs to pay, calculated using the current exchange rate
Deposit Address (depositAddress)
The wallet address generated for the selected token
Order Status
The current order state, such as pending, paid, expired, or partially paid

4. User Completes Payment#

The user can complete payment in one of the following ways:
Wallet Connect / Direct Payment
The user connects a supported wallet and submits payment directly from the checkout page
Manual Transfer
The user copies the deposit address and transfers funds manually from an external wallet
Once payment is submitted on-chain, ANexPay XCheckout monitors the target address and detects the incoming transaction automatically.

5. Payment Detection and Confirmation#

After detecting the incoming transfer, the system verifies:
the destination address
the selected token
the transferred amount
the order validity period
the blockchain transaction status
If the payment is valid, the order status is updated accordingly.

6. Retrieve Order Status#

Your system can retrieve payment results using either or both of the following methods.

Webhook Notification#

Configure a Webhook endpoint to receive real-time notifications whenever the order status changes.
Recommended practices:
verify the Webhook signature
implement idempotent processing
log all event deliveries for reconciliation

API Query#

Call the GetCheckoutOrderInfo API to query the latest order status at any time.
This is useful for:
active polling during checkout
reconciliation jobs
fallback when Webhook delivery is delayed

7. Typical Payment Lifecycle#

A typical order lifecycle may look like this:
1.
Your system creates a checkout order
2.
ANexPay XCheckout returns the hosted payment page URL
3.
The user opens the payment page
4.
The user pays using wallet connection or manual transfer
5.
The system detects the on-chain payment
6.
The order status is updated
7.
Your system receives the result by Webhook or queries it through API

8. Abnormal Payment Scenarios#

The following exceptions may occur during payment:
Overpayment
The user transfers more than the required amount
Underpayment
The user transfers less than the required amount
Late Payment
The user completes payment after the order has expired
These scenarios can be monitored through Webhook notifications or abnormal payment query APIs, and may require refund or manual reconciliation handling.

9. Developer Recommendations#

Use a unique orderNo for every payment order
Set a reasonable expiredIn value based on user experience and business needs
Use both Webhook and API query for production-grade reliability
Reconcile abnormal payments regularly
Validate payment status on your server side before releasing goods or services

10. Suggested Flow Summary#

Create Order → Open Checkout Page → User Pays → System Detects Payment → Order Status Updated → Webhook / API Confirmation
Modified at 2026-03-30 18:38:29
Previous
Quick Start
Next
Payment
Built with