Create a hosted checkout session
const url = 'https://console.orangepill.cloud/v4/checkout/sessions/';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","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"}}'};
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/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" } }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Two modes — ad-hoc (amount + currency) and product-backed (items). amount/currency and items are mutually exclusive.
object
Payment methods available to the customer. Omit or pass [] to allow all configured methods.
Payment amount in major currency units (e.g. “50.00”). Required for ad-hoc mode; omit for product mode.
Redirect URL when customer cancels
ISO-4217 currency code. Required for ad-hoc mode; derived from items for product mode.
Customer identifier (required for wallet)
Session TTL (default 1800)
Integration namespace for fan-out webhooks
Line items for product-backed sessions. Mutually exclusive with amount+currency.
A single line item for product-backed checkout session creation
object
Merchant to associate with the session
object
Your order ID for correlation
Redirect URL on successful payment
object
Responses
Section titled “Responses”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)