Skip to main content
POST
/
sources
Create source (publishable)
curl --request POST \
  --url https://api.piriod.com/sources/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "gateway": "<string>",
  "customer": "<string>",
  "usage": "single",
  "amount": 123,
  "description": "<string>",
  "return_url": "<string>",
  "client": {},
  "metadata": {}
}
'
{
  "gateway": "<string>",
  "id": 123,
  "customer": "<string>",
  "usage": "single",
  "status": "failed",
  "amount": 123,
  "description": "<string>",
  "return_url": "<string>",
  "gateway_data": {},
  "client": {},
  "metadata": {},
  "card": {
    "brand": "<string>",
    "last4": "<string>",
    "exp_month": 123,
    "exp_year": 123
  },
  "test_mode": true,
  "created": "2023-11-07T05:31:56Z",
  "updated": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://piriod-d406ac55.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Use header Authorization: Token <api_token>. API tokens are obtained from the Piriod dashboard.

Body

application/json

A payment source: either a single-use intent (e.g. one-off bank transfer) or a reusable tokenization (e.g. saved card).

gateway
string
required

Gateway ID (e.g. transbank, stripe, ach_transfer).

customer
string | null

Customer ID. Required for reusable sources.

usage
enum<string>
default:single
Available options:
single,
reusable
amount
number | null
description
string | null
Maximum string length: 256
return_url
string<uri> | null

URL the payer is sent to after a redirect-flow tokenization.

client
object

Client metadata captured at creation time (IP, user agent, etc.).

metadata
object

Response

Source created.

A payment source: either a single-use intent (e.g. one-off bank transfer) or a reusable tokenization (e.g. saved card).

gateway
string
required

Gateway ID (e.g. transbank, stripe, ach_transfer).

id
integer
read-only
customer
string | null

Customer ID. Required for reusable sources.

usage
enum<string>
default:single
Available options:
single,
reusable
status
enum<string>
read-only
Available options:
failed,
pending,
requires_authorization,
waiting_authorization,
consumed,
chargeable,
finalized
amount
number | null
description
string | null
Maximum string length: 256
return_url
string<uri> | null

URL the payer is sent to after a redirect-flow tokenization.

gateway_data
object
read-only

Gateway-specific payload (e.g. redirect form fields, token).

client
object

Client metadata captured at creation time (IP, user agent, etc.).

metadata
object
card
object

Card details when the source represents a tokenized card.

test_mode
boolean
read-only
created
string<date-time>
read-only
updated
string<date-time>
read-only