Overview
Pre-built, conversion-optimized pages for checkout and customer management. No frontend code required.Checkout Sessions
Create a hosted checkout page for one-time payments or subscriptions.Create Checkout Session
| Parameter | Type | Required | Description |
|---|---|---|---|
mode | string | Yes | payment or subscription |
line_items | array | Yes | Array of price objects with quantity |
success_url | string | Yes | Redirect URL after successful payment |
cancel_url | string | Yes | Redirect URL if customer cancels |
customer | string | No | Existing customer ID |
customer_email | string | No | Pre-fill customer email |
subscription_data.trial_period_days | integer | No | Free trial days |
Redirect to Checkout
Customer Portal Sessions
Let customers manage their subscriptions, payment methods, and invoices.Create Portal Session
| Parameter | Type | Required | Description |
|---|---|---|---|
customer | string | Yes | Customer ID |
return_url | string | Yes | URL to return to after portal |
configuration.features.subscription_cancel | object | No | Object with enabled boolean |
configuration.features.subscription_pause | object | No | Object with enabled boolean |
configuration.features.payment_method_update | object | No | Object with enabled boolean |
configuration.features.invoice_history | object | No | Object with enabled boolean |
Portal Features
| Feature | Description |
|---|---|
| subscription_cancel | Allow customers to cancel subscriptions |
| subscription_pause | Allow customers to pause subscriptions |
| payment_method_update | Allow customers to update payment methods |
| invoice_history | Show invoice history and download PDFs |