> ## 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.

# Mint redemption codes

> A code grants *access* to its ticket type, never a place — capacity and sale windows still apply. A custom `code` colliding with an existing one answers 409.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/events/{eventId}/redemption-codes
openapi: 3.1.0
info:
  title: Orriven Developer API
  version: '2026-08-22'
  description: >-
    Workspace-scoped access to events, ticket types, registrations, redemption
    codes, add-ons, bundles, orders (read-only) and check-ins. 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}/redemption-codes:
    post:
      tags:
        - Redemption codes
      summary: Mint redemption codes
      description: >-
        A code grants *access* to its ticket type, never a place — capacity and
        sale windows still apply. A custom `code` colliding with an existing one
        answers 409.
      parameters:
        - schema:
            type: string
          required: true
          name: eventId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                registrationTypeId:
                  type: string
                  minLength: 1
                  maxLength: 100
                count:
                  type: integer
                  minimum: 1
                  maximum: 500
                code:
                  type: string
                  pattern: ^[A-Za-z0-9-]{4,32}$
                label:
                  type:
                    - string
                    - 'null'
                  maxLength: 200
                maxUses:
                  type:
                    - integer
                    - 'null'
                  minimum: 1
                  maximum: 1000000
                expiresAt:
                  type:
                    - string
                    - 'null'
                  format: date-time
              required:
                - registrationTypeId
      responses:
        '201':
          description: The minted codes.
          content:
            application/json:
              schema:
                type: object
                properties:
                  redemptionCodes:
                    type: array
                    items:
                      $ref: '#/components/schemas/RedemptionCode'
                required:
                  - redemptionCodes
        '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'
        '409':
          description: The request conflicts with existing state.
          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:
    RedemptionCode:
      type: object
      properties:
        id:
          type: string
        eventId:
          type: string
        registrationTypeId:
          type: string
        code:
          type: string
        label:
          type:
            - string
            - 'null'
        maxUses:
          type:
            - integer
            - 'null'
        uses:
          type: integer
        status:
          type: string
          enum:
            - active
            - disabled
        expiresAt:
          type:
            - string
            - 'null'
        createdAt:
          type: string
      required:
        - id
        - eventId
        - registrationTypeId
        - code
        - label
        - maxUses
        - uses
        - status
        - expiresAt
        - createdAt
    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.

````