Skip to main content
POST
/
checkout
curl --request POST \
  --url https://api.zenskar.com/checkout \
  --header 'Content-Type: application/json' \
  --header 'organisation: <api-key>' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "contract": {
    "is_plan_based": true,
    "plan_id": "123e4567-e89b-12d3-a456-426614174000",
    "currency": "USD",
    "start_date": "2023-01-01T00:00:00"
  },
  "customer_id": "123e4567-e89b-12d3-a456-426614174001",
  "success_url": "https://example.com/success",
  "cancel_url": "https://example.com/cancel"
}
'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "checkout_session_status": "open",
  "payment_status": "not_started",
  "guest_checkout": false,
  "customer_id": "123e4567-e89b-12d3-a456-426614174001",
  "contract": {
    "currency": "USD",
    "is_plan_based": true,
    "plan_id": "123e4567-e89b-12d3-a456-426614174000",
    "start_date": "2023-01-01T00:00:00"
  },
  "estimates": {
    "estimation_id": "123e4567-e89b-12d3-a456-426614179999",
    "current_invoice": {
      "id": "123e4567-e89b-12d3-a456-426614179998",
      "invoice_number": "EST-0001",
      "status": "estimated",
      "line_items": [],
      "features": [],
      "subtotal": 0,
      "total": 0
    },
    "future_invoices": [],
    "amount_due": 0,
    "credit_notes": []
  }
}

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

This schema defines all the information needed to create a new checkout session, including contract details, customer information, session configuration, and experience options.

contract
CheckoutContractSchemaPlanBased · object
required

Contract data for checkout session. Can be either plan-based or product-based. Required field.

Example:
{
"currency": "USD",
"is_plan_based": true,
"plan_id": "123e4567-e89b-12d3-a456-426614174000",
"start_date": "2023-01-01T00:00:00"
}
customer_id
string<uuid> | null

ID of an existing customer. Required for non-guest checkout flows. Must be a valid UUID of an existing customer.

guest_checkout
boolean

Flag indicating if this is a guest checkout flow. When true, customer_id is not required, but customer data and business_entity_id must be provided.

customer
CreateCustomerRequestSchema · object

Customer data for guest checkout or to override existing customer details. Required when guest_checkout is true.

business_entity_id
string<uuid> | null

ID of the business entity. Required when guest_checkout is true. Must be a valid UUID of an existing business entity.

expires_at
string<date-time> | null

Timestamp when this checkout session expires. If not provided, system defaults will apply. Format: ISO 8601 datetime.

idempotency_key
string | null

Unique key for idempotent requests. Allows safe retries of checkout session creation without creating duplicates.

correlation_id
string | null

ID for cross-service request tracing. Useful for debugging and tracking request flows across services.

currency
string | null

Display currency for the checkout session. Must be a valid ISO 4217 currency code (e.g., 'USD', 'EUR'). If provided, must match the contract currency.

success_url
string<uri> | null

URL to redirect customers after successful checkout. Should be a valid, fully-qualified URL.

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

URL to redirect customers after cancellation. Should be a valid, fully-qualified URL.

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

URL to redirect customers when payment is pending. Should be a valid, fully-qualified URL.

Required string length: 1 - 2083
attribution
AttributionSchema · object

UTM and attribution data for marketing tracking. Helps track the source of the checkout session.

custom_data
Custom Data · object

Arbitrary key-value storage for additional data. Can be used to store metadata or integration-specific information.

Response

Successfully created checkout session

Schema for checkout session response

This schema defines the response format for checkout session operations, including all session details, status information, and associated data.

id
string<uuid>
required

Unique identifier for the checkout session

checkout_session_status
enum<string>
required

Current status of the checkout session (open, processing, completed, closed, cancelled)

Available options:
open,
processing,
completed,
closed,
cancelled
payment_status
enum<string>
required

Current status of the payment (not_started, pending, paid, failed, no_payment_required)

Available options:
not_started,
pending,
paid,
failed,
no_payment_required
contract
Contract · object
required

Contract data associated with this checkout session

guest_checkout
boolean
required

Indicates if this was a guest checkout flow

contract_id
string<uuid> | null

ID of the associated contract, if one has been created

execution_id
string<uuid> | null

ID of the execution process for this checkout session

confirmed_at
string<date-time> | null

Timestamp when the checkout session was confirmed

paid_at
string<date-time> | null

Timestamp when the payment was received

payment_intent_id
string | null

External payment intent ID from the payment provider

estimates
EstimationResponseSchema · object

Calculated price estimates for the contract as EstimationResponseSchema (estimation_id, current_invoice, future_invoices, amount_due, credit_notes)

customer_id
string<uuid> | null

ID of the customer associated with this checkout session

business_entity_id
string<uuid> | null

ID of the business entity associated with this checkout session

customer
Customer · object

Customer data snapshot at the time of checkout

expires_at
string<date-time> | null

Timestamp when this checkout session expires

last_activity_at
string<date-time> | null

Timestamp of the last activity on this checkout session

completed_at
string<date-time> | null

Timestamp when the checkout session was completed

idempotency_key
string | null

Idempotency key used when creating this checkout session

correlation_id
string | null

Correlation ID for cross-service tracking

currency
string | null

Display currency for the checkout session

success_url
string | null

URL to redirect customers after successful checkout

cancel_url
string | null

URL to redirect customers after cancellation

pending_url
string | null

URL to redirect customers when payment is pending

attribution
Attribution · object

UTM and attribution data for marketing tracking

custom_data
Custom Data · object

Arbitrary key-value storage for additional data