> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpaycheckout.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Saved Cards

> Enable your customers to save cards for faster future payments and manage their saved cards securely with xPay.

## 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

<Steps>
  <Step title="1. Create Customer">
    <b>API:</b> <a href="/developer-resources/endpoints/customer/create-customer" target="_blank">POST /customer/create</a><br />
    <b>Request:</b> Customer details (name, email, etc.)<br />
    <b>Response:</b> Returns a <code>customerId</code>.
  </Step>

  <Step title="2. Create Payment Intent with customerId">
    <b>API:</b> <a href="/developer-resources/endpoints/payments/create-intent" target="_blank">POST /payment/create-intent</a><br />
    <b>Request:</b> Include the <code>customerId</code> in the payload. Provide payment details (amount, currency, etc.).<br />
    <b>Response:</b> Returns an <code>intentId</code> and payment instructions.<br />
    <Note>If you want the card to be saved for future use, you must pass the <code>customerId</code> in the request. The system will automatically save the card for the customer if the payment is successful and the payment method supports saving.</Note>
  </Step>

  <Step title="3. Customer Completes Payment">
    Customer enters card details and completes payment. The card is securely tokenized and saved to the customer’s profile.
  </Step>

  <Step title="4. Using Saved Cards">
    On future purchases, customers will see their saved cards as payment options at xPay checkout. (You have to send the <code>customerId</code> in the <a href="/developer-resources/endpoints/payments/create-intent" target="_blank">create-intent</a> request to get the saved cards)
  </Step>
</Steps>

***

## Summary for Developers

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