Payment methods

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

  1. Add a payment method from a gateway token (the first one added becomes the default).
  2. List or retrieve the customer's stored methods.
  3. Update a method to set it as default or change its card details.
  4. Delete a method that is no longer needed.

API Endpoints

MethodEndpointDescription
POST/api/v1/sdk/payment_methodsCreate payment method
PUT/api/v1/sdk/payment_methods/{payment_method_id}Update payment method
GET/api/v1/sdk/payment_methodsList 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_intent for your front end to complete.