Overview
Payment methods are the cards (and other sources) a customer keeps on file. They are created through your account's active payment gateway and used to charge subscriptions and orders.
How It Works
- Add a payment method from a gateway token (the first one added becomes the default).
- List or retrieve the customer's stored methods.
- Update a method to set it as default or change its card details.
- Delete a method that is no longer needed.
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/sdk/payment_methods | Create payment method |
PUT | /api/v1/sdk/payment_methods/{payment_method_id} | Update payment method |
GET | /api/v1/sdk/payment_methods | List payment methods |
GET | /api/v1/sdk/payment_methods/{payment_method_id} | Retrieve payment method |
DELETE | /api/v1/sdk/payment_methods/{payment_method_id} | Delete payment method |
Important Behaviors
- All endpoints require an authenticated customer (Bearer JWT).
- Cards are created and updated through the account's active gateway (Stripe, Braintree, Cybersource, Vantiv); the token format depends on the gateway.
- The first payment method a customer adds becomes their default.
- A method that is the default, or tied to an active subscription, cannot be deleted.
- When a card requires extra authentication (e.g. 3D Secure), create and update return a
setup_intentfor your front end to complete.
