{
  "openapi": "3.1.0",
  "info": {
    "title": "NX Jets Partner API",
    "version": "1.0.0",
    "description": "Add private jet search to your own site: airports, price estimates per aircraft category, flight requests to NX Jets brokers, and open empty legs."
  },
  "servers": [
    {
      "url": "https://api.nx-jets.com/v1"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "operationId": "checkKey",
        "summary": "Check a key",
        "description": "Returns the partner a key belongs to and its mode. Call it once to verify a key before going live.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "partner": "Example Travel Ltd",
                  "mode": "test",
                  "rateLimit": {
                    "limit": 600,
                    "windowSeconds": 600
                  }
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`service_unavailable`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/categories": {
      "get": {
        "operationId": "listCategories",
        "summary": "List aircraft categories",
        "description": "The nine aircraft categories used by estimates and empty legs. Use `key` to match a category across calls.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "categories": [
                    {
                      "key": "turboprop",
                      "label": "Turboprop",
                      "examples": "Pilatus PC-12 · King Air 350",
                      "seats": 8,
                      "rangeNm": 1800
                    },
                    {
                      "key": "very-light",
                      "label": "Very Light",
                      "examples": "Citation Mustang · Citation M2 · Phenom 100",
                      "seats": 5,
                      "rangeNm": 1150
                    },
                    {
                      "key": "light",
                      "label": "Light",
                      "examples": "Citation CJ2 · CJ3 · CJ4 · Hawker 400",
                      "seats": 7,
                      "rangeNm": 1600
                    },
                    {
                      "key": "super-light",
                      "label": "Super Light",
                      "examples": "Phenom 300 · Pilatus PC-24 · Citation XLS+",
                      "seats": 8,
                      "rangeNm": 2000
                    },
                    {
                      "key": "midsize",
                      "label": "Midsize",
                      "examples": "Hawker 800 · Hawker 900 · Learjet 75",
                      "seats": 9,
                      "rangeNm": 2040
                    },
                    {
                      "key": "super-midsize",
                      "label": "Super Midsize",
                      "examples": "Challenger 350 · Praetor 600",
                      "seats": 10,
                      "rangeNm": 3200
                    },
                    {
                      "key": "heavy",
                      "label": "Heavy",
                      "examples": "Falcon 900LX · Gulfstream G450",
                      "seats": 14,
                      "rangeNm": 4000
                    },
                    {
                      "key": "ultra-long",
                      "label": "Ultra Long Range",
                      "examples": "Gulfstream G650 · G700 · Global 7500",
                      "seats": 16,
                      "rangeNm": 7000
                    },
                    {
                      "key": "vip-airliner",
                      "label": "VIP Airliner",
                      "examples": "ERJ 145 VIP · Lineage 1000 · BBJ",
                      "seats": 30,
                      "rangeNm": 6000
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`service_unavailable`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/airports": {
      "get": {
        "operationId": "searchAirports",
        "summary": "Search airports",
        "description": "Business aviation airports and cities matching a search string. The search tolerates typos and understands city names in the four supported languages.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "City, airport name, ICAO or IATA code, up to 64 characters. Several words narrow the search: `Paris Le Bourget`, `New York Teterboro`, `Nice airport`. Empty: suggested airports and popular cities."
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`en`, `fr`, `es` or `de`, in lower case."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "airports": [
                    {
                      "icao": "LFPB",
                      "iata": "LBG",
                      "name": "Paris-Le Bourget International Airport",
                      "city": "Paris",
                      "country": "France",
                      "lat": 48.9623,
                      "lon": 2.4365
                    }
                  ],
                  "cities": [
                    {
                      "id": "paris",
                      "name": "Paris",
                      "country": "France",
                      "primaryIcao": "LFPB",
                      "codes": [
                        "LBG",
                        "ORY"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`service_unavailable`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/estimates": {
      "post": {
        "operationId": "createEstimate",
        "summary": "Estimate a flight",
        "description": "Price range per aircraft category for a one-way or round-trip flight. Nothing is stored and no broker is notified.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "legs": {
                    "type": "array",
                    "items": {},
                    "description": "Exactly one leg, with `from`, `to` and optionally `date`, today or later. See [Flight shapes](https://docs.nx-jets.com/#flight-shapes)."
                  },
                  "returnDate": {
                    "type": "string",
                    "description": "Makes the estimate a round trip. Needs a departure date. On the same day as the departure, the aircraft waits and the return is priced at half."
                  },
                  "passengers": {
                    "type": "integer",
                    "description": "1 to 30. Omitted: every category able to fly the route. Given: only categories with enough seats. Estimates read this top-level count only."
                  },
                  "locale": {
                    "type": "string",
                    "description": "`en`, `fr`, `es` or `de`, in lower case."
                  }
                },
                "required": [
                  "legs"
                ]
              },
              "example": {
                "legs": [
                  {
                    "from": "LFPB",
                    "to": "LFMN",
                    "date": "2026-12-20"
                  }
                ],
                "passengers": 4,
                "locale": "en"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "from": {
                    "icao": "LFPB",
                    "iata": "LBG",
                    "name": "Paris-Le Bourget International Airport",
                    "city": "Paris",
                    "country": "France"
                  },
                  "to": {
                    "icao": "LFMN",
                    "iata": "NCE",
                    "name": "Nice-Côte d'Azur Airport",
                    "city": "Nice",
                    "country": "France"
                  },
                  "distanceNm": 375,
                  "roundTrip": false,
                  "currency": "EUR",
                  "seasonality": {
                    "pct": 14,
                    "events": [
                      "Year-end holidays"
                    ]
                  },
                  "quotes": [
                    {
                      "category": "turboprop",
                      "label": "Turboprop",
                      "examples": "Pilatus PC-12 · King Air 350",
                      "seats": 8,
                      "flightTime": {
                        "hours": 1,
                        "minutes": 47
                      },
                      "priceLow": 9300,
                      "priceHigh": 13500,
                      "passengerTax": 420,
                      "best": true
                    },
                    {
                      "category": "very-light",
                      "label": "Very Light",
                      "examples": "Citation Mustang · Citation M2 · Phenom 100",
                      "seats": 5,
                      "flightTime": {
                        "hours": 1,
                        "minutes": 30
                      },
                      "priceLow": 9900,
                      "priceHigh": 14100,
                      "passengerTax": 840,
                      "best": false
                    },
                    {
                      "category": "light",
                      "label": "Light",
                      "examples": "Citation CJ2 · CJ3 · CJ4 · Hawker 400",
                      "seats": 7,
                      "flightTime": {
                        "hours": 1,
                        "minutes": 20
                      },
                      "priceLow": 10300,
                      "priceHigh": 14700,
                      "passengerTax": 840,
                      "best": false
                    }
                  ],
                  "routeUrl": "https://flynxjets.com/en/private-jet/paris-to-nice"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`, `unknown_airport`, `same_airport`, `invalid_passengers`, `invalid_date`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`multi_leg_not_estimated`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`service_unavailable`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/routes/{from}/{to}/seasonality": {
      "get": {
        "operationId": "routeSeasonality",
        "summary": "Get the seasonality of a route",
        "description": "Price level of a route for each month of the year, with the events that drive it. Useful to show your client the cheapest and busiest periods.",
        "parameters": [
          {
            "name": "from",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ICAO code of the departure airport."
          },
          {
            "name": "to",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ICAO code of the arrival airport."
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`en`, `fr`, `es` or `de`, in lower case."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "months": [
                    {
                      "month": 1,
                      "level": "low",
                      "pct": -4,
                      "events": [
                        "New Year"
                      ]
                    },
                    {
                      "month": 2,
                      "level": "mid",
                      "pct": -2,
                      "events": []
                    },
                    {
                      "month": 3,
                      "level": "mid",
                      "pct": 0,
                      "events": [
                        "MIPIM in Cannes"
                      ]
                    },
                    {
                      "month": 4,
                      "level": "mid",
                      "pct": 2,
                      "events": []
                    },
                    {
                      "month": 5,
                      "level": "peak",
                      "pct": 7,
                      "events": [
                        "Cannes Film Festival"
                      ]
                    },
                    {
                      "month": 6,
                      "level": "peak",
                      "pct": 10,
                      "events": [
                        "Monaco Grand Prix",
                        "Cannes Lions"
                      ]
                    },
                    {
                      "month": 7,
                      "level": "peak",
                      "pct": 14,
                      "events": []
                    },
                    {
                      "month": 8,
                      "level": "peak",
                      "pct": 14,
                      "events": []
                    },
                    {
                      "month": 9,
                      "level": "peak",
                      "pct": 9,
                      "events": [
                        "Monaco Yacht Show"
                      ]
                    },
                    {
                      "month": 10,
                      "level": "mid",
                      "pct": 2,
                      "events": []
                    },
                    {
                      "month": 11,
                      "level": "low",
                      "pct": -4,
                      "events": []
                    },
                    {
                      "month": 12,
                      "level": "high",
                      "pct": 4,
                      "events": [
                        "Year-end holidays"
                      ]
                    }
                  ],
                  "cheapestMonths": [
                    1,
                    11
                  ],
                  "peakMonths": [
                    7,
                    8
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`, `unknown_airport`, `same_airport`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`service_unavailable`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/requests": {
      "post": {
        "operationId": "createRequest",
        "summary": "Send a flight request",
        "description": "Puts a flight request in the NX Jets brokers' queue, under your name. This is the call behind the \"Request a quote\" button of your form.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Makes a retry safe. See Limits and retries."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "legs": {
                    "type": "array",
                    "items": {},
                    "description": "One to six legs. See [Flight shapes](https://docs.nx-jets.com/#flight-shapes)."
                  },
                  "returnDate": {
                    "type": "string",
                    "description": "Makes the request a round trip."
                  },
                  "returnTime": {
                    "type": "string",
                    "description": "Preferred departure time of the return."
                  },
                  "returnPassengers": {
                    "type": "integer",
                    "description": "Passengers on the return, when the count differs from the outbound."
                  },
                  "passengers": {
                    "type": "integer",
                    "description": "1 to 30. Default for legs that carry no count of their own."
                  },
                  "category": {
                    "type": "string",
                    "description": "Category your client picked in the results."
                  },
                  "priceLow": {
                    "type": "integer",
                    "description": "The range you displayed to your client, in EUR, so the broker knows what they saw."
                  },
                  "priceHigh": {
                    "type": "integer",
                    "description": "The range you displayed to your client, in EUR, so the broker knows what they saw."
                  },
                  "client": {
                    "type": "object",
                    "description": "Your client: `name` (80 characters at most), `phone` and `email`, all optional. A malformed phone number or e-mail address is refused."
                  },
                  "reference": {
                    "type": "string",
                    "description": "Your own file reference, up to 80 characters. Returned unchanged in the response."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Free text for the broker, up to 1,000 characters."
                  },
                  "locale": {
                    "type": "string",
                    "description": "Language of your client, so the broker replies in it: `en`, `fr`, `es` or `de`."
                  }
                },
                "required": [
                  "legs"
                ]
              },
              "example": {
                "legs": [
                  {
                    "from": "LFPB",
                    "to": "LFMN",
                    "date": "2026-12-20",
                    "time": "10:00"
                  }
                ],
                "passengers": 4,
                "category": "light",
                "priceLow": 10300,
                "priceHigh": 14700,
                "client": {
                  "name": "Alex Morgan",
                  "phone": "+44 20 7946 0321",
                  "email": "alex.morgan@example.com"
                },
                "reference": "TRIP-2291",
                "notes": "Client prefers a morning departure."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "example": {
                  "id": "req_8f3k2m9x",
                  "type": "charter",
                  "status": "received",
                  "reference": "TRIP-2291",
                  "createdAt": "2026-11-24T09:42:11.889Z"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`, `unknown_airport`, `same_airport`, `invalid_passengers`, `invalid_date`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`service_unavailable`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/empty-legs": {
      "get": {
        "operationId": "listEmptyLegs",
        "summary": "List empty legs",
        "description": "The empty legs currently open, soonest first, in one response without pagination. An empty leg is a repositioning flight sold at a reduced price on a fixed route and date.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "ICAO codes, to filter on a departure or an arrival."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "ICAO codes, to filter on a departure or an arrival."
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Flight date range."
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Flight date range."
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Category key. Offers without a category are left out."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "checkedAt": "2026-11-24T06:00:12.000Z",
                  "updatedAt": "2026-11-23T17:31:05.270Z",
                  "offers": [
                    {
                      "slug": "geneva-farnborough-12-dec-k7x2",
                      "status": "open",
                      "from": {
                        "icao": "LSGG",
                        "label": "Geneva (LSGG)"
                      },
                      "to": {
                        "icao": "EGLF",
                        "label": "Farnborough (EGLF)"
                      },
                      "date": "2026-12-12",
                      "aircraft": "Citation XLS+",
                      "seats": 8,
                      "category": "super-light",
                      "yearBuilt": 2014,
                      "yearRefurbished": 2022,
                      "photo": "https://admin.nx-jets.com/api/public/aircraft-image/citation-xls-plus-exterior",
                      "cabinPhoto": "https://admin.nx-jets.com/api/public/aircraft-image/citation-xls-plus-cabin",
                      "price": {
                        "amount": 6900,
                        "currency": "EUR"
                      },
                      "url": "https://flynxjets.com/en/empty-legs/geneva-farnborough-12-dec-k7x2"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`, `invalid_date`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`service_unavailable`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/empty-legs/{slug}": {
      "get": {
        "operationId": "getEmptyLeg",
        "summary": "Get an empty leg",
        "description": "One empty leg. Call it before showing a booking form: an offer can be taken at any moment. A known offer that is taken or expired is still returned, with its `status`.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The `slug` of the offer."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "slug": "geneva-farnborough-12-dec-k7x2",
                  "status": "open",
                  "from": {
                    "icao": "LSGG",
                    "label": "Geneva (LSGG)"
                  },
                  "to": {
                    "icao": "EGLF",
                    "label": "Farnborough (EGLF)"
                  },
                  "date": "2026-12-12",
                  "aircraft": "Citation XLS+",
                  "seats": 8,
                  "category": "super-light",
                  "yearBuilt": 2014,
                  "yearRefurbished": 2022,
                  "photo": "https://admin.nx-jets.com/api/public/aircraft-image/citation-xls-plus-exterior",
                  "cabinPhoto": "https://admin.nx-jets.com/api/public/aircraft-image/citation-xls-plus-cabin",
                  "price": {
                    "amount": 6900,
                    "currency": "EUR"
                  },
                  "url": "https://flynxjets.com/en/empty-legs/geneva-farnborough-12-dec-k7x2"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`service_unavailable`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/empty-legs/{slug}/bookings": {
      "post": {
        "operationId": "bookEmptyLeg",
        "summary": "Request an empty leg",
        "description": "Asks to book an empty leg for your client. It is a request: a broker confirms availability with the operator before anything is firm.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Makes a retry safe. See Limits and retries."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "passengers": {
                    "type": "integer",
                    "description": "At least 1, at most the seats of the offer."
                  },
                  "client": {
                    "type": "object",
                    "description": "Your client: `name` (80 characters at most), `phone` and `email`, all optional. A malformed phone number or e-mail address is refused."
                  },
                  "reference": {
                    "type": "string",
                    "description": "Your own file reference, up to 80 characters. Returned unchanged in the response."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Free text for the broker, up to 1,000 characters."
                  }
                },
                "required": [
                  "passengers"
                ]
              },
              "example": {
                "passengers": 3,
                "client": {
                  "name": "Alex Morgan",
                  "phone": "+44 20 7946 0321",
                  "email": "alex.morgan@example.com"
                },
                "reference": "TRIP-2304"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "example": {
                  "id": "req_2c7n4q1d",
                  "type": "empty_leg",
                  "status": "received",
                  "offer": "geneva-farnborough-12-dec-k7x2",
                  "reference": "TRIP-2304",
                  "createdAt": "2026-11-24T11:03:27.778Z"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`, `invalid_passengers`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`offer_unavailable`, `idempotency_conflict`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`not_enough_seats`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`service_unavailable`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your partner key: nxp_live_… or nxp_test_…"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "unknown_airport",
                  "same_airport",
                  "invalid_passengers",
                  "invalid_date",
                  "unauthorized",
                  "not_found",
                  "offer_unavailable",
                  "idempotency_conflict",
                  "multi_leg_not_estimated",
                  "not_enough_seats",
                  "rate_limited",
                  "service_unavailable"
                ]
              },
              "message": {
                "type": "string"
              },
              "field": {
                "type": "string",
                "description": "Path of the field at fault, when the error points at one."
              }
            }
          }
        }
      }
    }
  }
}
