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

# Step 5: Book with Ancillaries

> Create a booking and atomically debit the agent wallet.

In the booking payload, add an array for `ancillary_tokens` containing the tokens from Steps 3 and 4. The wallet will be atomically debited for both the flight and the extras.

### Request Setup

<ParamField header="Idempotency-Key" type="string" required>Generate a random string (e.g. `idem-123`).</ParamField>
<ParamField body="fare_token" type="string" required>Paste the token from Step 2.</ParamField>
<ParamField body="agent_id" type="string" default="YOUR_AGENT_ID" required>Your specific UAT Agent ID.</ParamField>

<ParamField body="idempotency_key" type="string" default="idem-123" />

<ParamField body="passengers" type="array" required>
  <Expandable>
    <ParamField body="id" type="string" default="ADT1" />

    <ParamField body="type" type="string" default="ADT" />

    <ParamField body="first_name" type="string" default="JOHN" />

    <ParamField body="last_name" type="string" default="DOE" />
  </Expandable>
</ParamField>

<ParamField body="contact_info" type="object" required>
  <Expandable>
    <ParamField body="email" type="string" default="john.doe@example.com" />

    <ParamField body="phone" type="string" default="+919876543210" />
  </Expandable>
</ParamField>

### Instructions

1. Review the requirements and set up the request payload.
2. Hit the **Send** button.

<Warning>
  **Requirement:** Copy the `booking_id`. The booking must show a `BOOKED` status.
</Warning>


## OpenAPI

````yaml POST /flight/booking/create
openapi: 3.0.3
info:
  title: Travomatrix B2B Travel API
  version: 1.0.0
  description: >
    Travomatrix is a high-performance multi-vertical travel booking engine
    designed for B2B enterprises.


    ### Verticals Supported

    - **Flights**: Unified interface for global GDS and NDC providers.

    - **Hotels**: Coming Soon.

    - **Rail**: Coming Soon.

    - **Cabs**: Coming Soon.


    ### Key Security & Reliability Headers

    - **X-API-Key**: Your primary server-to-server API key.

    - **Idempotency-Key**: Required for financial operations. Prevents duplicate
    actions on retries.

    - **X-Request-ID**: Optional but recommended. Used for tracing requests
    through the Travomatrix infrastructure.
servers:
  - url: https://api.travomatrix.com/api/v1
    description: Production Environment
  - url: http://uat.travomatrix.com/api/v1
    description: UAT Environment
  - url: http://localhost:80/api/v1
    description: Localhost (Port 80)
  - url: http://localhost:8080/api/v1
    description: Localhost (Port 8080)
security: []
paths:
  /flight/booking/create:
    post:
      tags:
        - Flights - Booking
      summary: Create PNR
      description: Create a booking and atomically debit the agent wallet.
      parameters:
        - $ref: '#/components/parameters/IdempotencyHeader'
        - $ref: '#/components/parameters/RequestIDHeader'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBookingRequest'
            example:
              fare_token: VALID_TOKEN_123
              agent_id: AGENT_456
              idempotency_key: IDEM_REQ_001
              passengers:
                - id: ADT1
                  type: ADT
                  title: MR
                  first_name: JOHN
                  last_name: DOE
                  gender: M
                  dob: '1990-05-15'
                  nationality: IN
              contact_info:
                email: john.doe@example.com
                phone: '+919876543210'
      responses:
        '201':
          description: Booking created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Insufficient Funds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Idempotency Conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    IdempotencyHeader:
      name: Idempotency-Key
      in: header
      description: >-
        A unique string to identify this request. Retrying a request with the
        same key will return the cached response.
      required: false
      schema:
        type: string
    RequestIDHeader:
      name: X-Request-ID
      in: header
      description: Unique correlation ID for tracing.
      required: false
      schema:
        type: string
  schemas:
    CreateBookingRequest:
      type: object
      required:
        - fare_token
        - passengers
        - contact_info
      example:
        fare_token: VALID_TOKEN_123
        agent_id: AGENT_456
        idempotency_key: IDEM_REQ_001
        passengers:
          - id: ADT1
            type: ADT
            title: MR
            first_name: JOHN
            last_name: DOE
            gender: M
            dob: '1990-05-15'
            nationality: IN
        contact_info:
          email: john.doe@example.com
          phone: '+919876543210'
      properties:
        fare_token:
          type: string
          description: Token obtained from Fare Validation.
        agent_id:
          type: string
        idempotency_key:
          type: string
        passengers:
          type: array
          items:
            $ref: '#/components/schemas/PassengerInfo'
        contact_info:
          type: object
          properties:
            email:
              type: string
              format: email
            phone:
              type: string
    BookingResponse:
      type: object
      properties:
        booking_id:
          type: string
        pnr:
          type: string
        status:
          type: string
          enum:
            - PENDING
            - BOOKED
            - TICKETED
            - FAILED
        total_price_paise:
          type: integer
        currency:
          type: string
    ErrorResponse:
      type: object
      properties:
        trace_id:
          type: string
          example: req_abc123
        error:
          $ref: '#/components/schemas/AppError'
    PassengerInfo:
      type: object
      required:
        - first_name
        - last_name
        - gender
        - dob
      properties:
        id:
          type: string
          example: ADT1
        type:
          type: string
          enum:
            - ADT
            - CHD
            - INF
        title:
          type: string
          enum:
            - MR
            - MRS
            - MS
            - MSTR
            - MISS
        first_name:
          type: string
        last_name:
          type: string
        gender:
          type: string
          enum:
            - M
            - F
        dob:
          type: string
          format: date
          description: YYYY-MM-DD
        nationality:
          type: string
          pattern: ^[A-Z]{2}$
        passport_number:
          type: string
        passport_expiry:
          type: string
          format: date
    AppError:
      type: object
      required:
        - category
        - code
        - message
      properties:
        category:
          type: string
          enum:
            - AUTH
            - SEARCH
            - BOOKING
            - WALLET
            - PROVIDER
            - SYSTEM
            - VALIDATION
        code:
          type: string
          example: BOOKING_FARE_EXPIRED
        message:
          type: string
          example: The selected fare has expired.
        retryable:
          type: boolean
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
        provider:
          $ref: '#/components/schemas/ProviderError'
    ValidationError:
      type: object
      properties:
        field:
          type: string
          example: passengers[0].first_name
        code:
          type: string
          example: REQUIRED
        message:
          type: string
          example: First name is required.
    ProviderError:
      type: object
      properties:
        name:
          type: string
          example: AMADEUS
        code:
          type: string
          example: '32171'
        message:
          type: string
          example: Price has changed
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````