v2

latestOpenAPI 3.0.0raw.githubusercontent.com2026-02-16143114179.4 KB
Payment Methods

Save a payment method

post/api/payment-methods

Request body

customerIdstring required
providerstring required

Payment provider (stripe, paystack, flutterwave, dpo, payu, pesapal)

type'CARD' | 'BANK_ACCOUNT' | 'WALLET'
tokenIdstring required

Provider-specific token/payment method ID

last4string
brandstring
expMonthnumber
expYearnumber
cardholderNamestring
countrystring

Example request

{
  "customerId": "cus_abc123",
  "provider": "stripe",
  "type": "CARD",
  "tokenId": "pm_abc123",
  "last4": "4242",
  "brand": "visa",
  "expMonth": 12,
  "expYear": 2028,
  "cardholderName": "John Doe",
  "country": "US"
}

Response

Payment method saved successfully

idstring required
customerIdstring required
providerstring required
typestring required
tokenIdstring required
isDefaultboolean required
last4string
brandstring
expMonthnumber
expYearnumber
cardholderNamestring
countrystring
createdAtstring date-time required
updatedAtstring date-time required

Example response

{
  "id": "pm_abc123",
  "customerId": "cus_abc123",
  "provider": "stripe",
  "type": "CARD",
  "tokenId": "pm_1234567890",
  "isDefault": true,
  "last4": "4242",
  "brand": "visa",
  "expMonth": 12,
  "expYear": 2028,
  "cardholderName": "John Doe",
  "country": "US",
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}