Save a card at checkout
Create the customer first, then passcustomerId and setupFutureUsage: "off_session" on a payment session. Cards only: send paymentMethodTypes: ["card"] or leave it out.
type: "setup" and customerId, and no lineItems or amountMinor. The customer confirms their card for a zero amount, and the session completes with paymentStatus: "no_payment_required".
When the session completes, the card becomes the customer’s payment method. Within a few minutes you receive payment_method.attached with the brand, last four digits and expiry; its checkoutSessionId names the session that saved it. List a customer’s cards with GET /api/v1/customers/{id}/payment-methods.
Charge a saved card
Idempotency-Key is required: retry with the same key and you get the same payment, never a second charge.
Off-session charges run your fraud rules like any other payment.
Detach a card
DELETE /api/v1/customers/{id}/payment-methods/{paymentMethodId} detaches the card: it disappears from the list and can no longer be charged. You receive payment_method.detached. Detach a card when the customer removes it or withdraws consent.