> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ignyt.si/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a cart session token

> Issues a short-lived token that a browser can use for this one cart (lines, address, coupons, quote, submit and purchase status), optionally restricted to one `allowed_origin`. Requires an API key with both `cart:write` and `checkout:write`; a cart session token cannot issue further tokens. The token is shown once and expires after `ttl_seconds` (60–86400).



## OpenAPI

````yaml /api-reference.json post /v1/carts/{cart_id}/session-tokens
openapi: 3.1.0
info:
  description: >-
    Multi-merchant checkout infrastructure (808labs). UAE/AED first on Stripe;
    Saudi/SAR follows separate certification. OpenAPI is canonical; customers
    can integrate without an SDK. Customer dashboard authentication uses
    verified OIDC; workspace access requires an invitation or explicitly enabled
    Sandbox self-registration; machine integrations use scoped API keys. Plans
    and usage are defined in the developer guide. Internal operator and provider
    callback contracts are excluded.
  title: Ignyt Platform API
  version: 0.1.0
servers:
  - url: https://sandbox.ignite-checkout.ai
    description: 'Planned Sandbox host: use assigned deployment URL until activated'
  - url: https://api.ignite-checkout.ai
    description: 'Planned Production host: separate approval and Live credentials required'
security: []
tags:
  - name: Integration
    description: Identity, usage and the public schema for the calling integration.
  - name: Merchants
    description: Discover merchants, manage enrollments and invite stores.
  - name: Catalog
    description: Products, variants, categories and synchronization.
  - name: Carts and checkout
    description: >-
      Build carts, freeze quotes, submit purchases and manage optional Sandbox
      buyer sharing.
  - name: Webhooks and events
    description: Endpoints, deliveries, retries and the event feed.
  - name: Refunds
    description: Request and follow refunds on merchant orders.
  - name: Purchases and orders
    description: Purchases, merchant orders, cancellations and returns.
  - name: Payments and finance
    description: Payment breakdowns, statements and disputes.
  - name: Custom fields
    description: Approved custom field schemas and order extensions.
paths:
  /v1/carts/{cart_id}/session-tokens:
    post:
      tags:
        - Carts and checkout
      summary: Create a cart session token
      description: >-
        Issues a short-lived token that a browser can use for this one cart
        (lines, address, coupons, quote, submit and purchase status), optionally
        restricted to one `allowed_origin`. Requires an API key with both
        `cart:write` and `checkout:write`; a cart session token cannot issue
        further tokens. The token is shown once and expires after `ttl_seconds`
        (60–86400).
      operationId: mint_session_token_v1_carts__cart_id__session_tokens_post
      parameters:
        - in: path
          name: cart_id
          required: true
          schema:
            title: Cart Id
            type: string
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: x-ignite-app-id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Ignite-App-Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionTokenIn'
        required: true
      responses:
        '201':
          content:
            application/json:
              example:
                allowed_origin: https://shop.example.com
                cart_id: crt_01JDX3M8Q4RZ7V2K9T5N6B8C1D
                expires_at: '2026-12-01T11:05:00+00:00'
                note: >-
                  Token shown once. Safe for the browser; it cannot read
                  catalogs, other carts or finance.
                scope: >-
                  this cart only: lines, address, coupons, quote, submit,
                  purchase status + PSP handoff
                token: ign_ct_example_token_shown_once
              schema:
                $ref: '#/components/schemas/CartSessionToken'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: Missing, expired or invalid credentials (`unauthorized`).
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: '`forbidden`: issuer requires both cart:write and checkout:write.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: >-
            The resource does not exist or is not visible to this credential
            (`not_found`).
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: >-
            The request conflicts with the resource's current state, repeats an
            idempotency key with a different body, or is not available here
            (`conflict`, `unsupported_operation` or a more specific code). Read
            the resource again before deciding how to proceed.
        '422':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        type: string
                      details:
                        anyOf:
                          - items:
                              properties:
                                loc:
                                  items:
                                    anyOf:
                                      - type: string
                                      - type: integer
                                  type: array
                                msg:
                                  type: string
                                type:
                                  type: string
                              required:
                                - type
                                - loc
                                - msg
                              type: object
                            type: array
                          - type: object
                      message:
                        type: string
                      request_id:
                        type: string
                    required:
                      - code
                      - message
                      - details
                      - request_id
                    type: object
                required:
                  - error
                type: object
          description: Validation Error
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: >-
            A plan allowance, rate limit or resource limit was reached. For
            `rate_limited` (a per-second ceiling) or the monthly API allowance
            (`plan_quota_exceeded`), wait for the `Retry-After` interval before
            retrying. A specific `*_rate_limited` code, such as
            `invitation_email_rate_limited`, is an hourly limit sent without
            `Retry-After`: retry later with bounded backoff. A resource limit
            described by the operation, such as active merchant requests or
            uploads, does not clear by waiting: complete or withdraw existing
            items first. Monthly allowance and cost limits never block servicing
            of accepted orders; per-second ceilings still apply to servicing
            routes.
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying, sent only when the monthly API
                allowance is exhausted (`plan_quota_exceeded`) or a per-second
                rate limit (`rate_limited`) is reached; specific
                `*_rate_limited` codes omit it.
              schema:
                type: integer
      security:
        - MachineKey: []
        - CustomerOIDC: []
components:
  schemas:
    SessionTokenIn:
      properties:
        allowed_origin:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Browser origin allowed to use the token, for example
            `https://shop.example.com`.
          examples:
            - https://shop.example.com
          title: Allowed Origin
        ttl_seconds:
          default: 3600
          description: Token lifetime in seconds.
          maximum: 86400
          minimum: 60
          title: Ttl Seconds
          type: integer
      title: SessionTokenIn
      type: object
    CartSessionToken:
      description: A browser token for one cart. The token is returned only once.
      properties:
        allowed_origin:
          anyOf:
            - type: string
            - type: 'null'
          description: Browser origin allowed to use the token, if restricted.
          title: Allowed Origin
        cart_id:
          description: The only cart the token can use.
          title: Cart Id
          type: string
        expires_at:
          description: Time the token stops working.
          format: date-time
          title: Expires At
          type: string
        note:
          description: Human-readable guidance.
          title: Note
          type: string
        scope:
          description: Human-readable summary of what the token can do.
          title: Scope
          type: string
        token:
          description: Bearer token for the browser. Store it only for this checkout.
          title: Token
          type: string
      required:
        - cart_id
        - token
        - expires_at
        - allowed_origin
        - scope
        - note
      title: CartSessionToken
      type: object
    IgniteErrorEnvelope:
      description: Document the existing error handler without changing its serialization.
      properties:
        error:
          $ref: '#/components/schemas/IgniteErrorDetail'
      required:
        - error
      title: IgniteErrorEnvelope
      type: object
    IgniteErrorDetail:
      description: Stable error fields; details remain open to each domain's JSON evidence.
      properties:
        code:
          title: Code
          type: string
        details:
          title: Details
        message:
          title: Message
          type: string
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
      required:
        - code
        - message
        - details
        - request_id
      title: IgniteErrorDetail
      type: object
  securitySchemes:
    MachineKey:
      description: Server-side scoped Ignyt API key.
      scheme: bearer
      type: http
    CustomerOIDC:
      bearerFormat: JWT
      description: >-
        Customer access token; current membership, role and app selection are
        enforced. Protected actions use recent email-code verification in the
        configured Sandbox or recent authenticator verification in legacy
        password mode. Available when customer authentication is enabled.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.