Create payment method

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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

  • token is required; omitting it returns 404.
  • A declined card returns 404 with a reason-specific message (declined / expired / incorrect CVC / processing error).
  • A customer can store at most 200 payment methods; beyond that, creation returns 404.
Query Params
int32
required
Body Params
string
required
boolean
string
enum
Allowed:
Headers
string
required
Defaults to Bearer <token>
string
Defaults to application/json
Responses

Language
Credentials
Query
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json