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

# Stored payment methods

> Let returning shoppers pay with one click.

**1. Create a customer**

```javascript theme={"dark"}
const customer = await kalixo.customers.create({ reference: 'user-42', email: 'shopper@example.com' });
```

Store `customer.id` on your user. Kalixo encrypts email and name at rest.

**2. Offer to save the card**

```javascript theme={"dark"}
await kalixo.checkoutSessions.create({ ...order, customer: customer.id, store_payment_method: true });
```

The checkout shows a **Save for next time** checkbox. The card is saved only if the shopper ticks it.
You receive `payment_method.attached`.

**3. Pay with one click next time**

Create the next session with the same `customer`. Kalixo.js shows the saved cards automatically.

## Manage saved cards

```javascript theme={"dark"}
const methods = await kalixo.customers.listPaymentMethods(customer.id);
await kalixo.customers.detachPaymentMethod(customer.id, methods.data[0].id);
```

`available: false` means the card cannot be used for new payments right now (for example
after a change on Kalixo's side). Kalixo.js hides unavailable cards; the shopper enters
the card again once.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.