Skip to main content
POST
/
payment-links
Create a payment link
curl --request POST \
  --url https://api.billing.io/v1/payment-links \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount_usd": 29.99,
  "payment_method_id": "<string>",
  "description": "<string>",
  "expires_in_seconds": 301
}
'
{
  "id": "pl_1a2b3c4d5e",
  "org_id": "<string>",
  "amount_usd": 123,
  "payment_method_id": "<string>",
  "description": "<string>",
  "url": "<string>",
  "expires_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z"
}
Create a shareable payment link that generates a checkout when visited.
curl -X POST https://api.billing.io/v1/payment-links \
  -H "Authorization: Bearer $BILLING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount_usd": 29.99,
    "payment_method_id": "pm_a1b2c3d4e5f6",
    "description": "Pro Plan - Monthly"
  }'
Response
{
  "id": "pl_a1b2c3d4e5f6a7b8c9d0e1f2",
  "amount_usd": 29.99,
  "payment_method_id": "pm_a1b2c3d4e5f6",
  "description": "Pro Plan - Monthly",
  "url": "https://pay.billing.io/pl_a1b2c3d4e5f6a7b8c9d0e1f2",
  "created_at": "2025-01-15T12:00:00Z"
}

Authorizations

Authorization
string
header
required

Use your secret API key as a Bearer token. Keys are prefixed: sk_live_ (production) or sk_test_ (sandbox).

Body

application/json
amount_usd
number<double>
required

Amount in USD

Required range: x >= 0.01
Example:

29.99

payment_method_id
string
required

The payment method to use for checkouts

description
string

Description shown on the payment page

Maximum string length: 512
expires_in_seconds
integer

Link TTL in seconds

Required range: x >= 300

Response

Payment link created

id
string

Unique identifier (prefixed pl_)

Example:

"pl_1a2b3c4d5e"

org_id
string

Organization identifier

amount_usd
number<double>

Amount in USD

payment_method_id
string

Payment method identifier

description
string | null

Description shown on the payment page

url
string<uri>

Shareable payment link URL

expires_at
string<date-time> | null
environment
enum<string>
Available options:
live,
sandbox
created_at
string<date-time>