Skip to content

Create a hosted checkout session

POST
/v4/checkout/sessions/
curl --request POST \
--url https://console.orangepill.cloud/v4/checkout/sessions/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "allowed_product_keys": [ "example" ], "amount": "example", "cancel_url": "https://example.com", "currency": "example", "customer_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "expires_in_seconds": 1, "integration_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "items": [ { "product_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "price_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "quantity": 1 } ], "merchant_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "metadata": { "additionalProperty": "example" }, "mode": "payment", "order_reference": "example", "success_url": "https://example.com", "ui_config": { "additionalProperty": "example" } }'
Media typeapplication/json

Two modes — ad-hoc (amount + currency) and product-backed (items). amount/currency and items are mutually exclusive.

object
allowed_product_keys

Payment methods available to the customer. Omit or pass [] to allow all configured methods.

Array<string>
amount

Payment amount in major currency units (e.g. “50.00”). Required for ad-hoc mode; omit for product mode.

string
>= 1 characters
cancel_url
required

Redirect URL when customer cancels

string format: uri
currency

ISO-4217 currency code. Required for ad-hoc mode; derived from items for product mode.

string
/^[A-Z]{3}$/
customer_id

Customer identifier (required for wallet)

string format: uuid
expires_in_seconds

Session TTL (default 1800)

integer
>= 60 <= 86400
integration_id

Integration namespace for fan-out webhooks

string format: uuid
items

Line items for product-backed sessions. Mutually exclusive with amount+currency.

Array<object>

A single line item for product-backed checkout session creation

object
product_id
required
string format: uuid
price_id
required
string format: uuid
quantity
required
integer
>= 1
merchant_id
required

Merchant to associate with the session

string format: uuid
metadata
object
key
additional properties
mode
string
Allowed values: payment setup subscription product
order_reference

Your order ID for correlation

string
success_url
required

Redirect URL on successful payment

string format: uri
ui_config
object
key
additional properties

Default Response

Merchant, product, or price not found

Product or price is archived

Validation error (e.g. mixed currencies, price/product mismatch, missing amount for ad-hoc mode)