Skip to content

Trips

Defined in: src/travel/client.gen.ts:8

new Trips(_core): Trips

Defined in: src/travel/client.gen.ts:9

BrexCore

Trips

get(tripId, options?): Promise<{ billable_at?: string | null; booker_user_id: string; created_at: string; ends_at?: string | null; id: string; name?: string | null; starts_at?: string | null; status: "DELETED" | "INVITED" | "PROCESSING" | "CANCELED" | "REFUNDED" | "DRAFT" | "IN_PROGRESS" | "APPROVAL_DENIED" | "PENDING" | "HOLD" | "COMPLETED" | "VOIDED" | "UNCONFIRMED" | "AIRLINE_CONTROL" | "PAYMENT_DECLINED" | "SCHEDULE_CHANGE" | "APPROVAL_REQUESTED" | "CANCELLATION_IN_PROGRESS" | "UPCOMING"; traveler?: { guest_email?: string | null; name?: { first_name?: string; last_name?: string; middle_name?: string | null; suffix?: string | null; }; type: "EMPLOYEE" | "GUEST"; user_id?: string | null; }; updated_at: string; version: number; }>

Defined in: src/travel/client.gen.ts:18

Get trip

Retrieves a trip by ID.

GET /v1/trips/{trip_id} — requires OAuth scope: travel.trips, travel.trips.readonly

string

RequestOptions

Promise<{ billable_at?: string | null; booker_user_id: string; created_at: string; ends_at?: string | null; id: string; name?: string | null; starts_at?: string | null; status: "DELETED" | "INVITED" | "PROCESSING" | "CANCELED" | "REFUNDED" | "DRAFT" | "IN_PROGRESS" | "APPROVAL_DENIED" | "PENDING" | "HOLD" | "COMPLETED" | "VOIDED" | "UNCONFIRMED" | "AIRLINE_CONTROL" | "PAYMENT_DECLINED" | "SCHEDULE_CHANGE" | "APPROVAL_REQUESTED" | "CANCELLATION_IN_PROGRESS" | "UPCOMING"; traveler?: { guest_email?: string | null; name?: { first_name?: string; last_name?: string; middle_name?: string | null; suffix?: string | null; }; type: "EMPLOYEE" | "GUEST"; user_id?: string | null; }; updated_at: string; version: number; }>


getBooking(tripId, bookingId, options?): Promise<{ booking_data: { journeys: object[]; known_traveler_number?: { document_number: string; issuing_country: string; }; redress_number?: { document_number: string; issuing_country: string; }; tickets: object[]; type: "AIR"; } | { car_details: { car_class?: "OTHER" | "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"; display_name: string; }; reservation_details: { confirmation_code?: string | null; drop_off: { location: { address_line_1?: string | null; address_line_2?: string | null; administrative_area?: string | null; city?: string | null; coordinates?: { latitude: number; longitude: number; }; country?: string | null; postal_code?: string | null; timezone?: string | null; }; time: { local_time: string; timestamp?: string | null; }; }; pickup: { location: { address_line_1?: string | null; address_line_2?: string | null; administrative_area?: string | null; city?: string | null; coordinates?: { latitude: number; longitude: number; }; country?: string | null; postal_code?: string | null; timezone?: string | null; }; time: { local_time: string; timestamp?: string | null; }; }; rental_company?: string | null; }; type: "CAR_RENTAL"; } | { lodging_details: { brand_name?: string | null; chain_name?: string | null; contact_information?: { email?: string | null; fax?: string | null; phone?: string | null; }; display_name: string; location?: { address_line_1?: string | null; address_line_2?: string | null; administrative_area?: string | null; city?: string | null; coordinates?: { latitude: number; longitude: number; }; country?: string | null; postal_code?: string | null; timezone?: string | null; }; star_rating?: number | null; }; reservation_details: { check_in_time: { local_time: string; timestamp?: string | null; }; checkout_time: { local_time: string; timestamp?: string | null; }; confirmation_code?: string | null; room?: { bed_count?: number | null; bed_type?: string | null; description?: string | null; display_name?: string | null; }; }; type: "LODGING"; } | { journeys: object[]; type: "RAIL"; }; created_at: string; id: string; source: "BREX_TRAVEL" | "EXTERNAL"; status: "PROCESSING" | "CANCELED" | "REFUNDED" | "IN_PROGRESS" | "APPROVAL_DENIED" | "PENDING" | "CONFIRMED" | "HOLD" | "COMPLETED" | "VOIDED" | "UNCONFIRMED" | "AIRLINE_CONTROL" | "PAYMENT_DECLINED" | "SCHEDULE_CHANGE" | "APPROVAL_REQUESTED" | "CANCELLATION_IN_PROGRESS"; trip_id: string; type: "CAR_RENTAL" | "LODGING" | "AIR" | "RAIL"; updated_at: string; version: number; }>

Defined in: src/travel/client.gen.ts:36

Get booking

Retrieves a booking by trip and booking ID.

GET /v1/trips/{trip_id}/bookings/{booking_id} — requires OAuth scope: travel.trips, travel.trips.readonly

string

string

RequestOptions

Promise<{ booking_data: { journeys: object[]; known_traveler_number?: { document_number: string; issuing_country: string; }; redress_number?: { document_number: string; issuing_country: string; }; tickets: object[]; type: "AIR"; } | { car_details: { car_class?: "OTHER" | "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"; display_name: string; }; reservation_details: { confirmation_code?: string | null; drop_off: { location: { address_line_1?: string | null; address_line_2?: string | null; administrative_area?: string | null; city?: string | null; coordinates?: { latitude: number; longitude: number; }; country?: string | null; postal_code?: string | null; timezone?: string | null; }; time: { local_time: string; timestamp?: string | null; }; }; pickup: { location: { address_line_1?: string | null; address_line_2?: string | null; administrative_area?: string | null; city?: string | null; coordinates?: { latitude: number; longitude: number; }; country?: string | null; postal_code?: string | null; timezone?: string | null; }; time: { local_time: string; timestamp?: string | null; }; }; rental_company?: string | null; }; type: "CAR_RENTAL"; } | { lodging_details: { brand_name?: string | null; chain_name?: string | null; contact_information?: { email?: string | null; fax?: string | null; phone?: string | null; }; display_name: string; location?: { address_line_1?: string | null; address_line_2?: string | null; administrative_area?: string | null; city?: string | null; coordinates?: { latitude: number; longitude: number; }; country?: string | null; postal_code?: string | null; timezone?: string | null; }; star_rating?: number | null; }; reservation_details: { check_in_time: { local_time: string; timestamp?: string | null; }; checkout_time: { local_time: string; timestamp?: string | null; }; confirmation_code?: string | null; room?: { bed_count?: number | null; bed_type?: string | null; description?: string | null; display_name?: string | null; }; }; type: "LODGING"; } | { journeys: object[]; type: "RAIL"; }; created_at: string; id: string; source: "BREX_TRAVEL" | "EXTERNAL"; status: "PROCESSING" | "CANCELED" | "REFUNDED" | "IN_PROGRESS" | "APPROVAL_DENIED" | "PENDING" | "CONFIRMED" | "HOLD" | "COMPLETED" | "VOIDED" | "UNCONFIRMED" | "AIRLINE_CONTROL" | "PAYMENT_DECLINED" | "SCHEDULE_CHANGE" | "APPROVAL_REQUESTED" | "CANCELLATION_IN_PROGRESS"; trip_id: string; type: "CAR_RENTAL" | "LODGING" | "AIR" | "RAIL"; updated_at: string; version: number; }>


list(query?, options?): PagePromise<{ items: object[]; next_cursor?: string | null; }>

Defined in: src/travel/client.gen.ts:60

List trips

Lists trips according to the filters passed in the query string.

GET /v1/trips — requires OAuth scope: travel.trips, travel.trips.readonly Await for a single page, or for await to iterate items across all pages.

string | null

string | null

number | null

RequestOptions

PagePromise<{ items: object[]; next_cursor?: string | null; }>


listBookings(tripId, query?, options?): PagePromise<{ items: object[]; next_cursor?: string | null; }>

Defined in: src/travel/client.gen.ts:77

List trip bookings

Lists the bookings within a trip.

GET /v1/trips/{trip_id}/bookings — requires OAuth scope: travel.trips, travel.trips.readonly Await for a single page, or for await to iterate items across all pages.

string

string | null

number | null

RequestOptions

PagePromise<{ items: object[]; next_cursor?: string | null; }>