Create payment link
const url = 'https://console.orangepill.cloud/v4/payment-links';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Payment methods available. Omit to allow all configured methods.
Ad-hoc mode: amount in major currency units. Required if product_id is absent.
Ad-hoc mode: ISO-4217 currency code. Required if product_id is absent.
Max completions (not opens). Unlimited if omitted.
object
Product mode: price to use for amount derivation. Required if product_id is present.
Product mode: product to link. Required if price_id is present.
Product mode: quantity multiplier for amount calculation. Defaults to 1.
URL-safe identifier. Auto-generated if omitted.
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"}Responses
Section titled “Responses”Payment link created
object
Snapshotted amount in major currency units
object
Present when payment link was created in product mode
object
Present when payment link was created in product mode
object
Present on creation response only
Present in product mode
Example
{ "price": { "type": "one_time" }, "status": "active"}Validation error
object
Example
{ "success": false}Product or price not found
object
Example
{ "success": false}Slug conflict
object
Example
{ "success": false}Archived product/price or invalid creation mode
object
Example
{ "success": false}