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

# Create a checkout session

> The Stripe Checkout shape: name what the buyer chose (and anything you already know about them), then send them to the returned `url`. orriven's hosted page collects the missing details, holds the seat, takes payment and shows the result, then offers the way back to `returnUrl`. A session holds no seat itself and lives 24 hours. An unpublished event answers 412.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/events/{eventId}/checkout-sessions
openapi: 3.1.0
info:
  title: orriven Developer API
  version: '2026-08-22'
  description: >-
    Workspace-scoped access to events, ticket types, registrations (each
    carrying its hosted pass link), redemption codes, add-ons, bundles, orders
    and checkout sessions (the hosted checkout handoff), check-ins and
    exhibitors (read-only). Authenticate every request with `Authorization:
    Bearer <secret>`; the key's business unit is the entire scope, and a
    resource outside it answers 404, never 403.


    **Versioning** — the API uses date versions (this spec documents
    `2026-08-22`, the current one). A key is pinned to the version current at
    its creation and keeps that behaviour forever; send an `orriven-version:
    YYYY-MM-DD` header to serve a single request in another version (unknown
    dates answer 400). Every response echoes the effective version in the
    `orriven-version` response header.
servers:
  - url: https://openapi.orriven.com
    description: Production
  - url: http://localhost:3002
    description: Local development
security:
  - bearerAuth: []
paths:
  /v1/events/{eventId}/checkout-sessions:
    post:
      tags:
        - Orders
      summary: Create a checkout session
      description: >-
        The Stripe Checkout shape: name what the buyer chose (and anything you
        already know about them), then send them to the returned `url`.
        orriven's hosted page collects the missing details, holds the seat,
        takes payment and shows the result, then offers the way back to
        `returnUrl`. A session holds no seat itself and lives 24 hours. An
        unpublished event answers 412.
      parameters:
        - schema:
            type: string
          required: true
          name: eventId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                items:
                  type: array
                  items:
                    type: object
                    properties:
                      itemType:
                        type: string
                        enum:
                          - registration_type
                          - addon
                          - bundle
                      itemId:
                        type: string
                        minLength: 1
                        maxLength: 100
                      quantity:
                        type: integer
                        minimum: 1
                        maximum: 100
                    required:
                      - itemType
                      - itemId
                      - quantity
                  maxItems: 50
                email:
                  type: string
                  maxLength: 320
                  format: email
                name:
                  type: string
                  maxLength: 200
                responses:
                  type: object
                  additionalProperties: {}
                redemptionCode:
                  type: string
                  minLength: 1
                  maxLength: 64
                promotionCode:
                  type: string
                  minLength: 1
                  maxLength: 64
                returnUrl:
                  type: string
                  maxLength: 2000
                locale:
                  type: string
                  enum:
                    - en
                    - zh-CN
              required:
                - items
      responses:
        '201':
          description: The session and its hosted page.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSession'
        '400':
          description: Invalid request body or parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RpcStatus'
        '401':
          description: >-
            Missing, unknown, revoked or expired API key — all indistinguishable
            on purpose.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RpcStatus'
        '404':
          description: >-
            The resource does not exist in this key's business unit. A foreign
            id answers the same way.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RpcStatus'
        '412':
          description: A business rule blocks the change (sold out, currency locked, …).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RpcStatus'
        '429':
          description: Rate limit exceeded for this API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RpcStatus'
components:
  schemas:
    CheckoutSession:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
        expiresAt:
          type: string
      required:
        - id
        - url
        - expiresAt
    RpcStatus:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              example: 404
            status:
              type: string
              example: NOT_FOUND
            message:
              type: string
              example: Event not found.
            details:
              type: array
              items: {}
          required:
            - code
            - status
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        The API key's secret (`osk_…`), shown once when the key is created in
        the console.

````