post
https://www.pelcro.com/api/v1/sdk/payment_methods
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Overview
Attach a payment method to the authenticated customer from a gateway token. The card is created through your account's active payment gateway. On success the new payment method is returned with HTTP 201; the first method a customer adds becomes their default. A setup_intent is returned when the card requires extra authentication (e.g. 3D Secure).
Example:
curl --request POST \
--url 'https://www.pelcro.com/api/v1/sdk/payment_methods?site_id=1232' \
--header 'Authorization: Bearer <JWT>' \
--header 'Content-Type: application/json' \
--data '{ "token": "pm_card_visa", "is_default": true }'Conditional Requirements
tokenis required; omitting it returns404.- A declined card returns
404with a reason-specific message (declined / expired / incorrect CVC / processing error). - A customer can store at most 200 payment methods; beyond that, creation returns
404.
