v1
latestOpenAPI 3.1.02026-07-2684271522.2 KBCheckout Sessions
Create Checkout Session
Creates a Checkout Session. The response includes a hosted redirect_url where the customer completes payment, along with the computed totals and eligibility. Flex classifies the line items for HSA/FSA eligibility and, when a Letter of Medical Necessity is required, sets up the collection flow. The session's mode determines whether it results in a one-time payment, a subscription, an off-session charge against a saved payment method, or a setup-only flow. When the line items mix eligible and non-eligible products, a split cart is created so each portion can be paid with the appropriate payment method.
post/v1/checkout/sessions
Request body
Example request
{
"checkout_session": {
"allow_promotion_codes": false,
"line_items": [
{}
],
"cancel_url": "https://example.com",
"capture_method": "automatic",
"client_reference_id": "example_value",
"defaults": {},
"mode": "payment",
"metadata": {
"order_id": "8842",
"channel": "shopify"
},
"shipping_options": {},
"shipping_address_collection": false,
"subscription_data": {},
"success_url": "https://example.com",
"tax_rate": {},
"tax_calculation_mode": "exclusive",
"setup_future_use": "on_session",
"payment_method_options": {},
"custom_text": {}
}
}Response
An envelope wrapping a single checkout session object.
Example response
{
"checkout_session": {
"allow_promotion_codes": false,
"amount_total": 2500,
"amount_subtotal": 2500,
"amount_received": 2500,
"amount_refunded": 2500,
"amount_disputed": 2500,
"cancel_url": "https://example.com",
"captures": [],
"disputes": [],
"capture_method": "automatic",
"checkout_session_id": "fcs_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"client_reference_id": "example_value",
"created_at": 2500,
"defaults": {},
"expires_at": 2500,
"invoice": "fin_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"hsa_fsa_eligible": false,
"letter_of_medical_necessity_required": false,
"metadata": {
"order_id": "8842",
"channel": "shopify"
},
"mode": "payment",
"origin": "shopify",
"redirect_url": "https://example.com",
"refunds": [],
"setup_intent": "fseti_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"shipping_options": {},
"shipping_address_collection": false,
"shipping_details": {},
"status": "open",
"success_url": "https://example.com",
"fees": [
{}
],
"custom_text": {},
"subscription_data": {},
"tax_rate": {},
"tax_calculation_mode": "exclusive",
"test_mode": false,
"total_details": {
"amount_discount": 2500,
"amount_tax": 2500,
"amount_shipping": 2500,
"amount_iias": 2500,
"amount_vision": 2500,
"amount_prescription": 2500,
"amount_service": 2500,
"amount_fee": 2500
},
"visit_type": "cbtSleep",
"setup_future_use": "on_session",
"payment_method_options": {},
"platform_fees": {}
}
}