This document describes the refund workflow for ANexPay XCheckout payments.Refund Scenarios#
User-Initiated Refund
The user requests a refund after completing a successful payment.
Overpayment
The user transfers more than the required order amount.
Underpayment
The user only transfers a partial amount before the order expires.
Processing Flow#
1. Detect Abnormal Payments#
For abnormal scenarios such as overpayment, underpayment, or late payment, developers can retrieve relevant information via:Webhook Notifications
Subscribe to event notifications for real-time abnormal payment updates.
API Query
Call the getAbnormalPayments API to actively retrieve abnormal payment records.
2. Initiate Refund#
Call the createOrderRefund API to initiate a refund.Request Parameters#
| Parameter | Type | Required | Description |
|---|
refundOrderNo | String | Yes | Unique refund ID generated by your system |
orderNo | String | Yes | Associated payment order ID |
address | String | Yes | Recipient wallet address for the refund |
amount | Number | Yes | Refund amount |
3. Check Refund Status#
You can track refund progress and results via:Webhook Notifications#
Subscribe to refund-related events
Receive real-time updates when refund status changes
API Query#
Call the getOrderInfo API to retrieve payment order details and refund status
Developer Notes#
Idempotency
Use a unique refundOrderNo to prevent duplicate refunds.
Reconciliation for Exceptions
Regularly query getAbnormalPayments to reconcile overpayment or underpayment cases.
Address Validation
Ensure the refund address is valid and matches the correct blockchain and token.
Best Practices#
Always verify webhook signatures before processing refund events
Log all refund requests and responses for audit and reconciliation
Implement retry mechanisms for failed refund API calls
Modified at 2026-03-30 18:39:02