/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ export interface paths { '/v1/trips': { /** * List trips * @description Lists trips according to the filters passed in the query string. */ get: operations['listTrips'] } '/v1/trips/{trip_id}': { /** * Get trip * @description Retrieves a trip by ID. */ get: operations['getTrip'] } '/v1/trips/{trip_id}/bookings': { /** * List trip bookings * @description Lists the bookings within a trip. */ get: operations['listTripBookings'] } '/v1/trips/{trip_id}/bookings/{booking_id}': { /** * Get booking * @description Retrieves a booking by trip and booking ID. */ get: operations['getBooking'] } } export type webhooks = Record export interface components { schemas: { /** @description A location. All fields are optional, but the object will hold as much information as possible. */ Address: { /** * @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. * @example Brazil */ country?: string | null /** * @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. * @example RJ */ administrative_area?: string | null /** * @description The city where the address is located. * @example Rio de Janeiro */ city?: string | null /** * @description The postal code of the given address. * @example 21941-900 */ postal_code?: string | null /** * @description The first line of the address. * @example Av. Vinte de Janeiro, S/N */ address_line_1?: string | null /** * @description The second line of the address. * @example Ilha do Governador */ address_line_2?: string | null coordinates?: components['schemas']['Address.GeoCoordinates'] /** * @description The timezone in the given address. * @example America/Sao_Paulo */ timezone?: string | null } /** @description The coordinates of an address. */ 'Address.GeoCoordinates': { /** * Format: double * @example -22.8145373 */ latitude: number /** * Format: double * @example -43.2465548 */ longitude: number } /** @description Air-specific booking information. */ AirBookingData: { /** @description The journeys that make up this booking. */ journeys: components['schemas']['AirBookingData.Journey'][] /** @description The flight tickets in this booking. */ tickets: components['schemas']['AirBookingData.FlightTicket'][] redress_number?: components['schemas']['AirBookingData.DocumentNumber'] known_traveler_number?: components['schemas']['AirBookingData.DocumentNumber'] type?: string } /** * @description The cabin class of a flight. * @example ECONOMY * @enum {string} */ 'AirBookingData.CabinClass': | 'ECONOMY' | 'PREMIUM_ECONOMY' | 'BUSINESS' | 'FIRST' /** @description A document number such as a redress number or a known traveler number. */ 'AirBookingData.DocumentNumber': { /** * @description The country that issued this document. * @example BR */ issuing_country: string /** * @description The actual document number. * @example 1231231 */ document_number: string } /** @description A flight taken by the traveler. */ 'AirBookingData.Flight': { origin: components['schemas']['AirBookingData.FlightEndpoint'] destination: components['schemas']['AirBookingData.FlightEndpoint'] departure_time: components['schemas']['Booking.Time'] arrival_time: components['schemas']['Booking.Time'] /** * @description The duration of the flight in the ISO 8601 PnYnMnDTnHnMnS format. * @example PT4h20M */ duration?: string | null /** * @description The airline confirmation code. * @example PWZRTQ */ confirmation_code?: string | null cabin_class?: components['schemas']['AirBookingData.CabinClass'] marketing_flight?: components['schemas']['AirBookingData.FlightNumber'] operating_flight?: components['schemas']['AirBookingData.FlightNumber'] seat?: components['schemas']['AirBookingData.FlightSeat'] } /** @description The place where a flight departs from or arrives at. */ 'AirBookingData.FlightEndpoint': { /** * @description The 3-letter IATA code of the airport. * @example GIG */ airport_code: string /** * @description The terminal name and/or number. * @example T2 */ terminal?: string | null /** * @description The gate for boarding or leaving the plane. * @example B13 */ gate?: string | null airport_location?: components['schemas']['Address'] } /** @description The flight number, including carrier information. */ 'AirBookingData.FlightNumber': { /** * @description The IATA code for the airline. * @example G3 */ airline_code: string /** * @description The number of the flight. * @example 1234 */ number: string /** * @description The name of the airline. * @example GOL Linhas Aereas S.A. */ airline_name?: string | null } /** @description Seat information in a flight. */ 'AirBookingData.FlightSeat': { /** * @description The seat number. * @example 31D */ number: string status?: components['schemas']['AirBookingData.FlightSeatStatus'] } /** * @description The status of a flight seat. * @example CONFIRMED * @enum {string} */ 'AirBookingData.FlightSeatStatus': 'PENDING' | 'CONFIRMED' | 'CANCELED' /** @description A flight ticket. */ 'AirBookingData.FlightTicket': { /** * @description The ticket number provided by the airline. * @example 0017959463925 */ number: string /** * Format: date * @description The date when the ticket was issued. * @example 2017-12-27 */ issue_date?: string | null } /** @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. */ 'AirBookingData.Journey': { /** @description The flights that make up this journey. */ flights: components['schemas']['AirBookingData.Flight'][] status: components['schemas']['BookingStatus'] /** * @description The cabin name as shown by the airline. * @example Flexible Economy */ cabin_display_name?: string | null } /** @description A booking representation. */ Booking: { /** * @description The ID of the booking. * @example booking_cl9t5dnu800040m3071dandeq */ id: string /** * Format: date-time * @description The time when the booking was created. * @example 2017-12-27T15:42:30Z */ created_at: string /** * Format: date-time * @description The time when the booking was last updated. * @example 2017-12-27T15:42:30Z */ updated_at: string /** * @description The ID of the trip to which this booking belongs. * @example trip_cl9rh1n8g001e0j84w6fb4fd1 */ trip_id: string /** * Format: int32 * @description The current version of the booking. * @example 2 */ version: number type: components['schemas']['Booking.Type'] status: components['schemas']['BookingStatus'] source: components['schemas']['Booking.Source'] booking_data: components['schemas']['Booking.Data'] } /** @description Type-specific booking data. */ 'Booking.Data': | components['schemas']['AirBookingData'] | components['schemas']['CarRentalBookingData'] | components['schemas']['LodgingBookingData'] | components['schemas']['RailBookingData'] /** * @description The original source of a booking: * * `BREX_TRAVEL` - The booking was created via Brex Travel. * * `EXTERNAL` - The booking was manually inserted, e.g. a hotel room block for a group event. * @example BREX_TRAVEL * @enum {string} */ 'Booking.Source': 'BREX_TRAVEL' | 'EXTERNAL' /** @description A time within a booking, including local time in the relevant location, and a timestamp when possible. */ 'Booking.Time': { /** * Format: date-time * @description The local time in the relevant location in the ISO 8601 format. */ local_time: string /** * Format: date-time * @description An ISO 8601 timestamp. * @example 2017-12-27T15:42:30Z */ timestamp?: string | null } /** * @description The type of a booking. * @example AIR * @enum {string} */ 'Booking.Type': 'AIR' | 'CAR_RENTAL' | 'LODGING' | 'RAIL' /** * @description The status of the booking: * * `HOLD` - The booking is a hold, and may be canceled without being charged. * * `PENDING` - Some action needs to be completed before the booking is confirmed. Usually the action is the payment being confirmed. * * `CONFIRMED` - The booking is confirmed. * * `COMPLETED` - The booking has already happened. * * `CANCELED` - The booking has been canceled. * * `IN_PROGRESS` - The booking is currently in progress. * * `REFUNDED` - A refund has been issued. It may or may not be a full refund. * * `VOIDED` - Voided is similar to (and can be treated the same as) canceled. * * `PROCESSING` - The booking has been created or changed, but confirmation from the vendor has not been received yet. * * `UNCONFIRMED` - The booking was in the `PROCESSING` state for too long and some action is probably required to get this booking confirmed. * * `AIRLINE_CONTROL` - The airline has taken control of the booking and further updates may not be visible. * * `PAYMENT_DECLINED` - The payment for the booking has failed. * * `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. * * `APPROVAL_REQUESTED` - The booking is subject to approval, and it is waiting for a review. * * `APPROVAL_DENIED` - A reviewer has denied the booking, or the deadline to approve the booking has passed and it got canceled. * * `CANCELLATION_IN_PROGRESS` - The booking is currently being canceled. * @example CONFIRMED * @enum {string} */ BookingStatus: | 'HOLD' | 'PENDING' | 'CONFIRMED' | 'COMPLETED' | 'CANCELED' | 'IN_PROGRESS' | 'REFUNDED' | 'VOIDED' | 'PROCESSING' | 'UNCONFIRMED' | 'AIRLINE_CONTROL' | 'PAYMENT_DECLINED' | 'SCHEDULE_CHANGE' | 'APPROVAL_REQUESTED' | 'APPROVAL_DENIED' | 'CANCELLATION_IN_PROGRESS' /** @description Car rental-specific booking information. */ CarRentalBookingData: { car_details: components['schemas']['CarRentalBookingData.CarDetails'] reservation_details: components['schemas']['CarRentalBookingData.ReservationDetails'] type?: string } /** * @description The kind of car. * @example INTERMEDIATE * @enum {string} */ 'CarRentalBookingData.CarClass': | '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' /** @description Information on a rental car. */ 'CarRentalBookingData.CarDetails': { /** * @description The name of the car as displayed to the user. * @example Intermediate car */ display_name: string car_class?: components['schemas']['CarRentalBookingData.CarClass'] } /** @description Information about the car pickup or drop-off. */ 'CarRentalBookingData.RentalEndpoint': { location: components['schemas']['Address'] time: components['schemas']['Booking.Time'] } /** @description Information on a car reservation such as pickup, drop-off, etc. */ 'CarRentalBookingData.ReservationDetails': { /** * @description The confirmation code given by the vendor. * @example 7003XBQ504 */ confirmation_code?: string | null pickup: components['schemas']['CarRentalBookingData.RentalEndpoint'] drop_off: components['schemas']['CarRentalBookingData.RentalEndpoint'] } /** @description Lodging-specific booking information. */ LodgingBookingData: { lodging_details: components['schemas']['LodgingBookingData.LodgingDetails'] reservation_details: components['schemas']['LodgingBookingData.ReservationDetails'] type?: string } /** @description Contact information of a venue. */ 'LodgingBookingData.ContactInfo': { /** * @description The phone number of the venue. * @example 12345554321 */ phone?: string | null /** * @description The fax number of the venue. * @example 12345554321 */ fax?: string | null /** * @description The email address of the venue. * @example city@hotelchain.com */ email?: string | null } /** @description Information on a lodging venue. */ 'LodgingBookingData.LodgingDetails': { /** * @description The name of the venue as displayed to the user. * @example Fancy Hotel */ display_name: string contact_information?: components['schemas']['LodgingBookingData.ContactInfo'] /** * Format: float * @description The star rating of the hotel. Some hotels have half stars. * @example 3.5 */ star_rating?: number | null /** * @description The brand name of the hotel. * @example Marriott Hotels */ brand_name?: string | null /** * @description The name of the hotel chain. * @example Accor Hotels */ chain_name?: string | null location?: components['schemas']['Address'] } /** @description Information on a reservation such as check-in, checkout, etc. */ 'LodgingBookingData.ReservationDetails': { /** * @description Confirmation code provided by the vendor. * @example 7003XBQ504 */ confirmation_code?: string | null check_in_time: components['schemas']['Booking.Time'] checkout_time: components['schemas']['Booking.Time'] room?: components['schemas']['LodgingBookingData.Room'] } /** @description Information on a room that was booked. */ 'LodgingBookingData.Room': { /** * @description The name of the room as displayed to the user. * @example Standard room */ display_name?: string | null /** * @description A description of the room. * @example Superior room */ description?: string | null /** * @description The kind of bed. * @example DOUBLE */ bed_type?: string | null /** * Format: int32 * @description The number of beds. * @example 1 */ bed_count?: number | null } Page_Booking_: { next_cursor?: string | null items: components['schemas']['Booking'][] } Page_Trip_: { next_cursor?: string | null items: components['schemas']['Trip'][] } /** @description Rail-specific booking information. */ RailBookingData: { /** @description The journeys that make up this booking. */ journeys: components['schemas']['RailBookingData.RailJourney'][] type?: string } /** * @description The class of travel for a rail leg. * @example SLEEPER * @enum {string} */ 'RailBookingData.RailClass': | 'FIRST' | 'STANDARD' | 'BUSINESS' | 'SLEEPER' | 'STANDARD_PREMIUM' | 'BUSINESS_PREMIUM' | 'COACH' | 'ROOM' | 'EXECUTIVE' /** @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.RailJourney': { /** @description The legs that make up this journey. */ legs: components['schemas']['RailBookingData.RailLeg'][] } /** @description A leg is a portion of the journey between two consecutive stops. */ 'RailBookingData.RailLeg': { origin: components['schemas']['RailBookingData.RailStation'] destination: components['schemas']['RailBookingData.RailStation'] departure_time: components['schemas']['Booking.Time'] arrival_time: components['schemas']['Booking.Time'] /** * @description PT4h20M * @example PT4h20M */ duration?: string | null vehicle?: components['schemas']['RailBookingData.Vehicle'] seat?: components['schemas']['RailBookingData.RailSeat'] rail_class?: components['schemas']['RailBookingData.RailClass'] } /** @description A seat in a train leg. */ 'RailBookingData.RailSeat': { /** * @description The number of the coach. * @example 12 */ coach_number?: string | null /** * @description The number of the seat. * @example 41 */ seat_number?: string | null } /** @description An endpoint in a rail leg. */ 'RailBookingData.RailStation': { /** * @description The name of the station. * @example London - King's Cross */ name?: string | null location?: components['schemas']['Address'] type?: components['schemas']['RailBookingData.RailStationType'] } /** * @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. * * `INDIVIDUAL` - A regular train station. * * `GROUP` - Stations grouped together, usually in a major European city. E.g. "London, Any". * * `METRO` - A metro/subway station. * * `BUS_STOP` - A bus stop. * * `FERRY_TERMINAL` - A ferry terminal. * @example INDIVIDUAL * @enum {string} */ 'RailBookingData.RailStationType': | 'INDIVIDUAL' | 'GROUP' | 'METRO' | 'BUS_STOP' | 'FERRY_TERMINAL' /** @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.Vehicle': { /** * @description The carrier that operates this leg. E.g. Amtrak, Thameslink. * @example Amtrak */ carrier?: string | null /** * @description The timetable ID for the vehicle. The concept is similar to a flight number. * @example L79727 */ timetable_id?: string | null type?: components['schemas']['RailBookingData.VehicleType'] } /** * @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. * * `TRAIN` - A regular train. * * `BUS` - A bus. * * `FERRY` - A ferry. * * `WALK`- Walking between stations. * * `TAXI` - A taxi between stations. * * `TRAM` - Tram/light rail. * * `METRO` - Metro/subway. * * `TUBE` - London underground. * @example TRAIN * @enum {string} */ 'RailBookingData.VehicleType': | 'TRAIN' | 'BUS' | 'FERRY' | 'WALK' | 'TAXI' | 'TRAM' | 'METRO' | 'TUBE' /** @description Information on the person who will be traveling. */ Traveler: { type: components['schemas']['Traveler.Type'] name?: components['schemas']['Traveler.Name'] /** * @description If the traveler is a guest, this is their email. * @example guest@gmail.com */ guest_email?: string | null /** * @description If the traveler is an employee, this is their user ID. * @example cuuser_cky0xs54b004h01pidi0pcuz1 */ user_id?: string | null } /** @description The name of the traveler. */ 'Traveler.Name': { /** * @description The traveler's first name. * @example John */ first_name?: string /** * @description The traveler's middle name. * @example Paul */ middle_name?: string | null /** * @description The traveler's last name. * @example Doe */ last_name?: string /** * @description The suffix in the traveler's name. * @example Jr. */ suffix?: string | null } /** * @description Whether the trip is for an employee or a guest. * @example EMPLOYEE * @enum {string} */ 'Traveler.Type': 'EMPLOYEE' | 'GUEST' /** @description A trip representation. */ Trip: { /** * @description The ID of the trip. * @example trip_cl9rh1n8g001e0j84w6fb4fd1 */ id: string /** * Format: date-time * @description The time when the trip was created. * @example 2017-12-27T15:42:30Z */ created_at: string /** * Format: date-time * @description The time when the latest trip update happened. * @example 2017-12-27T15:42:30Z */ updated_at: string /** * @description The name of the trip as seen in the dashboard. * @example Trip to Rio de Janeiro */ name?: string | null /** * @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 */ booker_user_id: string status: components['schemas']['Trip.Status'] traveler?: components['schemas']['Traveler'] /** * Format: int32 * @description The current version of the trip. * @example 2 */ version: number /** * Format: date-time * @description The time when the trip became billable. If absent, the trip is currently not billable. * @example 2017-12-27T15:42:30Z */ billable_at?: string | null /** * Format: date-time * @description The time when the first booking in the trip starts. * @example 2017-12-27T15:42:30Z */ starts_at?: string | null /** * Format: date-time * @description The time when the last booking in the trip ends. * @example 2017-12-27T15:42:30Z */ ends_at?: string | null } /** * @description The current status of a trip. * @example UPCOMING * @enum {string} */ 'Trip.Status': | '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' } responses: never parameters: never requestBodies: never headers: never pathItems: never } export type $defs = Record export type external = Record export interface operations { /** * List trips * @description Lists trips according to the filters passed in the query string. */ listTrips: { parameters: { query?: { cursor?: string | null limit?: number | null last_updated_after?: string | null } } responses: { /** @description A page with a list of trips. */ 200: { content: { 'application/json': components['schemas']['Page_Trip_'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } /** @description Internal server error */ 500: { content: never } } } /** * Get trip * @description Retrieves a trip by ID. */ getTrip: { parameters: { path: { trip_id: string } } responses: { /** @description The trip that was retrieved. */ 200: { content: { 'application/json': components['schemas']['Trip'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } /** @description Not Found */ 404: { content: never } /** @description Internal server error */ 500: { content: never } } } /** * List trip bookings * @description Lists the bookings within a trip. */ listTripBookings: { parameters: { query?: { cursor?: string | null limit?: number | null } path: { trip_id: string } } responses: { /** @description A page with a list of bookings. */ 200: { content: { 'application/json': components['schemas']['Page_Booking_'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } /** @description Not Found */ 404: { content: never } /** @description Internal server error */ 500: { content: never } } } /** * Get booking * @description Retrieves a booking by trip and booking ID. */ getBooking: { parameters: { path: { trip_id: string booking_id: string } } responses: { /** @description The booking that was retrieved. */ 200: { content: { 'application/json': components['schemas']['Booking'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } /** @description Not Found */ 404: { content: never } /** @description Internal server error */ 500: { content: never } } } } export interface oasTypes { components: components external: external operations: operations paths: paths webhooks: webhooks } export default oasTypes