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

Payment

This guide walks you through the end-to-end order payment flow using ANexPay XCheckout, helping you validate functionality and ensure a smooth integration.

1. Open Payment Page#

The checkout page is flexible and customizable, supporting optional branding such as logo and theme color.
Two integration methods are supported:
In-App (WebView)
Open the ANexPay XCheckout payment page within a mobile app using a WebView.
Browser Redirect
Redirect users to the payment page URL via a standard browser.

2. Create Order & Pass Parameters#

Your system must call the CreateCheckoutOrder API to generate an order, then redirect the user to the returned payment page.
ParameterTypeRequiredDescription
orderNoStringYesUnique order ID generated by your system
customerIdStringYesUnique user ID in your system
merchantIdStringNoMerchant ID in your system (for multi-merchant scenarios)
orderAmountNumberYesOrder amount in USD (converted to stablecoin in real-time)
tokenStringYesPayment token, e.g. ETH_USDT
expiredInNumberYesOrder expiration time (in seconds)

3. Payment Page Display#

Once the order is created, the payment page will automatically display:
Payable Amount (payableAmount)
The converted stablecoin amount based on real-time exchange rates.
Deposit Address (depositAddress)
A dynamically generated address based on the selected blockchain and token.

4. User Payment#

Users can complete the payment in the following ways:
Connect Wallet
Use supported wallets (e.g., MetaMask) to initiate payment directly.
Manual Transfer
Copy the deposit address and transfer funds from any external wallet.
ANexPay XCheckout will automatically detect on-chain transactions sent to the deposit address and update the order status accordingly.

5. Retrieve Order Status#

You can obtain payment results through the following methods:

Webhook Notification#

Configure a webhook endpoint to receive real-time order status updates
Recommended to implement idempotency handling to safely process duplicate notifications

API Query#

Call the GetCheckoutOrderInfo API to actively query the payment status

Best Practices#

Ensure order expiration (expiredIn) is set appropriately to avoid stale transactions
Always verify webhook signatures to ensure authenticity
Use both webhook + polling for higher reliability in production
Modified at 2026-03-30 18:37:24
Previous
Checkout Flow
Next
Refund
Built with