Payment Methods

Overview

Payment methods represent stored payment instruments for customers. They are used to charge customers for subscriptions and one-time purchases.


How It Works

  1. Collect payment details — Customer enters card information via your checkout
  2. Tokenize securely — Payment details are tokenized by the payment gateway
  3. Create payment method — The token is saved and attached to the customer
  4. Charge automatically — Future payments use the stored payment method

Example: A customer enters their Visa card during checkout. The card is tokenized by Stripe, stored as a payment method, and used to pay for their monthly subscription automatically.


API Endpoints

MethodEndpointDescription
GETList payment methodsRetrieve a paginated list of payment methods
POSTCreate payment methodAttach a new payment method to a customer
GETGet payment methodRetrieve a specific payment method
DELETEDelete payment methodRemove a payment method

Important Behaviors

  • Soft delete: Payment methods are soft-deleted, not permanently removed.
  • Subscription guard: Cannot delete a payment method that is associated with an active subscription.
  • Auto-default: When a new payment method is created, it is automatically set as the customer's default.
  • Billing auto-update: Creating a payment method switches the customer's subscriptions to charge automatically using the new default source.
  • Max 10 per customer: A customer can have at most 10 payment methods.
  • Gateway auto-detect: If object_gateway is omitted on create, the account's active payment gateway is used.

Supported Payment Method Types

The brand field in the response identifies the payment method type:

Typebrand valueDescription
Credit/Debit CardVisa, Mastercard, Amex, etc.Standard card payments
BACS Direct Debitbacs_debitUK bank direct debit
US Bank Account (ACH)us_bank_accountUS bank account transfers
PayPalpaypalPayPal payments

Supported Gateways

GatewayDescription
stripePrimary payment processor
tapMiddle East payment gateway
vantivEnterprise payment processing
cybersourceEnterprise payment processing
braintreePayPal/Braintree payments

Payment Method Object

AttributeTypeDescription
idintegerUnique identifier
object_gatewaystringPayment gateway (stripe, tap, vantiv, etc.)
object_idstringPayment gateway's token/source ID
brandstring|nullPayment method type: card brand (Visa, Mastercard), or bacs_debit, us_bank_account, paypal
last4string|nullLast 4 digits of the card or account
exp_monthstring|nullCard expiration month
exp_yearstring|nullCard expiration year
cvc_checkstring|nullCVC verification result
address_zip_checkstring|nullPostal code verification result
address_line1_checkstring|nullAddress verification result
fundingstring|nullCard funding type: credit, debit, prepaid
countrystring|nullTwo-letter ISO country code of card issuer
fingerprintstring|nullUnique card fingerprint for duplicate detection
three_d_securestring|null3D Secure status
namestring|nullCardholder name
tokenization_methodstring|nullHow card was tokenized (apple_pay, google_pay)
dynamic_last4string|nullDynamic last 4 digits (for mobile wallets)