> ## 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/storefront-openapi.json post /v1/events/{publicId}/checkout-sessions
openapi: 3.1.0
info:
  title: orriven Storefront API
  version: '2026-08-22'
  description: >-
    The catalog and checkout for your own event frontend — no backend of yours
    required. Authenticate every request with `Authorization: Bearer <opk_…>` (a
    publishable key, safe in browser code; it fronts one business unit's
    published events). Create a checkout session with the buyer's selection and
    send them to its `url` — orriven's hosted page collects what is missing,
    takes payment and shows the result, then returns them to your `returnUrl`.
    The catalog never exposes counts, drafts or hidden ticket types; anything
    outside the business unit answers 404.


    **Versioning** — date versions, the developer API's exact model: the key
    pins the version current at its creation, `orriven-version: YYYY-MM-DD`
    overrides per request, and every response echoes the effective version.
servers:
  - url: https://openapi.orriven.com/storefront
    description: Production
  - url: http://localhost:3002/storefront
    description: Local development
security:
  - publishableKey: []
paths:
  /v1/events/{publicId}/checkout-sessions:
    post:
      tags:
        - Checkout
      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: publicId
          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:
    publishableKey:
      type: http
      scheme: bearer
      description: >-
        The publishable key (`opk_…`) — safe to embed in your frontend. Created
        per business unit in the console, with the origins allowed to use it
        from a browser.

````