{
  "openapi": "3.0.1",
  "info": {
    "title": "Travel API",
    "description": "Brex Travel External API.",
    "contact": {
      "name": "Admin",
      "url": "https://brex.com",
      "email": "developer-support@brex.com"
    },
    "version": "1.0",
    "x-logo": {
      "altText": "Brex Logo",
      "url": "https://www.brex.com/logo.png"
    }
  },
  "servers": [
    {
      "url": "https://api.brex.com",
      "description": "Production"
    },
    {
      "url": "https://api-staging.brex.com",
      "description": "Staging (Note: This is not a sandbox. It will not work with customer tokens.)"
    }
  ],
  "security": [
    {
      "OAuth2": []
    }
  ],
  "tags": [
    {
      "name": "Trips",
      "description": "Endpoints for getting trip data."
    }
  ],
  "paths": {
    "/v1/trips": {
      "get": {
        "tags": [
          "Trips"
        ],
        "summary": "List trips",
        "description": "Lists trips according to the filters passed in the query string.",
        "operationId": "listTrips",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "nullable": true
            }
          },
          {
            "name": "last_updated_after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page with a list of trips.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_Trip_"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "OAuth2": [
              "travel.trips",
              "travel.trips.readonly"
            ]
          }
        ]
      }
    },
    "/v1/trips/{trip_id}": {
      "get": {
        "tags": [
          "Trips"
        ],
        "summary": "Get trip",
        "description": "Retrieves a trip by ID.",
        "operationId": "getTrip",
        "parameters": [
          {
            "name": "trip_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The trip that was retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trip"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "OAuth2": [
              "travel.trips",
              "travel.trips.readonly"
            ]
          }
        ]
      }
    },
    "/v1/trips/{trip_id}/bookings": {
      "get": {
        "tags": [
          "Trips"
        ],
        "summary": "List trip bookings",
        "description": "Lists the bookings within a trip.",
        "operationId": "listTripBookings",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "nullable": true
            }
          },
          {
            "name": "trip_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page with a list of bookings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_Booking_"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "OAuth2": [
              "travel.trips",
              "travel.trips.readonly"
            ]
          }
        ]
      }
    },
    "/v1/trips/{trip_id}/bookings/{booking_id}": {
      "get": {
        "tags": [
          "Trips"
        ],
        "summary": "Get booking",
        "description": "Retrieves a booking by trip and booking ID.",
        "operationId": "getBooking",
        "parameters": [
          {
            "name": "trip_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "booking_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The booking that was retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Booking"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "OAuth2": [
              "travel.trips",
              "travel.trips.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Address": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string",
            "description": "The country where the address is located. May be an alpha-2 code, an alpha-3 code, or the full name of the country.",
            "nullable": true,
            "example": "Brazil"
          },
          "administrative_area": {
            "type": "string",
            "description": "Depending on the country, this can be a state, a province, or something equivalent to those. May be an abbreviation or the full name.",
            "nullable": true,
            "example": "RJ"
          },
          "city": {
            "type": "string",
            "description": "The city where the address is located.",
            "nullable": true,
            "example": "Rio de Janeiro"
          },
          "postal_code": {
            "type": "string",
            "description": "The postal code of the given address.",
            "nullable": true,
            "example": "21941-900"
          },
          "address_line_1": {
            "type": "string",
            "description": "The first line of the address.",
            "nullable": true,
            "example": "Av. Vinte de Janeiro, S/N"
          },
          "address_line_2": {
            "type": "string",
            "description": "The second line of the address.",
            "nullable": true,
            "example": "Ilha do Governador"
          },
          "coordinates": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address.GeoCoordinates"
              },
              {
                "description": "The coordinates of the address.",
                "nullable": true
              }
            ]
          },
          "timezone": {
            "type": "string",
            "description": "The timezone in the given address.",
            "nullable": true,
            "example": "America/Sao_Paulo"
          }
        },
        "description": "A location. All fields are optional, but the object will hold as much information as possible."
      },
      "Address.GeoCoordinates": {
        "required": [
          "latitude",
          "longitude"
        ],
        "type": "object",
        "properties": {
          "latitude": {
            "type": "number",
            "format": "double",
            "example": -22.8145373
          },
          "longitude": {
            "type": "number",
            "format": "double",
            "example": -43.2465548
          }
        },
        "description": "The coordinates of an address."
      },
      "AirBookingData": {
        "required": [
          "journeys",
          "tickets"
        ],
        "type": "object",
        "properties": {
          "journeys": {
            "type": "array",
            "description": "The journeys that make up this booking.",
            "items": {
              "$ref": "#/components/schemas/AirBookingData.Journey"
            }
          },
          "tickets": {
            "type": "array",
            "description": "The flight tickets in this booking.",
            "items": {
              "$ref": "#/components/schemas/AirBookingData.FlightTicket"
            }
          },
          "redress_number": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AirBookingData.DocumentNumber"
              },
              {
                "description": "The Redress Number associated with this booking.",
                "nullable": true
              }
            ]
          },
          "known_traveler_number": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AirBookingData.DocumentNumber"
              },
              {
                "description": "The Known Traveler Number associated with this booking.",
                "nullable": true
              }
            ]
          },
          "type": {
            "type": "string"
          }
        },
        "description": "Air-specific booking information."
      },
      "AirBookingData.CabinClass": {
        "type": "string",
        "description": "The cabin class of a flight.",
        "example": "ECONOMY",
        "enum": [
          "ECONOMY",
          "PREMIUM_ECONOMY",
          "BUSINESS",
          "FIRST"
        ]
      },
      "AirBookingData.DocumentNumber": {
        "required": [
          "document_number",
          "issuing_country"
        ],
        "type": "object",
        "properties": {
          "issuing_country": {
            "type": "string",
            "description": "The country that issued this document.",
            "example": "BR"
          },
          "document_number": {
            "type": "string",
            "description": "The actual document number.",
            "example": "1231231"
          }
        },
        "description": "A document number such as a redress number or a known traveler number."
      },
      "AirBookingData.Flight": {
        "required": [
          "arrival_time",
          "departure_time",
          "destination",
          "origin"
        ],
        "type": "object",
        "properties": {
          "origin": {
            "$ref": "#/components/schemas/AirBookingData.FlightEndpoint"
          },
          "destination": {
            "$ref": "#/components/schemas/AirBookingData.FlightEndpoint"
          },
          "departure_time": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Booking.Time"
              },
              {
                "description": "The time when the flight departs the origin."
              }
            ]
          },
          "arrival_time": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Booking.Time"
              },
              {
                "description": "The time when the flight arrives at the destination."
              }
            ]
          },
          "duration": {
            "type": "string",
            "description": "The duration of the flight in the ISO 8601 PnYnMnDTnHnMnS format.",
            "nullable": true,
            "example": "PT4h20M"
          },
          "confirmation_code": {
            "type": "string",
            "description": "The airline confirmation code.",
            "nullable": true,
            "example": "PWZRTQ"
          },
          "cabin_class": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AirBookingData.CabinClass"
              },
              {
                "description": "The cabin class for this flight.",
                "nullable": true
              }
            ]
          },
          "marketing_flight": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AirBookingData.FlightNumber"
              },
              {
                "description": "The marketing flight number. Some flights are sold by one airline, but operated by another in the same alliance. This is the flight that was originally sold.",
                "nullable": true
              }
            ]
          },
          "operating_flight": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AirBookingData.FlightNumber"
              },
              {
                "description": "The operating flight number. Some flights are sold by one airline, but operated by another in the same alliance. This is the flight the traveler is actually taking.",
                "nullable": true
              }
            ]
          },
          "seat": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AirBookingData.FlightSeat"
              },
              {
                "description": "The seat reserved for this flight.",
                "nullable": true
              }
            ]
          }
        },
        "description": "A flight taken by the traveler."
      },
      "AirBookingData.FlightEndpoint": {
        "required": [
          "airport_code"
        ],
        "type": "object",
        "properties": {
          "airport_code": {
            "pattern": "[A-Z]{3}",
            "type": "string",
            "description": "The 3-letter IATA code of the airport.",
            "example": "GIG"
          },
          "terminal": {
            "type": "string",
            "description": "The terminal name and/or number.",
            "nullable": true,
            "example": "T2"
          },
          "gate": {
            "type": "string",
            "description": "The gate for boarding or leaving the plane.",
            "nullable": true,
            "example": "B13"
          },
          "airport_location": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              },
              {
                "description": "The location of the airport.",
                "nullable": true
              }
            ]
          }
        },
        "description": "The place where a flight departs from or arrives at."
      },
      "AirBookingData.FlightNumber": {
        "required": [
          "airline_code",
          "number"
        ],
        "type": "object",
        "properties": {
          "airline_code": {
            "pattern": "[0-9A-Z]{2}",
            "type": "string",
            "description": "The IATA code for the airline.",
            "example": "G3"
          },
          "number": {
            "pattern": "\\d{1,4}",
            "type": "string",
            "description": "The number of the flight.",
            "example": "1234"
          },
          "airline_name": {
            "type": "string",
            "description": "The name of the airline.",
            "nullable": true,
            "example": "GOL Linhas Aereas S.A."
          }
        },
        "description": "The flight number, including carrier information."
      },
      "AirBookingData.FlightSeat": {
        "required": [
          "number"
        ],
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "description": "The seat number.",
            "example": "31D"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AirBookingData.FlightSeatStatus"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "description": "Seat information in a flight."
      },
      "AirBookingData.FlightSeatStatus": {
        "type": "string",
        "description": "The status of a flight seat.",
        "example": "CONFIRMED",
        "enum": [
          "PENDING",
          "CONFIRMED",
          "CANCELED"
        ]
      },
      "AirBookingData.FlightTicket": {
        "required": [
          "number"
        ],
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "description": "The ticket number provided by the airline.",
            "example": "0017959463925"
          },
          "issue_date": {
            "type": "string",
            "description": "The date when the ticket was issued.",
            "format": "date",
            "nullable": true,
            "example": "2017-12-27"
          }
        },
        "description": "A flight ticket."
      },
      "AirBookingData.Journey": {
        "required": [
          "flights",
          "status"
        ],
        "type": "object",
        "properties": {
          "flights": {
            "type": "array",
            "description": "The flights that make up this journey.",
            "items": {
              "$ref": "#/components/schemas/AirBookingData.Flight"
            }
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BookingStatus"
              },
              {
                "description": "The status of this specific journey."
              }
            ]
          },
          "cabin_display_name": {
            "type": "string",
            "description": "The cabin name as shown by the airline.",
            "nullable": true,
            "example": "Flexible Economy"
          }
        },
        "description": "A journey is composed of one or more flight segments that take a passenger from an origin to a final destination. E.g. if a traveler is doing a round trip from GIG to SFO, but they need to make a connection in IAH in each direction, the booking will contain 2 journeys. The first will contain 2 segments: GIG > IAH, and IAH > SFO. The second journey will also contain 2 segments: SFO > IAH, and IAH > GIG."
      },
      "Booking": {
        "required": [
          "booking_data",
          "created_at",
          "id",
          "source",
          "status",
          "trip_id",
          "type",
          "updated_at",
          "version"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the booking.",
            "example": "booking_cl9t5dnu800040m3071dandeq"
          },
          "created_at": {
            "type": "string",
            "description": "The time when the booking was created.",
            "format": "date-time",
            "example": "2017-12-27T15:42:30Z"
          },
          "updated_at": {
            "type": "string",
            "description": "The time when the booking was last updated.",
            "format": "date-time",
            "example": "2017-12-27T15:42:30Z"
          },
          "trip_id": {
            "type": "string",
            "description": "The ID of the trip to which this booking belongs.",
            "example": "trip_cl9rh1n8g001e0j84w6fb4fd1"
          },
          "version": {
            "minimum": 1,
            "type": "integer",
            "description": "The current version of the booking.",
            "format": "int32",
            "example": 2
          },
          "type": {
            "$ref": "#/components/schemas/Booking.Type"
          },
          "status": {
            "$ref": "#/components/schemas/BookingStatus"
          },
          "source": {
            "$ref": "#/components/schemas/Booking.Source"
          },
          "booking_data": {
            "$ref": "#/components/schemas/Booking.Data"
          }
        },
        "description": "A booking representation."
      },
      "Booking.Data": {
        "type": "object",
        "description": "Type-specific booking data.",
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "LODGING": "#/components/schemas/LodgingBookingData",
            "RAIL": "#/components/schemas/RailBookingData",
            "CAR_RENTAL": "#/components/schemas/CarRentalBookingData",
            "AIR": "#/components/schemas/AirBookingData"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/AirBookingData"
          },
          {
            "$ref": "#/components/schemas/CarRentalBookingData"
          },
          {
            "$ref": "#/components/schemas/LodgingBookingData"
          },
          {
            "$ref": "#/components/schemas/RailBookingData"
          }
        ]
      },
      "Booking.Source": {
        "type": "string",
        "description": "The original source of a booking:\n  * `BREX_TRAVEL` - The booking was created via Brex Travel.\n  * `EXTERNAL` - The booking was manually inserted, e.g. a hotel room block for a group event.",
        "example": "BREX_TRAVEL",
        "enum": [
          "BREX_TRAVEL",
          "EXTERNAL"
        ]
      },
      "Booking.Time": {
        "required": [
          "local_time"
        ],
        "type": "object",
        "properties": {
          "local_time": {
            "type": "string",
            "description": "The local time in the relevant location in the ISO 8601 format.",
            "format": "date-time"
          },
          "timestamp": {
            "type": "string",
            "description": "An ISO 8601 timestamp.",
            "format": "date-time",
            "nullable": true,
            "example": "2017-12-27T15:42:30Z"
          }
        },
        "description": "A time within a booking, including local time in the relevant location, and a timestamp when possible."
      },
      "Booking.Type": {
        "type": "string",
        "description": "The type of a booking.",
        "example": "AIR",
        "enum": [
          "AIR",
          "CAR_RENTAL",
          "LODGING",
          "RAIL"
        ]
      },
      "BookingStatus": {
        "type": "string",
        "description": "The status of the booking:\n  * `HOLD` - The booking is a hold, and may be canceled without being charged.\n  * `PENDING` - Some action needs to be completed before the booking is confirmed. Usually the action is the payment being confirmed.\n  * `CONFIRMED` - The booking is confirmed.\n  * `COMPLETED` - The booking has already happened.\n  * `CANCELED` - The booking has been canceled.\n  * `IN_PROGRESS` - The booking is currently in progress.\n  * `REFUNDED` - A refund has been issued. It may or may not be a full refund.\n  * `VOIDED` - Voided is similar to (and can be treated the same as) canceled.\n  * `PROCESSING` - The booking has been created or changed, but confirmation from the vendor has not been received yet.\n  * `UNCONFIRMED` - The booking was in the `PROCESSING` state for too long and some action is probably required to get this booking confirmed.\n  * `AIRLINE_CONTROL` - The airline has taken control of the booking and further updates may not be visible.\n  * `PAYMENT_DECLINED` - The payment for the booking has failed.\n  * `SCHEDULE_CHANGE` - Some change has happened to the booking schedule, e.g. the flight getting canceled and the passenger reallocated to another flight. Travel support should reach out to confirm the traveler accepts the new schedule.\n  * `APPROVAL_REQUESTED` - The booking is subject to approval, and it is waiting for a review.\n  * `APPROVAL_DENIED` - A reviewer has denied the booking, or the deadline to approve the booking has passed and it got canceled.\n  * `CANCELLATION_IN_PROGRESS` - The booking is currently being canceled.",
        "example": "CONFIRMED",
        "enum": [
          "HOLD",
          "PENDING",
          "CONFIRMED",
          "COMPLETED",
          "CANCELED",
          "IN_PROGRESS",
          "REFUNDED",
          "VOIDED",
          "PROCESSING",
          "UNCONFIRMED",
          "AIRLINE_CONTROL",
          "PAYMENT_DECLINED",
          "SCHEDULE_CHANGE",
          "APPROVAL_REQUESTED",
          "APPROVAL_DENIED",
          "CANCELLATION_IN_PROGRESS"
        ]
      },
      "CarRentalBookingData": {
        "required": [
          "car_details",
          "reservation_details"
        ],
        "type": "object",
        "properties": {
          "car_details": {
            "$ref": "#/components/schemas/CarRentalBookingData.CarDetails"
          },
          "reservation_details": {
            "$ref": "#/components/schemas/CarRentalBookingData.ReservationDetails"
          },
          "type": {
            "type": "string"
          }
        },
        "description": "Car rental-specific booking information."
      },
      "CarRentalBookingData.CarClass": {
        "type": "string",
        "description": "The kind of car.",
        "example": "INTERMEDIATE",
        "enum": [
          "ECONOMY",
          "COMPACT",
          "INTERMEDIATE",
          "PREMIUM",
          "LUXURY",
          "CONVERTIBLE",
          "COMPACT_SUV",
          "INTERMEDIATE_SUV",
          "PREMIUM_SUV",
          "LUXURY_SUV",
          "MINI_VAN",
          "PASSENGER_VAN",
          "PICKUP_TRUCK",
          "HYBRID",
          "ELECTRIC",
          "MINI",
          "STANDARD",
          "FULL_SIZE",
          "SUV",
          "SPORTS",
          "SPECIAL",
          "RECREATIONAL_VEHICLE",
          "OTHER"
        ]
      },
      "CarRentalBookingData.CarDetails": {
        "required": [
          "display_name"
        ],
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "description": "The name of the car as displayed to the user.",
            "example": "Intermediate car"
          },
          "car_class": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CarRentalBookingData.CarClass"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "description": "Information on a rental car."
      },
      "CarRentalBookingData.RentalEndpoint": {
        "required": [
          "location",
          "time"
        ],
        "type": "object",
        "properties": {
          "location": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              },
              {
                "description": "The location where the car can be picked up or where it must be returned."
              }
            ]
          },
          "time": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Booking.Time"
              },
              {
                "description": "The time when the car will be available for pickup or by when it must be returned."
              }
            ]
          }
        },
        "description": "Information about the car pickup or drop-off."
      },
      "CarRentalBookingData.ReservationDetails": {
        "required": [
          "drop_off",
          "pickup"
        ],
        "type": "object",
        "properties": {
          "confirmation_code": {
            "type": "string",
            "description": "The confirmation code given by the vendor.",
            "nullable": true,
            "example": "7003XBQ504"
          },
          "pickup": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CarRentalBookingData.RentalEndpoint"
              },
              {
                "description": "Information on the car pickup."
              }
            ]
          },
          "drop_off": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CarRentalBookingData.RentalEndpoint"
              },
              {
                "description": "Information on the car return."
              }
            ]
          },
          "rental_company": {
            "type": "string",
            "description": "Name of car rental company.",
            "nullable": true,
            "example": "Catch-A-Ride"
          }
        },
        "description": "Information on a car reservation such as pickup, drop-off, etc."
      },
      "LodgingBookingData": {
        "required": [
          "lodging_details",
          "reservation_details"
        ],
        "type": "object",
        "properties": {
          "lodging_details": {
            "$ref": "#/components/schemas/LodgingBookingData.LodgingDetails"
          },
          "reservation_details": {
            "$ref": "#/components/schemas/LodgingBookingData.ReservationDetails"
          },
          "type": {
            "type": "string"
          }
        },
        "description": "Lodging-specific booking information."
      },
      "LodgingBookingData.ContactInfo": {
        "type": "object",
        "properties": {
          "phone": {
            "type": "string",
            "description": "The phone number of the venue.",
            "nullable": true,
            "example": 12345554321
          },
          "fax": {
            "type": "string",
            "description": "The fax number of the venue.",
            "nullable": true,
            "example": 12345554321
          },
          "email": {
            "type": "string",
            "description": "The email address of the venue.",
            "nullable": true,
            "example": "city@hotelchain.com"
          }
        },
        "description": "Contact information of a venue."
      },
      "LodgingBookingData.LodgingDetails": {
        "required": [
          "display_name"
        ],
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "description": "The name of the venue as displayed to the user.",
            "example": "Fancy Hotel"
          },
          "contact_information": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LodgingBookingData.ContactInfo"
              },
              {
                "nullable": true
              }
            ]
          },
          "star_rating": {
            "type": "number",
            "description": "The star rating of the hotel. Some hotels have half stars.",
            "format": "float",
            "nullable": true,
            "example": 3.5
          },
          "brand_name": {
            "type": "string",
            "description": "The brand name of the hotel.",
            "nullable": true,
            "example": "Marriott Hotels"
          },
          "chain_name": {
            "type": "string",
            "description": "The name of the hotel chain.",
            "nullable": true,
            "example": "Accor Hotels"
          },
          "location": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              },
              {
                "description": "The location of the hotel.",
                "nullable": true
              }
            ]
          }
        },
        "description": "Information on a lodging venue."
      },
      "LodgingBookingData.ReservationDetails": {
        "required": [
          "check_in_time",
          "checkout_time"
        ],
        "type": "object",
        "properties": {
          "confirmation_code": {
            "type": "string",
            "description": "Confirmation code provided by the vendor.",
            "nullable": true,
            "example": "7003XBQ504"
          },
          "check_in_time": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Booking.Time"
              },
              {
                "description": "The time when check-in will be available."
              }
            ]
          },
          "checkout_time": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Booking.Time"
              },
              {
                "description": "The time limit for checkout."
              }
            ]
          },
          "room": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LodgingBookingData.Room"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "description": "Information on a reservation such as check-in, checkout, etc."
      },
      "LodgingBookingData.Room": {
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "description": "The name of the room as displayed to the user.",
            "nullable": true,
            "example": "Standard room"
          },
          "description": {
            "type": "string",
            "description": "A description of the room.",
            "nullable": true,
            "example": "Superior room"
          },
          "bed_type": {
            "type": "string",
            "description": "The kind of bed.",
            "nullable": true,
            "example": "DOUBLE"
          },
          "bed_count": {
            "type": "integer",
            "description": "The number of beds.",
            "format": "int32",
            "nullable": true,
            "example": 1
          }
        },
        "description": "Information on a room that was booked."
      },
      "Page_Booking_": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "next_cursor": {
            "type": "string",
            "nullable": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Booking"
            }
          }
        }
      },
      "Page_Trip_": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "next_cursor": {
            "type": "string",
            "nullable": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Trip"
            }
          }
        }
      },
      "RailBookingData": {
        "required": [
          "journeys"
        ],
        "type": "object",
        "properties": {
          "journeys": {
            "type": "array",
            "description": "The journeys that make up this booking.",
            "items": {
              "$ref": "#/components/schemas/RailBookingData.RailJourney"
            }
          },
          "type": {
            "type": "string"
          }
        },
        "description": "Rail-specific booking information."
      },
      "RailBookingData.RailClass": {
        "type": "string",
        "description": "The class of travel for a rail leg.",
        "example": "SLEEPER",
        "enum": [
          "FIRST",
          "STANDARD",
          "BUSINESS",
          "SLEEPER",
          "STANDARD_PREMIUM",
          "BUSINESS_PREMIUM",
          "COACH",
          "ROOM",
          "EXECUTIVE"
        ]
      },
      "RailBookingData.RailJourney": {
        "required": [
          "legs"
        ],
        "type": "object",
        "properties": {
          "legs": {
            "type": "array",
            "description": "The legs that make up this journey.",
            "items": {
              "$ref": "#/components/schemas/RailBookingData.RailLeg"
            }
          }
        },
        "description": "A journey is composed of the legs that take a passenger from an origin to a final destination. E.g. if a traveler is going from Aberdeen to London, but they need to change trains in Edinburgh, the booking will contain 1 journey composed of 2 legs. The first leg is Aberdeen to Edinburgh, and the second is Edinburgh to London."
      },
      "RailBookingData.RailLeg": {
        "required": [
          "arrival_time",
          "departure_time",
          "destination",
          "origin"
        ],
        "type": "object",
        "properties": {
          "origin": {
            "$ref": "#/components/schemas/RailBookingData.RailStation"
          },
          "destination": {
            "$ref": "#/components/schemas/RailBookingData.RailStation"
          },
          "departure_time": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Booking.Time"
              },
              {
                "description": "The time when the leg starts."
              }
            ]
          },
          "arrival_time": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Booking.Time"
              },
              {
                "description": "The time when the leg ends."
              }
            ]
          },
          "duration": {
            "type": "string",
            "description": "PT4h20M",
            "nullable": true,
            "example": "PT4h20M"
          },
          "vehicle": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RailBookingData.Vehicle"
              },
              {
                "description": "The vehicle that will be used in this leg.",
                "nullable": true
              }
            ]
          },
          "seat": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RailBookingData.RailSeat"
              },
              {
                "description": "The seat that has been reserved for this leg.",
                "nullable": true
              }
            ]
          },
          "rail_class": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RailBookingData.RailClass"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "description": "A leg is a portion of the journey between two consecutive stops."
      },
      "RailBookingData.RailSeat": {
        "type": "object",
        "properties": {
          "coach_number": {
            "type": "string",
            "description": "The number of the coach.",
            "nullable": true,
            "example": "12"
          },
          "seat_number": {
            "type": "string",
            "description": "The number of the seat.",
            "nullable": true,
            "example": "41"
          }
        },
        "description": "A seat in a train leg."
      },
      "RailBookingData.RailStation": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the station.",
            "nullable": true,
            "example": "London - King's Cross"
          },
          "location": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              },
              {
                "description": "The location of the station.",
                "nullable": true
              }
            ]
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RailBookingData.RailStationType"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "description": "An endpoint in a rail leg."
      },
      "RailBookingData.RailStationType": {
        "type": "string",
        "description": "The kind of station. Some rail itineraries include taking a bus or walking between stations, and these are represented as legs in the journey.\n  * `INDIVIDUAL` - A regular train station.\n  * `GROUP` - Stations grouped together, usually in a major European city. E.g. \"London, Any\".\n  * `METRO` - A metro/subway station.\n  * `BUS_STOP` - A bus stop.\n  * `FERRY_TERMINAL` - A ferry terminal.",
        "example": "INDIVIDUAL",
        "enum": [
          "INDIVIDUAL",
          "GROUP",
          "METRO",
          "BUS_STOP",
          "FERRY_TERMINAL"
        ]
      },
      "RailBookingData.Vehicle": {
        "type": "object",
        "properties": {
          "carrier": {
            "type": "string",
            "description": "The carrier that operates this leg. E.g. Amtrak, Thameslink.",
            "nullable": true,
            "example": "Amtrak"
          },
          "timetable_id": {
            "type": "string",
            "description": "The timetable ID for the vehicle. The concept is similar to a flight number.",
            "nullable": true,
            "example": "L79727"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RailBookingData.VehicleType"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "description": "A vehicle used in a train leg. Some rail itineraries include taking a bus or walking between stations, and these are represented as legs in the journey."
      },
      "RailBookingData.VehicleType": {
        "type": "string",
        "description": "The kind of vehicle to be used in a leg. Some rail itineraries include taking a bus or walking between stations, and these are represented as legs in the journey.\n  * `TRAIN` - A regular train.\n  * `BUS` - A bus.\n  * `FERRY` - A ferry.\n  * `WALK`- Walking between stations.\n  * `TAXI` - A taxi between stations.\n  * `TRAM` - Tram/light rail.\n  * `METRO` - Metro/subway.\n  * `TUBE` - London underground.",
        "example": "TRAIN",
        "enum": [
          "TRAIN",
          "BUS",
          "FERRY",
          "WALK",
          "TAXI",
          "TRAM",
          "METRO",
          "TUBE"
        ]
      },
      "Traveler": {
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/Traveler.Type"
          },
          "name": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Traveler.Name"
              },
              {
                "nullable": true
              }
            ]
          },
          "guest_email": {
            "type": "string",
            "description": "If the traveler is a guest, this is their email.",
            "nullable": true,
            "example": "guest@gmail.com"
          },
          "user_id": {
            "type": "string",
            "description": "If the traveler is an employee, this is their user ID.",
            "nullable": true,
            "example": "cuuser_cky0xs54b004h01pidi0pcuz1"
          }
        },
        "description": "Information on the person who will be traveling."
      },
      "Traveler.Name": {
        "type": "object",
        "properties": {
          "first_name": {
            "type": "string",
            "description": "The traveler's first name.",
            "example": "John"
          },
          "middle_name": {
            "type": "string",
            "description": "The traveler's middle name.",
            "nullable": true,
            "example": "Paul"
          },
          "last_name": {
            "type": "string",
            "description": "The traveler's last name.",
            "example": "Doe"
          },
          "suffix": {
            "type": "string",
            "description": "The suffix in the traveler's name.",
            "nullable": true,
            "example": "Jr."
          }
        },
        "description": "The name of the traveler."
      },
      "Traveler.Type": {
        "type": "string",
        "description": "Whether the trip is for an employee or a guest.",
        "example": "EMPLOYEE",
        "enum": [
          "EMPLOYEE",
          "GUEST"
        ]
      },
      "Trip": {
        "required": [
          "booker_user_id",
          "created_at",
          "id",
          "status",
          "updated_at",
          "version"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the trip.",
            "example": "trip_cl9rh1n8g001e0j84w6fb4fd1"
          },
          "created_at": {
            "type": "string",
            "description": "The time when the trip was created.",
            "format": "date-time",
            "example": "2017-12-27T15:42:30Z"
          },
          "updated_at": {
            "type": "string",
            "description": "The time when the latest trip update happened.",
            "format": "date-time",
            "example": "2017-12-27T15:42:30Z"
          },
          "name": {
            "maxLength": 100,
            "type": "string",
            "description": "The name of the trip as seen in the dashboard.",
            "nullable": true,
            "example": "Trip to Rio de Janeiro"
          },
          "booker_user_id": {
            "type": "string",
            "description": "The ID of the user who booked the trip. If the trip was created on copilot mode, this will be the ID of the user on behalf of whom the trip was booked.",
            "example": "cuuser_cky0xs54b004h01pidi0pcuz1"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Trip.Status"
              },
              {
                "description": "The current status of the trip."
              }
            ]
          },
          "traveler": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Traveler"
              },
              {
                "description": "Information on the person who will be traveling.",
                "nullable": true
              }
            ]
          },
          "version": {
            "minimum": 1,
            "type": "integer",
            "description": "The current version of the trip.",
            "format": "int32",
            "example": 2
          },
          "billable_at": {
            "type": "string",
            "description": "The time when the trip became billable. If absent, the trip is currently not billable.",
            "format": "date-time",
            "nullable": true,
            "example": "2017-12-27T15:42:30Z"
          },
          "starts_at": {
            "type": "string",
            "description": "The time when the first booking in the trip starts.",
            "format": "date-time",
            "nullable": true,
            "example": "2017-12-27T15:42:30Z"
          },
          "ends_at": {
            "type": "string",
            "description": "The time when the last booking in the trip ends.",
            "format": "date-time",
            "nullable": true,
            "example": "2017-12-27T15:42:30Z"
          }
        },
        "description": "A trip representation."
      },
      "Trip.Status": {
        "type": "string",
        "description": "The current status of a trip.",
        "example": "UPCOMING",
        "enum": [
          "PENDING",
          "UPCOMING",
          "IN_PROGRESS",
          "COMPLETED",
          "CANCELED",
          "REFUNDED",
          "VOIDED",
          "DRAFT",
          "DELETED",
          "INVITED",
          "PROCESSING",
          "UNCONFIRMED",
          "AIRLINE_CONTROL",
          "PAYMENT_DECLINED",
          "SCHEDULE_CHANGE",
          "HOLD",
          "APPROVAL_REQUESTED",
          "APPROVAL_DENIED",
          "CANCELLATION_IN_PROGRESS"
        ]
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "description": "OAuth2 security scheme",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://accounts-api.brex.com/oauth2/default/v1/authorize",
            "tokenUrl": "https://accounts-api.brex.com/oauth2/default/v1/token",
            "scopes": {
              "openid": "openid",
              "offline_access": "offline access"
            }
          }
        }
      },
      "oAuth2ClientCredentials": {
        "type": "oauth2",
        "description": "\nRefer to [these](https://developer.brex.com/docs/onboarding_examples/) docs on how to use client credentials \n",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://accounts-api.brex.com/oauth2/default/v1/token",
            "scopes": {
              "openid": "openid",
              "offline_access": "offline access"
            }
          }
        }
      }
    }
  },
  "x-explorer-enabled": false
}