Customer Experience

  • Merchants can provide a checkbox in their payment flow to let customers choose to save their card.
  • If checked, pass the customerId when creating the payment intent (create a new customer if needed, then use their customerId).
  • On the first successful payment with a customerId, the card is saved to the customer’s profile.
  • On future purchases, customers will see their saved cards as payment options at xPay checkout. (You have to send the customerId in the create-intent request to get the saved cards)
  • Customers can select a saved card to pay instantly, without re-entering card details.
  • Customers can also manage (delete or use another saved card) from the xPay checkout during any transaction.

Developer Flow

1

1. Create Customer

API: POST /customer/create
Request: Customer details (name, email, etc.)
Response: Returns a customerId.
2

2. Create Payment Intent with customerId

API: POST /payment/create-intent
Request: Include the customerId in the payload. Provide payment details (amount, currency, etc.).
Response: Returns an intentId and payment instructions.
If you want the card to be saved for future use, you must pass the customerId in the request. The system will automatically save the card for the customer if the payment is successful and the payment method supports saving.
3

3. Customer Completes Payment

Customer enters card details and completes payment. The card is securely tokenized and saved to the customer’s profile.
4

4. Using Saved Cards

On future purchases, customers will see their saved cards as payment options at xPay checkout. (You have to send the customerId in the create-intent request to get the saved cards)

Summary for Developers

  • To enable saved cards: Always create a customer and use their customerId in payment requests.
  • Customers can manage their saved cards directly from the xPay checkout interface.