Create a checkout session and get a hosted checkout URL
| Parameter | Type | Required | Description |
|---|---|---|---|
reference_id | string | Yes | Your order or cart ID for correlation |
customer | object | Yes | Customer information |
customer.email | string | Yes | Customer email |
customer.first_name | string | Yes | Customer first name |
customer.last_name | string | Yes | Customer last name |
customer.phone | string | No | Customer phone number |
line_items | array | Yes | Products being purchased |
line_items[].product_id | string | Yes | Your product ID (must match synced product) |
line_items[].name | string | Yes | Product name |
line_items[].image_url | string | No | Product image URL |
line_items[].price | integer | Yes | Unit price in cents |
line_items[].quantity | integer | Yes | Quantity |
line_items[].currency | string | Yes | Currency code (e.g., "USD") |
shipping_info | object | Yes | Shipping address |
shipping_info.address_line_1 | string | Yes | Address line 1 |
shipping_info.address_line_2 | string | No | Address line 2 |
shipping_info.city | string | Yes | City |
shipping_info.state | string | Yes | State |
shipping_info.postal_code | string | Yes | ZIP/Postal code |
shipping_info.country | string | Yes | Country code (e.g., "US") |
billing_info | object | No | Billing address (defaults to shipping if omitted) |
billing_info.address_line_1 | string | Yes | Address line 1 |
billing_info.address_line_2 | string | No | Address line 2 |
billing_info.city | string | Yes | City |
billing_info.state | string | Yes | State |
billing_info.postal_code | string | Yes | ZIP/Postal code |
billing_info.country | string | Yes | Country code (e.g., "US") |
shipping | integer | No | Shipping amount in cents |
tax | integer | No | Tax amount in cents |
discount | integer | No | Discount amount in cents |
success_url | string | Yes | Redirect URL after successful payment |
failure_url | string | Yes | Redirect URL if payment fails or customer cancels |
metadata | object | No | Custom key-value pairs |
metadata.webhook_url | string | No | URL to receive payment webhooks (recommended) |
| Field | Type | Description |
|---|---|---|
checkout_id | string | Unique checkout session identifier |
checkout_url | string | Hosted checkout page URL — redirect customer here |
status | string | Session status (open) |
expires_at | timestamp | When session expires (24 hours) |
| Type | Description |
|---|---|
eligible | All items are HSA/FSA eligible |
split | Mix of eligible and non-eligible items |
regular | No items are eligible |
| Status | Description |
|---|---|
open | Checkout session created, awaiting customer |
paid | Customer completed payment, order created |
expired | Session expired (24 hours) |
order.created webhook:
| Status Code | Error Code | Description |
|---|---|---|
| 400 | bad_request | Missing or invalid parameters |
| 401 | unauthorized | Invalid API key |
| 422 | validation_error | Field validation failed |