post
https://api.zenskar.com/customer_portal/checkouts
Create a new checkout session to initiate a billing flow.
Checkout sessions are temporary objects that allow customers to subscribe to plans, change plans, or update quantities. They generate a preview of the contract and pricing that will be applied when the checkout is confirmed.
Checkout Type Detection: The checkout type is automatically determined based on the provided fields:
- New Subscription (
plan_based): Provideplan_idwithoutcontract_id - Plan Change (coming soon): Provide both
contract_idandplan_id - Quantity Update (coming soon): Provide
contract_idwithproduct_quantitiesbut noplan_id
Authentication:
- Authenticated customers: Checkout is created for the authenticated customer
- Guest checkout: Provide
guest_checkout: trueandcustomer_data
Billing Estimates: The response includes simplified billing estimates with:
current_invoice: Charges for the current billing periodnext_invoice: Upcoming charges for the next period (null if none) Estimates are generated as a preview and do not create actual invoices.
The checkout session expires after 24 hours if not completed.
