{
  "openapi": "3.0.3",
  "info": {
    "title": "HTS Flights API",
    "description": "API for flight shopping, booking, ancillary services, and post-booking operations.",
    "version": "1.0",
    "contact": {
      "name": "HTS API Team",
      "url": "https://hts.hopper.com/contact-us"
    },
    "license": {
      "name": "Hopper 2.0",
      "url": "https://www.hopper.com"
    }
  },
  "servers": [
    {
      "url": "https://travel-distribution.htsapis.com/api/flights/v1",
      "description": "Production"
    },
    {
      "url": "https://travel-distribution.staging.htsapis.com/api/flights/v1",
      "description": "Staging"
    }
  ],
  "paths": {
    "/shopping": {
      "put": {
        "operationId": "shopping",
        "summary": "Search for flights",
        "description": "Retrieve flight offers from multiple sources.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/shopping_request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/shopping_response"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/offerPrice": {
      "post": {
        "operationId": "offerPrice",
        "summary": "Confirm fare availability and ancillaries",
        "description": "Confirm fare availability and ancillaries (bags, seats) before booking.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Request-Id"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/offer_price_request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/offer_price_response"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/orderCreate": {
      "post": {
        "operationId": "orderCreate",
        "summary": "Create a booking and trigger ticketing",
        "description": "Create confirm PNR and trigger ticketing process.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Request-Id"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/order_create_request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/order"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/seatAvailability": {
      "put": {
        "operationId": "seatAvailability",
        "summary": "Get seat maps for a quoted offer",
        "description": "Returns available seats for each segment of a quoted offer.\nEach seat map lists bookable seats with pricing. Occupied or unavailable seats are omitted.\nUse the seat `id` in the orderCreate request `services[]` to select seats.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/seat_availability_request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/seat_availability_response"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/orderRetrieve": {
      "put": {
        "operationId": "orderRetrieve",
        "summary": "Retrieve an order",
        "description": "Retrieve booking/ticketing details via unique order ID.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/order_retrieve_request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/order"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/orderCancel": {
      "post": {
        "operationId": "orderCancel",
        "summary": "Confirm order cancellation",
        "description": "Execute the cancellation for a previously evaluated order.\nThe server re-evaluates the cancellation terms at commit time.\nReturns the confirmed cancellation with final refund amount.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Request-Id"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/order_cancellation_request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/order_cancellation"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/orderReshop": {
      "put": {
        "operationId": "orderReshop",
        "summary": "Get cancel and exchange eligibility, or shop for exchange offers",
        "description": "Unified post-booking reshop endpoint with two phases based on request body:\n\n- **Phase 1 — Eligibility** (send `order_id` only): Returns cancel eligibility\n  (penalty, refund amount, refund method) and exchange eligibility (type, penalty)\n  for the full order.\n\n- **Phase 2 — Shop** (send `order_id` + `slices`): Returns available replacement\n  flight offers with pricing differentials. Each offer includes a `token`\n  used to confirm the exchange via `orderChange`.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/order_reshop_request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/order_reshop_eligibility"
                    },
                    {
                      "$ref": "#/components/schemas/order_reshop_offers"
                    }
                  ],
                  "discriminator": {
                    "propertyName": "type",
                    "mapping": {
                      "eligibility": "#/components/schemas/order_reshop_eligibility",
                      "offers": "#/components/schemas/order_reshop_offers"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/offerConditions": {
      "put": {
        "operationId": "offerConditions",
        "summary": "Get amenities, UTAs, and policies for offers",
        "description": "Returns amenities (seat, wifi, power, etc.), UTAs (baggage, change/cancel policies, etc.),\nand fare policies for one or more offers identified by their tokens. Tokens may come from\nthe shopping response or orderReshop exchange offers.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/offer_conditions_request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/offer_conditions_response"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "/orderChange": {
      "post": {
        "operationId": "orderChange",
        "summary": "Confirm flight exchange",
        "description": "Execute the flight exchange using the `token` from the chosen offer\nreturned by `orderReshop` Phase 2. Include `payment` if additional collection\nis required (i.e., `change_total` on the offer is positive).\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Request-Id"
          },
          {
            "$ref": "#/components/parameters/Idempotency-Key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/order_change_confirm_request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/order_change"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/Request-Id"
              },
              "Idempotency-Key": {
                "$ref": "#/components/headers/Idempotency-Key"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "hts_api_key": []
    }
  ],
  "components": {
    "parameters": {
      "Request-Id": {
        "name": "Request-Id",
        "in": "header",
        "required": false,
        "description": "Optional client-supplied UUID to correlate this request across your systems and ours.\nWhen provided, the same value is echoed back in the `Request-Id` response header and\nused in logs and traces. When omitted, the server generates one automatically.\nMust be a valid UUID; invalid values are rejected with `400 Bad Request`.\n",
        "schema": {
          "type": "string",
          "format": "uuid",
          "example": "d290f1ee-6c54-4b01-90e6-d701748f0851"
        }
      },
      "Idempotency-Key": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Optional client-supplied unique string to ensure idempotent processing.\nWhen provided, sending the same key for the same request will return the same result\nwithout re-processing. When omitted, the server generates a UUID automatically.\nThe resolved key is always returned in the `Idempotency-Key` response header so it\ncan be captured and re-sent for retries.\n",
        "schema": {
          "type": "string",
          "maxLength": 128,
          "pattern": "^[\\x20-\\x7E]+$",
          "example": "550e8400-e29b-41d4-a716-446655440000"
        }
      }
    },
    "headers": {
      "Request-Id": {
        "description": "UUID that uniquely identifies this request. If a valid `Request-Id` was sent in the\nrequest header, this echoes that value; otherwise a server-generated UUID is returned.\nInclude this value when contacting support to help correlate logs and traces.\n",
        "schema": {
          "type": "string",
          "format": "uuid",
          "example": "d290f1ee-6c54-4b01-90e6-d701748f0851"
        }
      },
      "Idempotency-Key": {
        "description": "The idempotency key used for this request. If a valid `Idempotency-Key` was sent in\nthe request header, this echoes that value; otherwise a server-generated UUID is returned.\nCapture this value from the response to retry the same request safely.\n",
        "schema": {
          "type": "string",
          "maxLength": 128,
          "example": "550e8400-e29b-41d4-a716-446655440000"
        }
      }
    },
    "securitySchemes": {
      "hts_api_key": {
        "type": "apiKey",
        "in": "header",
        "name": "HTS-API-KEY"
      }
    },
    "schemas": {
      "error_detail": {
        "type": "object",
        "title": "ErrorDetail",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "A machine-readable snake_case string for programmatic handling.",
            "example": "parameter_missing"
          },
          "message": {
            "type": "string",
            "description": "A human-readable description for the developer.",
            "example": "The 'passengers' parameter is required to create a booking."
          },
          "param": {
            "type": "string",
            "description": "The specific request parameter that caused the error.",
            "example": "passengers"
          }
        }
      },
      "error": {
        "type": "object",
        "title": "Error",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/error_detail"
          }
        }
      },
      "shopping_request": {
        "type": "object",
        "title": "ShoppingRequest",
        "required": [
          "slices",
          "passengers"
        ],
        "properties": {
          "slices": {
            "type": "array",
            "minItems": 1,
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/query_slice"
            }
          },
          "passengers": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/passenger_count"
            }
          }
        }
      },
      "shopping_response": {
        "type": "object",
        "title": "ShoppingResponse",
        "required": [
          "offers"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for this shop response.",
            "example": "shop_abc123"
          },
          "offers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/offer"
            }
          }
        }
      },
      "offer": {
        "type": "object",
        "title": "Offer",
        "description": "A flight offer containing slices, a token, and pricing information.",
        "required": [
          "token",
          "slices",
          "price"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "An opaque token that identifies the offer for quoting.",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
          },
          "slices": {
            "type": "array",
            "description": "The flight slices (journeys) included in this offer.",
            "items": {
              "$ref": "#/components/schemas/slice"
            }
          },
          "price": {
            "$ref": "#/components/schemas/price"
          },
          "validating_carrier_code": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "IATA code of the validating carrier for this offer.",
            "example": "AC"
          },
          "passenger_pricing": {
            "type": "array",
            "description": "Per-passenger-type price breakdown for this offer.",
            "items": {
              "$ref": "#/components/schemas/passenger_pricing"
            }
          },
          "required_passenger_information": {
            "type": "array",
            "description": "Passenger information required for this offer at offerPrice time. When absent, no additional passenger information is required beyond the standard fields.",
            "items": {
              "$ref": "#/components/schemas/required_passenger_information"
            }
          }
        }
      },
      "price": {
        "type": "object",
        "title": "Price",
        "description": "Price information for an offer.",
        "required": [
          "currency",
          "base_amount",
          "total_amount",
          "taxes_and_fees_amount",
          "taxes_and_fees"
        ],
        "properties": {
          "currency": {
            "$ref": "#/components/schemas/currency"
          },
          "base_amount": {
            "type": "string",
            "description": "The base fare amount before taxes as a decimal string.",
            "example": "120.00"
          },
          "total_amount": {
            "type": "string",
            "description": "The total amount as a decimal string (base_amount + taxes_and_fees).",
            "example": "150.00"
          },
          "taxes_and_fees_amount": {
            "type": "string",
            "description": "The total amount of taxes and fees as a decimal string.",
            "example": "30.00"
          },
          "taxes_and_fees": {
            "type": "array",
            "description": "Itemized taxes and fees breakdown.",
            "items": {
              "$ref": "#/components/schemas/charge"
            }
          }
        }
      },
      "segment": {
        "type": "object",
        "title": "Segment",
        "description": "A single flight segment (e.g., a non-stop flight from A to B).",
        "required": [
          "id",
          "origin_airport_code",
          "destination_airport_code",
          "departure_date_time",
          "arrival_date_time",
          "flight_number",
          "marketing_carrier_code"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique segment identifier within this quote/order",
            "example": "seg_0"
          },
          "origin_airport_code": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "IATA code of the origin airport",
            "example": "YUL"
          },
          "destination_airport_code": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "IATA code of the destination airport",
            "example": "JFK"
          },
          "departure_date_time": {
            "type": "string",
            "format": "date-time",
            "description": "Departure date and time in ISO 8601 format",
            "example": "2026-06-01T10:00:00Z"
          },
          "arrival_date_time": {
            "type": "string",
            "format": "date-time",
            "description": "Arrival date and time in ISO 8601 format",
            "example": "2026-06-01T12:00:00Z"
          },
          "flight_number": {
            "type": "string",
            "description": "The flight number",
            "example": "1234"
          },
          "marketing_carrier_code": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "IATA code of the marketing carrier",
            "example": "AC"
          },
          "operating_carrier_code": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "IATA code of the operating carrier",
            "example": "UA"
          },
          "cabin_class": {
            "$ref": "#/components/schemas/cabin_class"
          },
          "stops": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of stops on this segment (0 = non-stop)",
            "example": 0
          },
          "fare_basis_code": {
            "type": "string",
            "description": "The fare basis code for this segment",
            "example": "YOWCA"
          },
          "booking_class_code": {
            "type": "string",
            "description": "The booking class (RBD) for this segment",
            "example": "Y"
          },
          "fare_brand_name": {
            "type": "string",
            "description": "The branded fare name for this segment",
            "example": "Economy Flex"
          },
          "duration": {
            "type": "string",
            "description": "Flight duration in ISO 8601 duration format",
            "example": "PT2H30M"
          },
          "equipment_code": {
            "type": "string",
            "description": "IATA aircraft type code",
            "example": "320"
          },
          "status": {
            "$ref": "#/components/schemas/segment_status"
          }
        }
      },
      "segment_status": {
        "type": "string",
        "title": "SegmentStatus",
        "description": "Segment booking status. Only present in order responses (not in shopping or offerPrice).\n- `confirmed`: Segment is confirmed.\n- `cancelled`: Segment cancelled.\n- `pending`: Awaiting confirmation.\n",
        "enum": [
          "confirmed",
          "cancelled",
          "pending"
        ],
        "example": "confirmed"
      },
      "passenger_count": {
        "type": "object",
        "title": "PassengerCount",
        "required": [
          "type",
          "count"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/passenger_type"
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9,
            "example": 1
          }
        }
      },
      "passenger_type": {
        "type": "string",
        "title": "PassengerType",
        "enum": [
          "adult",
          "child",
          "lap_infant",
          "seated_infant"
        ],
        "example": "adult"
      },
      "cabin_class": {
        "type": "string",
        "title": "CabinClass",
        "enum": [
          "economy",
          "premium_economy",
          "business",
          "first"
        ],
        "example": "economy"
      },
      "currency": {
        "type": "string",
        "title": "Currency",
        "description": "ISO 4217 currency code",
        "minLength": 3,
        "maxLength": 3,
        "pattern": "^[A-Z]{3}$",
        "example": "USD"
      },
      "baggage_metadata": {
        "type": "object",
        "title": "BaggageMetadata",
        "description": "Metadata for a baggage service",
        "required": [
          "type",
          "baggage_type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "baggage"
            ],
            "description": "Service type discriminator"
          },
          "baggage_type": {
            "type": "string",
            "enum": [
              "checked",
              "carry_on"
            ],
            "description": "Type of baggage",
            "example": "checked"
          },
          "maximum_weight_kg": {
            "type": "number",
            "description": "Maximum weight in kilograms",
            "example": 23
          }
        }
      },
      "pricing_tier": {
        "type": "object",
        "title": "PricingTier",
        "description": "A pricing tier for a service with quantity-dependent pricing",
        "required": [
          "tier",
          "price"
        ],
        "properties": {
          "tier": {
            "type": "integer",
            "minimum": 1,
            "description": "The ordinal tier number (1 = first unit, 2 = second unit, etc.)",
            "example": 1
          },
          "price": {
            "$ref": "#/components/schemas/price"
          }
        }
      },
      "available_service": {
        "type": "object",
        "title": "AvailableService",
        "description": "An ancillary service available for purchase",
        "required": [
          "id",
          "type",
          "price",
          "passenger_ids",
          "maximum_quantity"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Opaque service identifier",
            "example": "svc_bag_checked"
          },
          "type": {
            "type": "string",
            "enum": [
              "baggage"
            ],
            "description": "Service type discriminator",
            "example": "baggage"
          },
          "price": {
            "$ref": "#/components/schemas/price"
          },
          "tiers": {
            "type": "array",
            "description": "Per-unit pricing tiers when the price varies by quantity. When present, the top-level price reflects the first tier.",
            "items": {
              "$ref": "#/components/schemas/pricing_tier"
            }
          },
          "segment_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Which segments this service applies to. When absent, the service applies to the entire journey.",
            "example": [
              "seg_0",
              "seg_1"
            ]
          },
          "passenger_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Which passengers this service is available for",
            "example": [
              "pas_0"
            ]
          },
          "maximum_quantity": {
            "type": "integer",
            "description": "Maximum units purchasable",
            "example": 3
          },
          "metadata": {
            "$ref": "#/components/schemas/baggage_metadata"
          }
        }
      },
      "selected_service": {
        "type": "object",
        "title": "SelectedService",
        "description": "A service selected for purchase in a booking",
        "required": [
          "id",
          "passenger_ids"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The service identifier to purchase",
            "example": "svc_bag_checked"
          },
          "passenger_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Which passengers to attach this service to",
            "example": [
              "pas_0"
            ]
          },
          "segment_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Which segments to attach this service to. When absent, applies to the entire journey."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "default": 1,
            "description": "Number of units to purchase per passenger (default 1). Mainly useful for bags with tiered pricing.",
            "example": 2
          }
        }
      },
      "service": {
        "type": "object",
        "title": "Service",
        "description": "A booked ancillary service attached to an order",
        "required": [
          "id",
          "type",
          "quantity",
          "price"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Service identifier",
            "example": "svc_bag_checked"
          },
          "type": {
            "type": "string",
            "enum": [
              "baggage",
              "seat"
            ],
            "description": "Service type",
            "example": "baggage"
          },
          "quantity": {
            "type": "integer",
            "description": "Number of units purchased",
            "example": 1
          },
          "price": {
            "$ref": "#/components/schemas/price"
          },
          "segment_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Which segments this service applies to (present for seat services)"
          },
          "passenger_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Which passengers this service applies to"
          },
          "metadata": {
            "$ref": "#/components/schemas/baggage_metadata"
          }
        }
      },
      "available_seat": {
        "type": "object",
        "title": "AvailableSeat",
        "description": "An available seat that can be selected for purchase",
        "required": [
          "id",
          "designator",
          "price"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Opaque service identifier — use in orderCreate services[] to select this seat",
            "example": "svc_seat_2A_seg_0_0"
          },
          "designator": {
            "type": "string",
            "description": "Seat designator (e.g., '2A', '14F')",
            "example": "2A"
          },
          "price": {
            "$ref": "#/components/schemas/price"
          },
          "passenger_restrictions": {
            "type": "array",
            "description": "When non-empty, only these passenger types can select this seat. Empty or absent means no restrictions.",
            "items": {
              "$ref": "#/components/schemas/passenger_type"
            }
          }
        }
      },
      "seat_map": {
        "type": "object",
        "title": "SeatMap",
        "description": "Available seats for a single flight segment",
        "required": [
          "segment_id",
          "seats"
        ],
        "properties": {
          "segment_id": {
            "type": "string",
            "description": "The segment this seat map belongs to",
            "example": "seg_0"
          },
          "seats": {
            "type": "array",
            "description": "Available seats for this segment. Only bookable seats are listed — absence means the seat is occupied or unavailable.",
            "items": {
              "$ref": "#/components/schemas/available_seat"
            }
          },
          "emergency_exit_rows": {
            "type": "array",
            "description": "Row numbers designated as emergency exit rows for this segment",
            "items": {
              "type": "integer"
            },
            "example": [
              14,
              15
            ]
          }
        }
      },
      "seat_availability_request": {
        "type": "object",
        "title": "SeatAvailabilityRequest",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "The token from an offerPrice response",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
          }
        }
      },
      "seat_availability_response": {
        "type": "object",
        "title": "SeatAvailabilityResponse",
        "required": [
          "seat_maps"
        ],
        "properties": {
          "seat_maps": {
            "type": "array",
            "description": "One seat map per segment",
            "items": {
              "$ref": "#/components/schemas/seat_map"
            }
          }
        }
      },
      "slice": {
        "type": "object",
        "title": "Slice",
        "description": "A single journey (e.g., outbound or inbound) which may consist of multiple segments.",
        "required": [
          "id",
          "origin_airport_code",
          "destination_airport_code"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique slice identifier within this order",
            "example": "sli_0"
          },
          "origin_airport_code": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "IATA code of the origin airport",
            "example": "YUL"
          },
          "destination_airport_code": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "IATA code of the destination airport",
            "example": "JFK"
          },
          "duration": {
            "type": "string",
            "description": "Total journey duration in ISO 8601 duration format",
            "example": "PT5H30M"
          },
          "segments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/segment"
            }
          }
        }
      },
      "query_slice": {
        "type": "object",
        "title": "QuerySlice",
        "description": "A single journey search criteria (e.g., outbound or inbound).",
        "required": [
          "origin",
          "destination",
          "departure_date"
        ],
        "properties": {
          "origin": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "IATA airport or city code of the origin",
            "example": "YUL"
          },
          "destination": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "IATA airport or city code of the destination",
            "example": "JFK"
          },
          "departure_date": {
            "type": "string",
            "format": "date",
            "description": "Departure date in YYYY-MM-DD format",
            "example": "2026-06-01"
          },
          "origin_type": {
            "$ref": "#/components/schemas/region_type"
          },
          "destination_type": {
            "$ref": "#/components/schemas/region_type"
          }
        }
      },
      "region_type": {
        "type": "string",
        "title": "RegionType",
        "description": "Whether a location code refers to an airport or a city. Defaults to airport.",
        "enum": [
          "airport",
          "city"
        ],
        "default": "airport",
        "example": "airport"
      },
      "gender": {
        "type": "string",
        "title": "Gender",
        "enum": [
          "male",
          "female",
          "unspecified"
        ],
        "example": "male"
      },
      "passenger": {
        "type": "object",
        "title": "Passenger",
        "required": [
          "type",
          "first_name",
          "last_name",
          "date_of_birth",
          "gender",
          "email",
          "phone_number"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique passenger identifier within this quote/order",
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          "type": {
            "$ref": "#/components/schemas/passenger_type"
          },
          "first_name": {
            "type": "string",
            "minLength": 1,
            "description": "Passenger's first name",
            "example": "John"
          },
          "middle_name": {
            "type": "string",
            "description": "Passenger's middle name",
            "example": "Michael"
          },
          "last_name": {
            "type": "string",
            "minLength": 1,
            "description": "Passenger's last name",
            "example": "Doe"
          },
          "date_of_birth": {
            "type": "string",
            "format": "date",
            "description": "Passenger's date of birth in YYYY-MM-DD format",
            "example": "1990-01-15"
          },
          "gender": {
            "$ref": "#/components/schemas/gender"
          },
          "nationality": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "Passenger's nationality as an ISO 3166-1 alpha-2 country code",
            "example": "US"
          },
          "travel_documents": {
            "type": "array",
            "description": "Passenger's travel documents",
            "items": {
              "$ref": "#/components/schemas/travel_document"
            }
          },
          "frequent_flyer_programs": {
            "type": "array",
            "description": "Passenger's frequent flyer program memberships",
            "items": {
              "$ref": "#/components/schemas/frequent_flyer_program"
            }
          },
          "accompanying_adult_id": {
            "type": "string",
            "description": "For lap_infant passengers only: the ID of the accompanying adult passenger this infant is traveling with.",
            "example": "pas_0"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Passenger's email address",
            "example": "john@example.com"
          },
          "phone_number": {
            "type": "string",
            "minLength": 1,
            "description": "Passenger's phone number",
            "example": "+15551234567"
          },
          "special_assistance": {
            "type": "array",
            "description": "Special assistance requests for this passenger.",
            "items": {
              "type": "string",
              "enum": [
                "blind",
                "deaf",
                "stretcher",
                "wheelchair_ramp",
                "wheelchair_steps",
                "wheelchair_cabin",
                "wheelchair_dry_battery",
                "wheelchair_wet_battery",
                "wheelchair_lithium_battery",
                "wheelchair_manual",
                "wheelchair_onboard"
              ]
            },
            "example": [
              "blind"
            ]
          }
        }
      },
      "offer_price_request": {
        "type": "object",
        "title": "OfferPriceRequest",
        "required": [
          "token",
          "passengers"
        ],
        "properties": {
          "token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "description": "Opaque token from a shop offer's token field",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
          },
          "passengers": {
            "type": "array",
            "minItems": 1,
            "maxItems": 9,
            "items": {
              "$ref": "#/components/schemas/passenger"
            }
          }
        }
      },
      "offer_price_response": {
        "type": "object",
        "title": "OfferPriceResponse",
        "required": [
          "slices",
          "price",
          "token",
          "passengers"
        ],
        "properties": {
          "slices": {
            "type": "array",
            "description": "The flight slices (journeys) included in this offer.",
            "items": {
              "$ref": "#/components/schemas/slice"
            }
          },
          "price": {
            "$ref": "#/components/schemas/price"
          },
          "token": {
            "type": "string",
            "description": "Opaque token to use for booking this quoted offer",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
          },
          "passengers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/passenger"
            }
          },
          "available_services": {
            "type": "array",
            "description": "Ancillary services available for purchase with this offer",
            "items": {
              "$ref": "#/components/schemas/available_service"
            }
          }
        }
      },
      "payment": {
        "title": "Payment",
        "type": "object",
        "description": "Payment details for the booking.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/balance_payment"
          },
          {
            "$ref": "#/components/schemas/spreedly_payment"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "balance": "#/components/schemas/balance_payment",
            "spreedly": "#/components/schemas/spreedly_payment"
          }
        }
      },
      "balance_payment": {
        "title": "BalancePayment",
        "type": "object",
        "description": "Balance payment — the partner is Merchant of Record and settles with Hopper via invoicing.",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "balance"
            ],
            "description": "Payment method type discriminator"
          }
        }
      },
      "spreedly_payment": {
        "title": "SpreedlyPayment",
        "type": "object",
        "description": "Direct credit card payment via the Spreedly vault. Required for tenants configured for direct payment processing.",
        "required": [
          "type",
          "token"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "spreedly"
            ],
            "description": "Payment method type discriminator"
          },
          "token": {
            "type": "string",
            "minLength": 1,
            "description": "Payment method token issued by the Spreedly vault."
          }
        }
      },
      "order_create_request": {
        "type": "object",
        "title": "OrderCreateRequest",
        "required": [
          "token",
          "payment"
        ],
        "properties": {
          "token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "description": "Opaque token from an offerPrice response",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
          },
          "payment": {
            "$ref": "#/components/schemas/payment"
          },
          "services": {
            "type": "array",
            "description": "Ancillary services to include in the booking",
            "items": {
              "$ref": "#/components/schemas/selected_service"
            }
          }
        }
      },
      "order_status": {
        "type": "string",
        "title": "OrderStatus",
        "description": "- `booked`: Booking confirmed, pending ticketing.\n- `ticketed`: Tickets issued.\n- `cancelled`: Order cancelled.\n- `pending`: Awaiting processing or provider confirmation.\n",
        "enum": [
          "booked",
          "ticketed",
          "cancelled",
          "pending"
        ],
        "example": "ticketed"
      },
      "order": {
        "type": "object",
        "title": "Order",
        "description": "A confirmed flight booking with ancillary services",
        "required": [
          "id",
          "status",
          "slices",
          "passengers",
          "price",
          "booked_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique order identifier",
            "example": "ord_abc123"
          },
          "status": {
            "$ref": "#/components/schemas/order_status"
          },
          "booked_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the booking was created",
            "example": "2026-07-15T10:30:00Z"
          },
          "slices": {
            "type": "array",
            "description": "The flight slices (journeys) included in this order.",
            "items": {
              "$ref": "#/components/schemas/slice"
            }
          },
          "passengers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/passenger"
            }
          },
          "price": {
            "$ref": "#/components/schemas/price"
          },
          "booking_reference": {
            "type": "string",
            "description": "Primary airline PNR/record locator",
            "example": "ABC123"
          },
          "booking_references": {
            "type": "array",
            "description": "All carrier booking references (one per carrier in interline/codeshare bookings)",
            "items": {
              "$ref": "#/components/schemas/booking_reference"
            }
          },
          "documents": {
            "type": "array",
            "description": "Issued documents (e-tickets and EMDs) for this order",
            "items": {
              "$ref": "#/components/schemas/document"
            }
          },
          "services": {
            "type": "array",
            "description": "Booked ancillary services",
            "items": {
              "$ref": "#/components/schemas/service"
            }
          }
        }
      },
      "order_reshop_request": {
        "type": "object",
        "title": "OrderReshopRequest",
        "description": "Unified reshop request. Send `order_id` only for Phase 1 (eligibility).\nAdd `slices` for Phase 2 (exchange shop).\n",
        "required": [
          "order_id"
        ],
        "properties": {
          "order_id": {
            "type": "string",
            "description": "The order to evaluate for cancel or exchange",
            "example": "ord_abc123"
          },
          "slices": {
            "$ref": "#/components/schemas/order_change_slices"
          }
        }
      },
      "cancel_eligibility_type": {
        "type": "string",
        "title": "CancelEligibilityType",
        "enum": [
          "void",
          "refund"
        ],
        "description": "- `void`: Same-day cancellation within the void window; full refund, no penalty.\n- `refund`: Post-void cancellation; penalty deducted from refund.\n",
        "example": "refund"
      },
      "exchange_eligibility_type": {
        "type": "string",
        "title": "ExchangeEligibilityType",
        "enum": [
          "free",
          "fee"
        ],
        "description": "- `free`: No change fee (airline FTC policy or fare rules).\n- `fee`: Change fee applies. The `penalty` field contains the fee amount when the provider reports it upfront; otherwise it is omitted and the exact fee appears on each offer during exchange shopping.\n",
        "example": "fee"
      },
      "refund_to": {
        "type": "string",
        "title": "RefundTo",
        "enum": [
          "original_form_of_payment",
          "voucher"
        ],
        "description": "- `original_form_of_payment`: Refund returned to the card used at booking.\n- `voucher`: Refund issued as future travel credit.\n",
        "example": "original_form_of_payment"
      },
      "cancel_eligibility": {
        "type": "object",
        "title": "CancelEligibility",
        "required": [
          "eligible"
        ],
        "properties": {
          "eligible": {
            "type": "boolean",
            "description": "Whether the order is eligible for cancellation",
            "example": true
          },
          "type": {
            "$ref": "#/components/schemas/cancel_eligibility_type"
          },
          "refund_to": {
            "$ref": "#/components/schemas/refund_to"
          },
          "penalty": {
            "$ref": "#/components/schemas/price"
          },
          "refund": {
            "$ref": "#/components/schemas/price"
          }
        }
      },
      "exchange_eligibility": {
        "type": "object",
        "title": "ExchangeEligibility",
        "required": [
          "eligible"
        ],
        "properties": {
          "eligible": {
            "type": "boolean",
            "description": "Whether the order is eligible for exchange",
            "example": true
          },
          "type": {
            "$ref": "#/components/schemas/exchange_eligibility_type"
          },
          "penalty": {
            "description": "Exchange penalty amount, if known at eligibility time. Some providers only determine the penalty during exchange shopping; in that case this field is omitted and the fee appears on each exchange offer.",
            "allOf": [
              {
                "$ref": "#/components/schemas/price"
              }
            ]
          }
        }
      },
      "order_reshop_eligibility": {
        "type": "object",
        "title": "OrderReshopEligibility",
        "description": "Phase 1 response: cancel and exchange eligibility for the order",
        "required": [
          "type",
          "cancel",
          "exchange"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "eligibility"
            ],
            "description": "Discriminator — always 'eligibility' for Phase 1 responses"
          },
          "cancel": {
            "$ref": "#/components/schemas/cancel_eligibility"
          },
          "exchange": {
            "$ref": "#/components/schemas/exchange_eligibility"
          }
        }
      },
      "reshop_offer": {
        "type": "object",
        "title": "ReshopOffer",
        "description": "A replacement flight offer with pricing differentials",
        "required": [
          "token",
          "slices",
          "change_total",
          "penalty",
          "new_total"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "Opaque token identifying this offer. Pass to orderChange to confirm.",
            "example": "eyJhbGciOiJIUzI1NiJ9..."
          },
          "slices": {
            "type": "array",
            "description": "The replacement flight slices for this offer.",
            "items": {
              "$ref": "#/components/schemas/slice"
            }
          },
          "change_total": {
            "$ref": "#/components/schemas/price"
          },
          "penalty": {
            "$ref": "#/components/schemas/price"
          },
          "new_total": {
            "$ref": "#/components/schemas/price"
          }
        }
      },
      "order_reshop_offers": {
        "type": "object",
        "title": "OrderReshopOffers",
        "description": "Phase 2 response: available replacement flight offers",
        "required": [
          "type",
          "offers"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "offers"
            ],
            "description": "Discriminator — always 'offers' for Phase 2 responses"
          },
          "offers": {
            "type": "array",
            "description": "Available exchange options. Empty when no alternatives exist.",
            "items": {
              "$ref": "#/components/schemas/reshop_offer"
            }
          }
        }
      },
      "order_retrieve_request": {
        "type": "object",
        "title": "OrderRetrieveRequest",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The order identifier",
            "example": "ord_abc123"
          }
        }
      },
      "order_cancellation_request": {
        "type": "object",
        "title": "OrderCancellationRequest",
        "required": [
          "order_id"
        ],
        "properties": {
          "order_id": {
            "type": "string",
            "description": "The order to cancel",
            "example": "ord_abc123"
          }
        }
      },
      "cancellation_status": {
        "type": "string",
        "title": "CancellationStatus",
        "enum": [
          "confirmed",
          "pending"
        ],
        "example": "confirmed"
      },
      "order_cancellation": {
        "type": "object",
        "title": "OrderCancellation",
        "description": "A confirmed order cancellation with refund details",
        "required": [
          "id",
          "order_id",
          "status",
          "refund",
          "penalty"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique cancellation identifier",
            "example": "ocn_xyz789"
          },
          "order_id": {
            "type": "string",
            "description": "The order that was cancelled",
            "example": "ord_abc123"
          },
          "status": {
            "$ref": "#/components/schemas/cancellation_status"
          },
          "refund": {
            "$ref": "#/components/schemas/price"
          },
          "refund_method": {
            "$ref": "#/components/schemas/refund_method"
          },
          "penalty": {
            "$ref": "#/components/schemas/price"
          }
        }
      },
      "refund_method": {
        "type": "string",
        "title": "RefundMethod",
        "description": "How the refund will be issued to the customer.\n- `original_form_of_payment`: Refund to the original payment method.\n- `voucher`: Airline-issued travel voucher or future travel credit.\n",
        "enum": [
          "original_form_of_payment",
          "voucher"
        ],
        "example": "original_form_of_payment"
      },
      "slice_to_remove": {
        "type": "object",
        "title": "SliceToRemove",
        "required": [
          "slice_id"
        ],
        "properties": {
          "slice_id": {
            "type": "string",
            "description": "ID of the slice to replace from the original order",
            "example": "sli_0"
          }
        }
      },
      "order_change_slices": {
        "type": "object",
        "title": "OrderChangeSlices",
        "description": "Specifies which slices to remove and what replacement criteria to search for",
        "required": [
          "remove",
          "add"
        ],
        "properties": {
          "remove": {
            "type": "array",
            "description": "Slices to remove from the original order",
            "items": {
              "$ref": "#/components/schemas/slice_to_remove"
            }
          },
          "add": {
            "type": "array",
            "description": "Replacement slice search criteria",
            "items": {
              "$ref": "#/components/schemas/query_slice"
            }
          }
        }
      },
      "change_status": {
        "type": "string",
        "title": "ChangeStatus",
        "enum": [
          "confirmed",
          "pending"
        ],
        "example": "confirmed"
      },
      "order_change": {
        "type": "object",
        "title": "OrderChange",
        "description": "A confirmed order change (exchange)",
        "required": [
          "id",
          "order_id",
          "status",
          "change_total",
          "penalty"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Change identifier",
            "example": "och_change789"
          },
          "order_id": {
            "type": "string",
            "description": "The order being changed",
            "example": "ord_abc123"
          },
          "status": {
            "$ref": "#/components/schemas/change_status"
          },
          "change_total": {
            "$ref": "#/components/schemas/price"
          },
          "penalty": {
            "$ref": "#/components/schemas/price"
          }
        }
      },
      "order_change_confirm_request": {
        "type": "object",
        "title": "OrderChangeConfirmRequest",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "maxLength": 1024,
            "description": "The token from the chosen offer returned by orderReshop Phase 2",
            "example": "eyJhbGciOiJIUzI1NiJ9..."
          },
          "payment": {
            "$ref": "#/components/schemas/payment"
          }
        }
      },
      "passport_document": {
        "type": "object",
        "title": "PassportDocument",
        "description": "A passport travel document",
        "required": [
          "type",
          "number",
          "issuing_country"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "passport"
            ],
            "description": "Travel document type discriminator"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "description": "Passport number",
            "example": "A1234567"
          },
          "issuing_country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "ISO 3166-1 alpha-2 country code of the issuing country",
            "example": "US"
          },
          "expiry_date": {
            "type": "string",
            "format": "date",
            "description": "Passport expiry date",
            "example": "2030-01-15"
          }
        }
      },
      "national_id_document": {
        "type": "object",
        "title": "NationalIdDocument",
        "description": "A national identity document",
        "required": [
          "type",
          "number",
          "issuing_country"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "national_id"
            ],
            "description": "Travel document type discriminator"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "description": "National ID number",
            "example": "12345678"
          },
          "issuing_country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "ISO 3166-1 alpha-2 country code of the issuing country",
            "example": "BR"
          }
        }
      },
      "known_traveler_document": {
        "type": "object",
        "title": "KnownTravelerDocument",
        "description": "TSA PreCheck Known Traveler Number (KTN)",
        "required": [
          "type",
          "number",
          "issuing_country"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "known_traveler"
            ],
            "description": "Travel document type discriminator"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "description": "TSA PreCheck Known Traveler Number",
            "example": "123456789"
          },
          "issuing_country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "ISO 3166-1 alpha-2 country code of the issuing country",
            "example": "US"
          }
        }
      },
      "redress_document": {
        "type": "object",
        "title": "RedressDocument",
        "description": "DHS Traveler Redress Inquiry Program (TRIP) redress control number",
        "required": [
          "type",
          "number",
          "issuing_country"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "redress"
            ],
            "description": "Travel document type discriminator"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "description": "DHS Redress Control Number",
            "example": "1234567"
          },
          "issuing_country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "ISO 3166-1 alpha-2 country code of the issuing country",
            "example": "US"
          }
        }
      },
      "travel_document": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/passport_document"
          },
          {
            "$ref": "#/components/schemas/national_id_document"
          },
          {
            "$ref": "#/components/schemas/known_traveler_document"
          },
          {
            "$ref": "#/components/schemas/redress_document"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "passport": "#/components/schemas/passport_document",
            "national_id": "#/components/schemas/national_id_document",
            "known_traveler": "#/components/schemas/known_traveler_document",
            "redress": "#/components/schemas/redress_document"
          }
        }
      },
      "passenger_pricing": {
        "type": "object",
        "title": "PassengerPricing",
        "description": "Price breakdown for a specific passenger type.",
        "required": [
          "type",
          "count",
          "price"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/passenger_type"
          },
          "count": {
            "type": "integer",
            "description": "Number of passengers of this type this pricing applies to.",
            "minimum": 1,
            "example": 2
          },
          "price": {
            "$ref": "#/components/schemas/price"
          }
        }
      },
      "charge": {
        "type": "object",
        "title": "Charge",
        "description": "An individual tax or fee component of a price (e.g., carrier-imposed surcharges, government taxes, airport fees)",
        "required": [
          "code",
          "amount"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Charge code identifier (e.g., IATA tax/fee codes)",
            "example": "YQ"
          },
          "amount": {
            "type": "string",
            "description": "Charge amount as a decimal string",
            "example": "15.00"
          }
        }
      },
      "frequent_flyer_program": {
        "type": "object",
        "title": "FrequentFlyerProgram",
        "description": "A passenger's frequent flyer program membership",
        "required": [
          "airline",
          "number"
        ],
        "properties": {
          "airline": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "IATA code of the airline operating the program",
            "example": "AC"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "description": "Frequent flyer membership number",
            "example": "AC123456789"
          }
        }
      },
      "document": {
        "type": "object",
        "title": "Document",
        "description": "An issued document — either an e-ticket (for flights) or an EMD (for ancillary services)",
        "required": [
          "type",
          "number",
          "passenger_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "electronic_ticket",
              "emd"
            ],
            "description": "Document type: electronic_ticket for flight e-tickets, emd (Electronic Miscellaneous Document) for paid ancillary services",
            "example": "electronic_ticket"
          },
          "number": {
            "type": "string",
            "description": "Document number (e.g., 13-digit e-ticket number or EMD number)",
            "example": "0141234567890"
          },
          "passenger_id": {
            "type": "string",
            "description": "The passenger this document is issued for",
            "example": "pas_0"
          }
        }
      },
      "booking_reference": {
        "type": "object",
        "title": "BookingReference",
        "description": "An airline booking reference (PNR/record locator)",
        "required": [
          "airline_code",
          "reference"
        ],
        "properties": {
          "airline_code": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "IATA code of the airline",
            "example": "AC"
          },
          "reference": {
            "type": "string",
            "description": "Airline confirmation/record locator code (PNR)",
            "example": "ABC123"
          }
        }
      },
      "required_passenger_information": {
        "type": "object",
        "title": "RequiredPassengerInformation",
        "description": "Indicates a type of passenger information required for this offer at offerPrice time",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "nationality",
              "passport",
              "national_id",
              "known_traveler",
              "redress"
            ],
            "description": "The type of passenger information required",
            "example": "nationality"
          }
        }
      },
      "offer_conditions_request": {
        "type": "object",
        "title": "OfferConditionsRequest",
        "required": [
          "offers",
          "currency",
          "locale"
        ],
        "properties": {
          "offers": {
            "type": "array",
            "description": "Offers to look up conditions for.",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/offer_conditions_offer"
            }
          },
          "currency": {
            "$ref": "#/components/schemas/currency"
          },
          "locale": {
            "type": "string",
            "description": "Language tag for localized content (e.g., en-US).",
            "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$",
            "maxLength": 35,
            "example": "en-US"
          }
        }
      },
      "offer_conditions_offer": {
        "type": "object",
        "title": "OfferConditionsOffer",
        "description": "An offer to look up conditions for.",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "Opaque token from a shopping or orderReshop offer response.",
            "minLength": 1,
            "maxLength": 1024,
            "example": "eyJhbGciOiJIUzI1NiJ9..."
          }
        }
      },
      "offer_conditions_response": {
        "type": "object",
        "title": "OfferConditionsResponse",
        "required": [
          "conditions"
        ],
        "properties": {
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/offer_conditions"
            }
          }
        }
      },
      "offer_conditions": {
        "type": "object",
        "title": "OfferConditions",
        "description": "Amenities, UTAs, and policies for a single offer, broken down per slice. When the token cannot be decoded or the upstream lookup fails, the `error` field describes the problem and the `slices` field is omitted.",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "The token that was used to look up these conditions."
          },
          "slices": {
            "type": "array",
            "description": "Per-slice conditions. Each entry corresponds to a slice from the shopping response, identified by `slice_id`.",
            "items": {
              "$ref": "#/components/schemas/condition_slice"
            }
          },
          "error": {
            "description": "Per-token error when the token is invalid or the upstream lookup fails.",
            "allOf": [
              {
                "$ref": "#/components/schemas/error_detail"
              }
            ]
          }
        }
      },
      "condition_slice": {
        "type": "object",
        "title": "ConditionSlice",
        "description": "Conditions for a single slice (journey leg).",
        "required": [
          "slice_id"
        ],
        "properties": {
          "slice_id": {
            "type": "string",
            "description": "Slice identifier matching the shopping or orderReshop response.",
            "example": "sli_0"
          },
          "amenities": {
            "type": "array",
            "description": "Flight amenities for this slice.",
            "items": {
              "$ref": "#/components/schemas/condition_amenity"
            }
          },
          "utas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/condition_uta"
            }
          },
          "change_policy": {
            "$ref": "#/components/schemas/condition_multi_policy"
          },
          "cancellation_policy": {
            "$ref": "#/components/schemas/condition_multi_policy"
          }
        }
      },
      "condition_amenity": {
        "type": "object",
        "title": "ConditionAmenity",
        "description": "A flight amenity.",
        "required": [
          "description"
        ],
        "properties": {
          "category": {
            "$ref": "#/components/schemas/condition_amenity_category"
          },
          "description": {
            "type": "string",
            "description": "Human-readable description of the amenity.",
            "example": "Streaming Capable Wi-Fi"
          },
          "assessment": {
            "$ref": "#/components/schemas/condition_assessment"
          }
        }
      },
      "condition_amenity_category": {
        "type": "string",
        "title": "ConditionAmenityCategory",
        "enum": [
          "seat",
          "wifi",
          "power",
          "entertainment",
          "fresh_food",
          "beverage",
          "layout",
          "aircraft"
        ],
        "example": "wifi"
      },
      "condition_uta": {
        "type": "object",
        "title": "ConditionUta",
        "description": "Universal Ticket Attribute — a fare feature or restriction.",
        "required": [
          "description"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "Detailed explanation of the attribute.",
            "example": "First checked bag up to 23kg is included in your fare."
          },
          "category": {
            "$ref": "#/components/schemas/condition_uta_category"
          },
          "assessment": {
            "$ref": "#/components/schemas/condition_assessment"
          }
        }
      },
      "condition_uta_category": {
        "type": "string",
        "title": "ConditionUtaCategory",
        "enum": [
          "advance_change",
          "boarding_priority",
          "cancellation",
          "carry_on_allowance",
          "check_in_priority",
          "checked_bag_allowance",
          "lounge_access",
          "same_day_change",
          "seat_selection",
          "upgrade_eligibility",
          "refundable_fare",
          "personal_item"
        ],
        "example": "checked_bag_allowance"
      },
      "condition_assessment": {
        "type": "string",
        "title": "ConditionAssessment",
        "description": "Qualitative assessment of a fare attribute or policy.",
        "enum": [
          "neutral",
          "benefit",
          "restriction",
          "fee"
        ],
        "example": "benefit"
      },
      "condition_multi_policy": {
        "type": "object",
        "title": "ConditionMultiPolicy",
        "description": "Change or cancellation policy with time-based breakdown.",
        "properties": {
          "before_departure": {
            "$ref": "#/components/schemas/condition_policy"
          },
          "after_departure": {
            "$ref": "#/components/schemas/condition_policy"
          },
          "anytime": {
            "$ref": "#/components/schemas/condition_policy"
          }
        }
      },
      "condition_policy": {
        "type": "object",
        "title": "ConditionPolicy",
        "description": "A single change or cancellation policy.",
        "required": [
          "description"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "Detailed policy explanation."
          },
          "assessment": {
            "$ref": "#/components/schemas/condition_assessment"
          },
          "fee": {
            "$ref": "#/components/schemas/condition_fee"
          },
          "refund_method": {
            "$ref": "#/components/schemas/refund_method"
          }
        }
      },
      "condition_fee": {
        "type": "object",
        "title": "ConditionFee",
        "description": "A fee associated with a policy.",
        "required": [
          "currency",
          "amount"
        ],
        "properties": {
          "currency": {
            "$ref": "#/components/schemas/currency"
          },
          "amount": {
            "type": "string",
            "description": "Fee amount as a decimal string.",
            "example": "75.00"
          }
        }
      }
    }
  }
}
