Skip to main content
POST
Create a checkout session

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
customer_id
string<CustomerId or customer alias>
required

Customer ID or alias

plan_version_id
string<MeteroidId>
required
Example:

"plv_7n42DGM5Tflk9n8mt7Fhc7"

add_ons
object[] | null
auto_advance_invoices
boolean | null

If false, invoices will stay in Draft until manually reviewed and finalized. Default is true.

billing_day_anchor
integer<int32> | null
billing_start_date
string<date> | null
cancel_url
string | null

Absolute http(s) URL offered to the customer to leave the checkout without paying.

charge_automatically
boolean | null

Automatically try to charge the customer's configured payment method on finalize. Default is true.

components
object | null
coupon_code
string | null

Code of the coupon to apply, used only when coupon_ids is empty. It names the coupon with exactly that code, else the only live coupon equal to it ignoring the case of ASCII letters. An unknown or ambiguous code is refused with 400. If the code no longer names a usable coupon when the customer pays, the payment is refused and nothing is charged.

coupon_ids
string<MeteroidId>[]
end_date
string<date> | null
expires_in_hours
integer<int32> | null

Session expiry time in hours. Default is 1 hour for self-serve checkout.

Required range: x >= 0
invoice_memo
string | null
invoice_threshold
string<decimal> | null
metadata
any
net_terms
integer<int32> | null
payment_methods_config
object

Payment methods configuration. If not specified, inherits from the invoicing entity.

purchase_order
string | null
success_url
string | null

Absolute http(s) URL the customer is sent to after a successful checkout. checkout_session_id is appended as a query parameter. Without it the customer stays on the hosted confirmation page.

trial_duration_days
integer<int32> | null

Response

Checkout session created

session
object
required