Create a new checkout session. Supports two modes: subscription (start a recurring plan) and credit_bundle (one-time credit pack purchase). Pass the returned checkout_session_token to the @lavapayments/checkout SDK to open the checkout flow.
Bearer token authentication used for standard API calls. Format: 'Bearer YOUR_API_KEY'
Checkout mode: 'subscription' creates a recurring subscription checkout, 'credit_bundle' purchases a credit pack for an existing subscriber
subscription, credit_bundle "subscription"
Origin url where the checkout will be opened
"https://your-app.example.com/"
Required for credit_bundle mode. Optional for subscription mode — omit for new customers (checkout collects identity and creates a connection) or include for returning customers (reuses the existing connection).
"con_test_01KK2NQPKARMY7D3HK65C2ZSYK"
Required when checkout_mode is 'subscription' - identifies the subscription configuration to use
"sc_123"
Required when checkout_mode is 'credit_bundle' - identifies the credit bundle to purchase
"cb_abc123"
Checkout session created
Unique identifier for the checkout session
"cs_test_01KK2NQPK7CXRHEW42Z4X4M06R"
Opaque token for the @lavapayments/checkout SDK. Pass this to open() to launch the checkout flow.
"eyJzZWNyZXQiOiJjc3NfdGVzdF9uZDFWT284MkZiSHE0U3JpUklsYXVILW91ZldHbVN1eVp6SHhmVVczMXdpd21uM2lCSlJiZG1jIiwiYmFzZSI6Imh0dHA6Ly9sb2NhbGhvc3Q6MzAwMC8ifQ=="
Checkout mode: 'subscription' creates a recurring subscription checkout, 'credit_bundle' purchases a credit pack for an existing subscriber
subscription, credit_bundle "subscription"
Origin url where the checkout will be opened
"https://your-app.example.com/"
ISO 8601 timestamp when the checkout session was created
"2023-05-15T08:30:00Z"
Identifier for the connection (only available after checkout completion)
"con_test_01KK2NQPK9K6Y6KRFERDXFM56R"
Identifier for the subscription configuration (only available for subscription mode)
"sc_123"
If completed, ISO 8601 timestamp when the checkout was completed
"2023-05-15T08:35:42Z"