Skip to main content
Checkout sessions represent an individual payment attempt. You can create sessions server-side to generate unique checkout URLs for each customer, pre-fill payment details, and track conversions with your own reference IDs.
Checkout sessions expire after 30 minutes by default. Use the expires_in parameter to customize the expiration window (minimum 5 minutes, maximum 24 hours).

The Checkout Session object

string
Unique identifier for the checkout session (e.g., cs_abc123).
string
The checkout URL to redirect the customer to.
string
Current status of the session. One of: open, processing, completed, expired, failed.
Associated payment link ID, if the session was created from a payment link.
string | null
Associated product ID.
string
Contract address of the token to receive.
number
Chain ID where you want to receive payment.
string
Wallet address that receives the payment.
string
Payment amount in the token’s smallest unit.
string | null
USD equivalent at the time of session creation.
string | null
URL the customer is redirected to after successful payment. Supports template variables.
string | null
URL the customer is redirected to if they cancel.
string | null
Your internal reference ID for this session.
object | null
Arbitrary key-value pairs passed through to webhooks and the transaction.
string | null
Email address of the customer. Encrypted at rest, included in webhook payloads.
string | null
Name of the customer. Encrypted at rest, included in webhook payloads.
string | null
Wallet address of the payer (populated after connection).
string | null
On-chain transaction hash (populated after submission).
string | null
Associated customer ID (populated after payment).
object | null
Custom form data submitted by the customer.
object | null
Shipping address provided by the customer.
string | null
UTM source parameter for attribution.
string | null
UTM medium parameter for attribution.
string | null
UTM campaign parameter for attribution.
string
ISO 8601 expiration timestamp.
string
ISO 8601 creation timestamp.
string | null
ISO 8601 completion timestamp.

Session statuses

URL template variables

The success_url and cancel_url fields support template variables that are replaced with actual values when the customer is redirected:
Use template variables to look up session details on your server after redirect: https://example.com/success?session_id={SESSION_ID}

List checkout sessions

Retrieve a paginated list of checkout sessions.
string
Filter by session status: open, processing, completed, expired, failed.
Filter by payment link ID.
number
default:1
Page number for pagination.
number
default:20
Number of results per page (max 100).

Create a checkout session

Create a server-side checkout session with a unique payment URL. Use this for programmatic integrations where you control the checkout flow from your backend.
Create the session from an existing payment link. This inherits the link’s configuration. Either payment_link_id or the manual fields (token_address, chain_id, recipient_address, amount) are required.
string
Contract address of the token to receive. Required if payment_link_id is not provided.
number
Chain ID where you want to receive payment. Required if payment_link_id is not provided.
string
Wallet address that receives the payment. Required if payment_link_id is not provided.
string
Payment amount in the token’s smallest unit. Required if payment_link_id is not provided.
string
Associate the session with a product.
string
URL to redirect the customer to after successful payment. Supports {SESSION_ID} template variable.
string
URL to redirect the customer to if they cancel.
string
Your internal reference ID (e.g., order ID). Maximum 200 characters.
object
Arbitrary key-value pairs passed through to webhooks and the resulting transaction. Up to 50 keys, 500 character values.
string
Customer email address. Encrypted at rest and included in webhook payloads for order fulfillment.
string
Customer name. Encrypted at rest and included in webhook payloads for order fulfillment.
number
default:1800
Session expiration time in seconds. Minimum 300 (5 minutes), maximum 86400 (24 hours). Default: 1800 (30 minutes).
string
UTM source for attribution tracking.
string
UTM medium for attribution tracking.
string
UTM campaign for attribution tracking.

Retrieve a checkout session

string
required
The checkout session ID (e.g., cs_abc123).
Use this endpoint in your success_url handler to verify payment status and retrieve transaction details after the customer is redirected back to your site.
Returns the full Checkout Session object.

Expire a checkout session

Manually expire an open checkout session. This is useful when the underlying order is cancelled or the payment is no longer needed.
string
required
The checkout session ID.
Only sessions with status: "open" can be expired. Attempting to expire a session in any other status will return a 400 Bad Request error.

Common patterns

Server-side checkout flow

A typical server-side integration creates a checkout session on your backend and redirects the customer to the session URL:
Always verify the session status server-side after redirect. Do not rely solely on the redirect to confirm payment — use webhooks for reliable payment confirmation.

Polling for session completion

If you prefer polling over webhooks, you can check the session status periodically:
For production use, we strongly recommend using webhooks instead of polling. Webhooks provide real-time notifications and do not require keeping a connection open.