Create source

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

Deprecated

Use the Create payment method endpoint instead. The Source endpoints will be removed in a future version.

Overview

Attach a payment source (card) to the authenticated customer from a payment-gateway token and set it as their default. On success the response is the customer (the new card appears under sources, and as the default source) plus a fresh JWT. When the card requires extra authentication (for example 3D Secure), a setup_intent is returned for your front end to complete.

Example:

curl --request POST \
  --url 'https://www.pelcro.com/api/v1/sdk/source?site_id=1232' \
  --header 'Authorization: Bearer <JWT>' \
  --header 'Content-Type: application/json' \
  --data '{ "token": "tok_visa" }'

Conditional Requirements

  • token (the gateway token) is required; omitting it returns 404.
  • A declined card returns 404 with a reason-specific message (e.g. "Sorry, your card was declined. Please try again.", "…the card has expired…", "…security code (CVC) is incorrect…").
  • A customer can store at most 200 sources; beyond that, creation returns 404.
Query Params
int32
required
Body Params
string
required
string
enum
Defaults to stripe
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