Learn how to integrate xPay’s Setup Method flow to securely store and charge customer payment methods.
Create Customer (Merchant Server → xPay Server)
customerId
in the response.
See create-customer API for details.customerId
is required for creating a setup method and charging the payment method later.Create Setup Method (Merchant Server → xPay Server)
setupMethodId
and fwdUrl
in the response.
See create-setup-method API for details.Receive Setup Method Confirmation (xPay Server → Merchant Server)
setupMethodId
, which is used to track the setup status throughout the process.
Forward Setup Method data to Merchant Frontend (Merchant Server → Merchant Frontend)
fwdUrl
to the Merchant Frontend, enabling it to manage user interactions related to the payment method setup.Redirect to xPay Checkout (Merchant Frontend → xPay Client)
fwdUrl
.Handle Setup Method Webhook (xPay Server → Merchant Server)
setup_method.success
event.pmId
(Payment Method ID).pmId
securely in your database for future use.Charge Tokenized Payment Method (Merchant Server → xPay Server)
pmId
, you can charge the customer’s payment method using the charge-tokenised-pm POST request.
See charge-tokenised-pm API for details.Monitor Setup Method Status (Optional)
Track Payment Method Token Status (Optional)
LIVE
: The token is active and can be used for transactionsDELETED
: The token has been deleted and cannot be used for transactions