Skip to main content
POST
/
checkouts
curl --request POST \ --url https://api.zenskar.com/checkouts \ --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-01T00:00:00Z", "end_date": "2025-12-31T23:59:59Z", "success_url": "https://example.com/success", "cancel_url": "https://example.com/cancel" } '
{ "id": "abc12345-e89b-12d3-a456-426614174000", "checkout_status": "open", "plan_id": "123e4567-e89b-12d3-a456-426614174000", "customer_id": "987fcdeb-51a2-43d7-9876-543210fedcba", "start_date": "2025-01-01T00:00:00Z", "end_date": "2025-12-31T23:59:59Z", "expires_at": "2025-01-02T10:30:00Z", "contract": { "name": "Enterprise Plan", "phases": [] }, "created_at": "2025-01-01T10:30:00Z", "updated_at": "2025-01-01T10:30:00Z" }

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

Checkout session created successfully

Response schema for checkout session.

Does not include the full contract data.

id
string<uuid>
required

Unique checkout session ID.

organisation_id
string<uuid>
required

Organization ID.

checkout_status
string
required

Current status of the checkout session.

plan_id
string<uuid> | null

ID of the plan being purchased.

contract_id
string<uuid> | null

Contract ID. For amendments/plan switches: set at creation. For new contracts: set after confirmation.

start_date
string<date> | null

Contract start date.

end_date
string<date> | null

Contract end date.

customer_id
string<uuid> | null

ID of the customer (for non-guest checkouts).

business_entity_id
string<uuid> | null

ID of the business entity.

guest_checkout
boolean
default:false

Whether this is a guest checkout.

customer_data
Customer Data · object

Customer data for guest checkouts.

estimates
CheckoutEstimatesResponseSchema · object

Invoice estimates (current and next invoice only).

expires_at
string<date-time> | null

When the checkout session expires.

success_url
string | null

URL to redirect after successful checkout.

cancel_url
string | null

URL to redirect if checkout is cancelled.

product_overrides
ProductOverrideResponseSchema · object[] | null

Product overrides (quantity and/or is_enabled).

created_at
string<date-time> | null

When the checkout was created.

updated_at
string<date-time> | null

When the checkout was last updated.