---
title: "Book a flight"
url: "https://kiwi.arashsheyda.me/apis/flight-api-1/versions/aee2ad99-0bb8-44ab-b301-bc1bc967464e/paths/bookings/post"
---

> Full API specification: https://kiwi.arashsheyda.me/apis/flight-api-1/versions/aee2ad99-0bb8-44ab-b301-bc1bc967464e.md

# Book a flight

`POST` `/bookings`

Create a booking for a flight.

## Request body (required)

Content types: `application/json`

## Responses

- `201` - Booking confirmed

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Flight API
  version: 1.0.1
servers:
  - url: https://api.example.com/v1
paths:
  /bookings:
    post:
      summary: Book a flight
      description: Create a booking for a flight.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BookingRequest"
      responses:
        "201":
          description: Booking confirmed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BookingResponse"
components:
  schemas:
    BookingRequest:
      type: object
      properties:
        flightId:
          type: string
        passenger:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
    BookingResponse:
      type: object
      properties:
        bookingId:
          type: string
        flight:
          $ref: "#/components/schemas/Flight"
        passenger:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
        status:
          type: string
          enum:
            - confirmed
            - pending
            - canceled
    Flight:
      type: object
      properties:
        id:
          type: string
        airline:
          type: string
        flight_number:
          type: string
        origin:
          type: string
        destination:
          type: string
        departure_time:
          type: string
          format: date-time
        arrival_time:
          type: string
          format: date-time
        price:
          type: number
          format: float
```
