Attach a payment method to a customer.
Prefer a SetupIntent for cards you will charge off-session: attaching directly skips the authentication and mandate a SetupIntent collects.
List payment methods with cursor-based pagination.
Optionaloptions: ListPaymentMethodsOptionsMake a payment method the customer's default for invoices and
subscriptions (invoice_settings.default_payment_method). The payment
method must already be attached to the customer.
Optionaloptions: { idempotencyKey?: string }The updated customer
Payment Methods service wrapping Stripe PaymentMethods: read, attach to and detach from customers, and set a customer's default.
To save a card for later (off-session) charges, collect it with a SetupIntent (see
setupIntents); Stripe attaches it to the customer when the SetupIntent succeeds.Example