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

# Create a studio-scoped guest checkout link

> Requires checkout_links:write and print_orders:write plus access to the explicit studio. Anonymous sessions cannot use this management lane. The credential persists the sandbox or production checkout lane: a br_test_ key creates an explicitly sandboxed, non-payable link with preview_status=non_payable and no URL; an explicitly production link is payable, subject to normal guest-checkout policy and payment readiness. A historical missing-lane staff or guardian link remains compatibility-payable only when it has no machine API-key provenance. A missing-lane machine link fails closed. Live creation returns share_url only for the first successful create response. Reusing an idempotency key with a different request fingerprint returns checkout_link_conflict.



## OpenAPI

````yaml https://api.batchrelay.com/openapi.json post /v1/studios/{studio_id}/checkout-links
openapi: 3.1.0
info:
  description: >-
    Provider-neutral print catalog and prepared-media validation. This document
    covers only routes owned by the Go service; it deliberately excludes
    migration-proxied order lifecycle routes and all provider payloads.
  license:
    name: Proprietary
    url: https://github.com/SENTINELITE/Batch-Relay-Go/blob/main/README.md
  title: Batch Relay API
  version: 1.0.1
servers:
  - url: https://api.batchrelay.com
security: []
tags:
  - description: Service health and the public API description.
    name: System
  - description: Test Mode session creation and API credential entry points.
    name: Authentication
  - description: >-
      Provider-neutral canonical catalog resources and platform-owned semantic
      definitions.
    name: Catalog
  - description: Studio-scoped guest checkout-link management.
    name: Checkout links
  - description: >-
      One-way operational event messages. Alert emails contain no message body
      and recipients read messages after Batch Relay authentication.
    name: Studio messages
  - description: >-
      Explicit, reviewable sandbox-to-Live promotion plans for forms, catalog,
      and storefront configuration.
    name: Sandbox promotions
  - description: Provider-neutral validation, quoting, and order lifecycle operations.
    name: Print orders
  - description: Managed fulfillment asset ingestion and metadata.
    name: Managed assets
  - description: Studio-scoped original asset upload sessions and objects.
    name: Studio assets
  - description: Prepared and confirmed event roster team changes.
    name: Event team changes
  - description: Authenticated studio, event, and form-management operations.
    name: Studio management
  - description: >-
      Authenticated studio retail catalog management. Draft and publication
      lifecycles are explicit per product or package.
    name: Studio catalog
  - description: >-
      Authenticated singular storefront assortment management. PATCH atomically
      publishes a new immutable assortment revision; no storefront draft
      lifecycle exists yet.
    name: Storefront
  - description: Managed media used by the studio retail catalog.
    name: Studio catalog assets
  - description: Template rendering job creation and retrieval.
    name: Template renders
  - description: >-
      Published browser-side template packages and short-lived server proof
      renders. Preview artifacts are never fulfillment artwork.
    name: Browser previews
  - description: API account and credential administration.
    name: API accounts
paths:
  /v1/studios/{studio_id}/checkout-links:
    parameters:
      - $ref: '#/components/parameters/ClientSurface'
      - $ref: '#/components/parameters/ClientVersion'
      - $ref: '#/components/parameters/InvocationMode'
    post:
      tags:
        - Checkout links
      summary: Create a studio-scoped guest checkout link
      description: >-
        Requires checkout_links:write and print_orders:write plus access to the
        explicit studio. Anonymous sessions cannot use this management lane. The
        credential persists the sandbox or production checkout lane: a br_test_
        key creates an explicitly sandboxed, non-payable link with
        preview_status=non_payable and no URL; an explicitly production link is
        payable, subject to normal guest-checkout policy and payment readiness.
        A historical missing-lane staff or guardian link remains
        compatibility-payable only when it has no machine API-key provenance. A
        missing-lane machine link fails closed. Live creation returns share_url
        only for the first successful create response. Reusing an idempotency
        key with a different request fingerprint returns checkout_link_conflict.
      operationId: createStudioCheckoutLink
      parameters:
        - $ref: '#/components/parameters/StudioID'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutLinkCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutLink'
          description: >-
            Created or idempotently replayed checkout link. An explicitly
            sandboxed creation includes preview_status=non_payable and no URL;
            an explicitly production creation is payable and returns share_url
            only once for a new Live Mode link.
        '400':
          $ref: '#/components/responses/IdempotencyKeyRequired'
        '401':
          $ref: '#/components/responses/APIKeyAuthenticationRequired'
        '403':
          $ref: '#/components/responses/CheckoutLinkForbidden'
        '409':
          $ref: '#/components/responses/CheckoutLinkConflict'
        '422':
          $ref: '#/components/responses/InvalidCheckoutLink'
        '503':
          $ref: '#/components/responses/CheckoutLinkUnavailable'
      security:
        - bearerAuth: []
components:
  parameters:
    ClientSurface:
      description: >-
        Untrusted optional analytics hint naming the calling client surface. It
        never affects authorization, routing, pricing, or behavior.
      in: header
      name: X-BatchRelay-Client-Surface
      required: false
      schema:
        maxLength: 100
        minLength: 1
        type: string
    ClientVersion:
      description: >-
        Untrusted optional analytics hint naming the calling client version. It
        never affects authorization, routing, pricing, or behavior.
      in: header
      name: X-BatchRelay-Client-Version
      required: false
      schema:
        maxLength: 100
        minLength: 1
        type: string
    InvocationMode:
      description: >-
        Untrusted optional analytics hint naming the invocation mode. It never
        affects authorization, routing, pricing, or behavior.
      in: header
      name: X-BatchRelay-Invocation-Mode
      required: false
      schema:
        maxLength: 100
        minLength: 1
        type: string
    StudioID:
      description: >-
        Stable public studio ID beginning with stu_. The API never selects a
        studio implicitly; a local CLI profile name is not a studio ID.
      in: path
      name: studio_id
      required: true
      schema:
        maxLength: 256
        minLength: 5
        pattern: ^stu_[A-Za-z0-9_-]+$
        type: string
    IdempotencyKey:
      in: header
      name: Idempotency-Key
      required: true
      schema:
        maxLength: 200
        minLength: 1
        type: string
  schemas:
    CheckoutLinkCreateRequest:
      additionalProperties: false
      description: >-
        The server resolves current published retail pricing and freezes the
        non-customizable quote. Client price, tax, payment, provider,
        recipient-contact, and token fields are not accepted.
      properties:
        customizable:
          default: false
          type: boolean
        event_id:
          maxLength: 240
          minLength: 1
          type: string
        expires_at:
          description: Must be in the future and no later than seven days after creation.
          format: date-time
          type: string
        recipient:
          $ref: '#/components/schemas/CheckoutLinkRecipient'
        sellable:
          $ref: '#/components/schemas/CheckoutLinkSellable'
      required:
        - event_id
        - recipient
        - sellable
      type: object
    CheckoutLink:
      additionalProperties: false
      description: >-
        Safe lifecycle projection. It deliberately excludes the token, recipient
        context, retail-line details, Stripe identifiers, and provider data.
      properties:
        expires_at:
          format: date-time
          type: string
        id:
          type: string
        preview_status:
          const: non_payable
          description: >-
            Present only in a Test Mode creation response. It is an explicit
            non-payable result, not a browser URL or checkout capability.
          type: string
        revocable:
          type: boolean
        share_url:
          description: >-
            Live Mode bearer URL, returned only once in the first successful
            creation response. Treat as a secret.
          format: uri
          readOnly: true
          type: string
        status:
          enum:
            - active
            - checkout_created
            - fulfilled
            - revoked
            - expired
          type: string
        subtotal_cents:
          minimum: 0
          type: integer
      required:
        - id
        - expires_at
        - status
        - revocable
      type: object
    CheckoutLinkRecipient:
      additionalProperties: false
      properties:
        athlete_event_entry_id:
          maxLength: 240
          minLength: 1
          type: string
        guardian_id:
          maxLength: 240
          minLength: 1
          type: string
      required:
        - athlete_event_entry_id
        - guardian_id
      type: object
    CheckoutLinkSellable:
      additionalProperties: false
      properties:
        digital_configuration_id:
          maxLength: 240
          minLength: 1
          type: string
        id:
          maxLength: 240
          minLength: 1
          type: string
        prepared_asset_assignment_ids:
          items:
            maxLength: 240
            minLength: 1
            type: string
          maxItems: 32
          type: array
        quantity:
          maximum: 100
          minimum: 1
          type: integer
        type:
          enum:
            - item
            - package
          type: string
        variant_id:
          description: Allowed only for an item.
          maxLength: 240
          minLength: 1
          type: string
      required:
        - type
        - id
        - quantity
      type: object
    Error:
      additionalProperties: false
      properties:
        code:
          description: Stable machine-readable error code.
          type: string
        docs_url:
          format: uri
          type: string
        error:
          description: Backward-compatible human-readable error.
          type: string
        message:
          type: string
        request_id:
          type: string
      required:
        - error
        - code
        - message
        - docs_url
        - request_id
      type: object
  responses:
    IdempotencyKeyRequired:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Idempotency-Key is required for this operation.
    APIKeyAuthenticationRequired:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: A valid Batch Relay API key or anonymous Test Mode session is required.
    CheckoutLinkForbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: >-
        The credential is anonymous, lacks checkout-link and print-order scope,
        or is not authorized for the named studio.
    CheckoutLinkConflict:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: >-
        The checkout link cannot make the requested lifecycle transition, or the
        idempotency key was already used with a different request fingerprint.
    InvalidCheckoutLink:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: >-
        The checkout-link context, request body, or requested expiration is
        invalid.
    CheckoutLinkUnavailable:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: >-
        The checkout-link service is not configured or is temporarily
        unavailable.
  securitySchemes:
    bearerAuth:
      bearerFormat: Batch Relay API key or anonymous session
      description: >-
        Batch Relay scoped API key or an anonymous Test Mode session. Scope
        names document required capabilities. Anonymous sessions are
        sandbox-only and do not authorize studio, event, billing, or Live Mode
        operations.
      scheme: bearer
      type: http

````