Payment Methods
Payment methods represent a customer's stored payment instruments (currently cards held in EPD's secure vault).
Each customer can have multiple payment methods. One is always designated as the default, which is used for new subscriptions and orders when no specific method is provided.
Important: Add a card with a
card_tokenfrom EPD Elements, or capture it server-to-server with Inbound Card Capture, which attaches it for you (nocard_token).
/customers/{id}/payment_methods Add a payment method
Attaches a card to a customer using a card_token: a single-use cct_… from EPD Elements. Your frontend captures the card in the browser and exchanges it for the token; your backend sends that token here with your secret key.
No browser in the loop? Inbound Card Capture is a server-to-server alternative: you POST the raw card to secure.epd.com and it captures and attaches the card in one call, returning the same payment method object. There is no card_token and no separate call to this endpoint.
How It Works (EPD Elements)
- Capture the card in the browser with EPD Elements and your publishable key
- The SDK returns a single-use
card_token(cct_…, valid 15 minutes) - Send that
card_tokento this endpoint with your secret key: EPD vaults the card and creates the payment method
Options
| Parameter | Default | Description |
|---|---|---|
set_as_default |
false |
Make this the customer's default payment method |
update_subscriptions |
false |
Update all active subscriptions to use this card |
Tip: Set both
set_as_default: trueandupdate_subscriptions: truewhen replacing an expired card.
Sandbox Testing
In sandbox mode, capture a test card with EPD Elements or Inbound Card Capture to get a usable card_token.
Path parameters
string"550e8400-e29b-41d4-a716-446655440000"Header parameters
string"2026-02-11"string (uuid)"550e8400-e29b-41d4-a716-446655440000"Request body required
string"cct_3f8a1c9e7b2d4a6f0e1c3b5d7f9a1c3e5b7d9f0a2c4e6b8d"booleantruebooleanfalseobjectstring"Jane Doe"string"123 Market St"string"Suite 400"string"San Francisco"string"CA"string"94103"string"US"string (email)"jane@example.com"string"+14155551234"Code samples
curl -X POST https://api.epd.com/v1/customers/550e8400-e29b-41d4-a716-446655440000/payment_methods \
-H "Authorization: Bearer epd_test_sk_xxxx" \
-H "Content-Type: application/json" \
-H "EPD-Version: 2026-02-11" \
-d '{
"card_token": "cct_3f8a1c9e7b2d4a6f0e1c3b5d7f9a1c3e5b7d9f0a2c4e6b8d",
"set_as_default": true,
"update_subscriptions": true
}' const response = await fetch(
'https://api.epd.com/v1/customers/550e8400-e29b-41d4-a716-446655440000/payment_methods',
{
method: 'POST',
headers: {
'Authorization': 'Bearer epd_test_sk_xxxx',
'Content-Type': 'application/json',
},
body: JSON.stringify({
card_token: 'cct_3f8a1c9e7b2d4a6f0e1c3b5d7f9a1c3e5b7d9f0a2c4e6b8d',
set_as_default: true,
}),
}
);
const pm = await response.json();
console.log(pm.id); // 6ba7b815-9dad-11d1-80b4-00c04fd430c8
console.log(pm.card.last4); // "4242" Responses
string"6ba7b815-9dad-11d1-80b4-00c04fd430c8"enumcardobjectstring"visa"string"4242"string"12/2025"string"550e8400-e29b-41d4-a716-446655440000"booleantruestring (date-time)"2024-01-15T10:30:00.000Z"objectenuminvalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_errorstring"validation_error"string"Request validation failed"string"email"string"req_a1b2c3d4e5f67890abcdef0123456789"array[object]objectenuminvalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_errorstring"validation_error"string"Request validation failed"string"email"string"req_a1b2c3d4e5f67890abcdef0123456789"array[object]objectenuminvalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_errorstring"validation_error"string"Request validation failed"string"email"string"req_a1b2c3d4e5f67890abcdef0123456789"array[object]/customers/{id}/payment_methods/{pm_id} Delete a payment method
Removes a payment method from a customer. If it's the default or used by active subscriptions, a replacement must be provided.
Path parameters
string"550e8400-e29b-41d4-a716-446655440000"string"6ba7b815-9dad-11d1-80b4-00c04fd430c8"Header parameters
string"2026-02-11"string (uuid)"550e8400-e29b-41d4-a716-446655440000"Request body
string"6ba7b815-9dad-11d1-80b4-00c04fd430d1"Responses
string"6ba7b815-9dad-11d1-80b4-00c04fd430c8"truestring"Payment method successfully deleted."objectenuminvalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_errorstring"validation_error"string"Request validation failed"string"email"string"req_a1b2c3d4e5f67890abcdef0123456789"array[object]objectenuminvalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_errorstring"validation_error"string"Request validation failed"string"email"string"req_a1b2c3d4e5f67890abcdef0123456789"array[object]objectenuminvalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_errorstring"validation_error"string"Request validation failed"string"email"string"req_a1b2c3d4e5f67890abcdef0123456789"array[object]