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

# Send To Transit

> Dispatch a STAGED booking to transit — STAGED → RUNNING.

Saga pattern:
  1. Commit RUNNING to DB.
  2. Notify commercial-service (with exponential-backoff retry on transient errors).
  3. If notification still fails after all retries → compensate by reverting
     RUNNING → STAGED so the operator can retry without data corruption.



## OpenAPI

````yaml /openapi/inventory.yaml post /api/v1/bookings/{order_id}/send-to-transit
openapi: 3.1.0
info:
  title: Cape Digi - Inventory Service
  description: >-
    Ad inventory catalog, rate cards, booking orders, campaign tracking, ad
    asset management, and commercial transmission scheduling.
  version: 1.0.0
servers:
  - url: https://api.capedigital.co.ke/inventory
    description: Production
  - url: http://localhost:8000
    description: Local
security: []
paths:
  /api/v1/bookings/{order_id}/send-to-transit:
    post:
      tags:
        - Bookings
      summary: Send To Transit
      description: |-
        Dispatch a STAGED booking to transit — STAGED → RUNNING.

        Saga pattern:
          1. Commit RUNNING to DB.
          2. Notify commercial-service (with exponential-backoff retry on transient errors).
          3. If notification still fails after all retries → compensate by reverting
             RUNNING → STAGED so the operator can retry without data corruption.
      operationId: send_to_transit_api_v1_bookings__order_id__send_to_transit_post
      parameters:
        - name: order_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Order Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendToTransitBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    SendToTransitBody:
      properties:
        start_date:
          type: string
          format: date
          title: Start Date
        end_date:
          type: string
          format: date
          title: End Date
      type: object
      required:
        - start_date
        - end_date
      title: SendToTransitBody
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````