Skip to main content
POST
/
checkouts
/
preview
curl --request POST \
  --url https://api.zenskar.com/checkouts/preview \
  --header 'Content-Type: application/json' \
  --header 'organisation: <api-key>' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "plan_id": "123e4567-e89b-12d3-a456-426614174000",
  "customer_id": "987fcdeb-51a2-43d7-9876-543210fedcba",
  "start_date": "2025-01-01"
}
'
{
  "estimates": {
    "current_invoice": {
      "total": 1000,
      "currency": "USD"
    },
    "next_invoice": {
      "total": 1000,
      "currency": "USD"
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs2.zenskar.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
default:<your-api-key>
required
organisation
string
header
default:<your-organisation-id>
required

Body

application/json

Schema for creating a new checkout session.

Supports two flows based on contract_id presence:

  • New contract: plan_id required, no contract_id
  • Amendment: contract_id present (with product_quantities for quantity updates)
plan_id
string<uuid> | null

ID of the plan. Required for new contracts.

contract_id
string<uuid> | null

Existing contract ID for amendments. When provided, product_overrides are required to specify quantity updates.

start_date
string<date> | null

Start date for the contract. Defaults to current date if not provided.

end_date
string<date> | null

End date for the contract. Optional for evergreen contracts.

customer_id
string<uuid> | null

ID of an existing customer. Required for non-guest checkouts.

business_entity_id
string<uuid> | null

ID of the business entity. Required for guest checkouts.

expires_at
string<date-time> | null

When the checkout session expires. Defaults to system configuration if not provided.

success_url
string<uri> | null

URL to redirect customers after successful checkout completion.

Required string length: 1 - 2083
cancel_url
string<uri> | null

URL to redirect customers if they cancel the checkout.

Required string length: 1 - 2083
product_overrides
ProductOverride · object[] | null

List of product overrides for the checkout. Each entry can specify quantity and/or is_enabled overrides.

Response

Preview estimates generated successfully

Response schema for checkout preview.

Returns billing estimates without creating any database records. This is a lightweight preview of what the billing would look like if the checkout were to be created and confirmed.

estimates
CheckoutEstimatesResponseSchema · object
required

Invoice estimates (current and next invoice only).