Skip to main content
PUT
/
checkout
/
{checkout_session_id}
curl --request PUT \
  --url https://api.zenskar.com/checkout/{checkout_session_id} \
  --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-02-01T00:00:00"
  },
  "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",
  "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",
      "customer": {
        "customer_id": "123e4567-e89b-12d3-a456-426614174001",
        "customer_name": "Acme Inc."
      },
      "line_items": [
        {
          "name": "Basic Plan - Monthly Subscription",
          "quantity": 1,
          "unit_price": 29.99,
          "amount": 29.99
        }
      ],
      "subtotal": 29.99,
      "total": 29.99
    },
    "amount_due": 29.99
  },
  "last_activity_at": "2023-01-01T12:34:56",
  "custom_data": {
    "update_history": [
      {
        "timestamp": "2023-01-01T12:34:56",
        "updated_fields": [
          "contract",
          "estimates",
          "currency"
        ],
        "metadata": {
          "reason": "customer_request",
          "note": "Customer requested plan change",
          "timestamp": "2023-01-01T12:34:56"
        }
      }
    ]
  }
}

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

Path Parameters

checkout_session_id
string<uuid>
required

Body

application/json

Schema for updating an existing checkout session

This schema defines the fields that can be updated on an existing checkout session. Only open sessions with no payment activity can be updated.

contract
CheckoutContractSchemaPlanBased · object

Contract data for checkout session. Updating this will recalculate estimates.

Example:
{
"currency": "USD",
"is_plan_based": true,
"plan_id": "123e4567-e89b-12d3-a456-426614174000",
"start_date": "2023-01-01T00:00:00"
}
customer
CreateCustomerRequestSchema · object

Customer snapshot for guest checkout or to override existing customer details. Cannot change customer_id, only customer details.

expires_at
string<date-time> | null

When this checkout session expires. Format: ISO 8601 datetime.

currency
string | null

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

success_url
string<uri> | null

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

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

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

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

URL to redirect customers when payment is pending. Must 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.

update_reason
enum<string> | null

Reason for updating the checkout session. Useful for audit and tracking purposes.

Available options:
customer_request,
admin_correction,
price_update,
contract_update,
error_correction,
other
update_note
string | null

Optional note explaining the reason for the update in more detail.

Maximum string length: 500

Response

Checkout session successfully updated

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