# Customers and saved cards

## Customers

- `POST /api/v1/customers` `{name, email?, phone?}` (phone in E.164, e.g. `+15555550123`)
- `GET /api/v1/customers`, `GET /api/v1/customers/:id`

## Saving a card

A card can be kept on file only with the customer's agreement:

- **Checkout / API:** confirm a payment intent that has a `customer` with `save_payment_method: true` (secret key).
- **Virtual terminal:** tick "Save this card on file" when the customer agrees on the phone.
- **Subscriptions:** the signup page saves the card as part of agreeing to the terms.

The consent (who, when, how) is stored with the card.

## Using saved cards

- `GET /api/v1/customers/:id/payment_methods` — brand, last 4, expiry, funding.
- Charge: create a payment intent for the customer, then confirm with `payment_method: "pm_<id>"`, `off_session: true` if the customer isn't present, and `expected_total` to make sure the price you quoted is the price charged.
- `DELETE /api/v1/payment_methods/:id` — remove (also detached at the gateway).
