Skip to content

Create payment link

POST
/v4/payment-links
curl --request POST \
--url https://console.orangepill.cloud/v4/payment-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "allowed_product_keys": [ "example" ], "amount": "example", "cancel_url": "https://example.com", "currency": "example", "description": "example", "expires_at": "2026-04-15T12:00:00Z", "max_uses": 1, "merchant_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "metadata": { "additionalProperty": "example" }, "price_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "product_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "quantity": 1, "slug": "example", "success_url": "https://example.com", "title": "example" }'

Create a payment link. Supports two modes: ad-hoc (amount+currency) or product-backed (product_id+price_id). Amount/currency are snapshotted at creation time in product mode and never recalculated.

Media typeapplication/json
object
allowed_product_keys

Payment methods available. Omit to allow all configured methods.

Array<string>
amount

Ad-hoc mode: amount in major currency units. Required if product_id is absent.

string
>= 1 characters
cancel_url
required
string format: uri
currency

Ad-hoc mode: ISO-4217 currency code. Required if product_id is absent.

string
>= 3 characters <= 3 characters
description
string
<= 1000 characters
expires_at
string format: date-time
max_uses

Max completions (not opens). Unlimited if omitted.

integer
>= 1
merchant_id
required
string format: uuid
metadata
object
key
additional properties
price_id

Product mode: price to use for amount derivation. Required if product_id is present.

string format: uuid
product_id

Product mode: product to link. Required if price_id is present.

string format: uuid
quantity

Product mode: quantity multiplier for amount calculation. Defaults to 1.

integer
>= 1
slug

URL-safe identifier. Auto-generated if omitted.

string
/^[a-z0-9-]{3,64}$/
success_url
required
string format: uri
title
required
string
>= 1 characters <= 200 characters

Example generated

{
"allowed_product_keys": [
"example"
],
"amount": "example",
"cancel_url": "https://example.com",
"currency": "example",
"description": "example",
"expires_at": "2026-04-15T12:00:00Z",
"max_uses": 1,
"merchant_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"metadata": {
"additionalProperty": "example"
},
"price_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"product_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"quantity": 1,
"slug": "example",
"success_url": "https://example.com",
"title": "example"
}

Payment link created

Media typeapplication/json
object
allowed_product_keys
required
Array<string>
amount
required

Snapshotted amount in major currency units

string
cancel_url
required
string
completion_count
required
integer
created_at
required
string format: date-time
currency
required
string
description
string
nullable
expires_at
string format: date-time
nullable
id
required
string format: uuid
max_uses
integer
nullable
merchant_id
required
string format: uuid
metadata
required
object
key
additional properties
price

Present when payment link was created in product mode

object
currency
string
id
string format: uuid
recurring_interval
string
nullable
recurring_interval_count
integer
nullable
type
string
Allowed values: one_time recurring
unit_amount
string
price_id
required
string format: uuid
nullable
product

Present when payment link was created in product mode

object
description
string
nullable
id
string format: uuid
name
string
status
string
product_id
required
string format: uuid
nullable
project_id
required
string format: uuid
public_url

Present on creation response only

string
quantity
required

Present in product mode

integer
nullable >= 1
slug
required
string
status
required
string
Allowed values: active inactive archived
success_url
required
string
tenant_id
required
string format: uuid
title
required
string
updated_at
required
string format: date-time
use_count
required
integer

Example

{
"price": {
"type": "one_time"
},
"status": "active"
}

Validation error

Media typeapplication/json
object
details
error
required
string
success
required
boolean

Example

{
"success": false
}

Product or price not found

Media typeapplication/json
object
details
error
required
string
success
required
boolean

Example

{
"success": false
}

Slug conflict

Media typeapplication/json
object
details
error
required
string
success
required
boolean

Example

{
"success": false
}

Archived product/price or invalid creation mode

Media typeapplication/json
object
details
error
required
string
success
required
boolean

Example

{
"success": false
}