Payment-method tools
Attach, list, and detach saved cards on a customer.
Payment methods are EPD Commerce’s reference to cards held in EPD’s secure vault. See Card Vaulting for the full model.
Tools
add_payment_method
Attach a card to a customer with a card_token (cct_…) captured in the browser with EPD Elements. The card is tokenized client-side and vaulted in EPD’s secure vault. Raw card data never reaches your servers or the add_payment_method API.
| readOnly | destructive | idempotent | openWorld |
|---|---|---|---|
false | false | true | false |
Required parameters:
customer_idcard_token: single-usecct_…from the EPD Elements browser SDK. Expires 15 minutes after capture and can be used once.
Optional:
billing_details: cardholder name + billing address stored with the card. Used withcard_token; some processors require a full billing address to vault. Fields:name,address1,address2,city,state,zip,country(ISO 3166-1 alpha-2),email,phone, all optional;name/email/phonefall back to the customer record.set_as_default: set this card as the customer’s default for future charges.update_subscriptions: whenset_as_default: true, also switch every active subscription over to this new default card.idempotency_key
list_payment_methods
List all payment methods on a single customer.
| readOnly | destructive | idempotent | openWorld |
|---|---|---|---|
true | false | true | false |
delete_payment_method
Detach a saved card from a customer. The stored card is removed from the customer; the underlying vault entry is governed separately.
| readOnly | destructive | idempotent | openWorld |
|---|---|---|---|
false | true | true | false |
If the card is the customer’s default or is attached to an active subscription, the delete is rejected unless you pass replacement_payment_method (the UUID of another saved card on the same customer). EPD moves the affected subscriptions onto that card, then removes the old one. A card that is neither the default nor tied to an active subscription is deleted without a replacement.