Skip to content

Travel API (1.0)

Brex Travel External API.

Download OpenAPI description
Languages
Servers
Production
https://api.brex.com
Staging (Note: This is not a sandbox. It will not work with customer tokens.)
https://api-staging.brex.com

Endpoints for getting trip data.

Operations

Request

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

Security
OAuth2(Required scopes:
travel.trips
travel.trips.readonly
)
Query
cursorstring or null
limitinteger or null(int64)
last_updated_afterstring or null(date-time)
curl -i -X GET \
  https://api.brex.com/v1/trips \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

A page with a list of trips.

Bodyapplication/json
next_cursorstring or null
itemsArray of objects(Trip)required
items[].​idstringrequired

The ID of the trip.

Example: "trip_cl9rh1n8g001e0j84w6fb4fd1"
items[].​created_atstring(date-time)required

The time when the trip was created.

Example: "2017-12-27T15:42:30Z"
items[].​updated_atstring(date-time)required

The time when the latest trip update happened.

Example: "2017-12-27T15:42:30Z"
items[].​namestring or null<= 100 characters

The name of the trip as seen in the dashboard.

Example: "Trip to Rio de Janeiro"
items[].​booker_user_idstringrequired

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"
items[].​statusstringrequired

The current status of a trip.

Enum"PENDING""UPCOMING""IN_PROGRESS""COMPLETED""CANCELED""REFUNDED""VOIDED""DRAFT""DELETED""INVITED"
Example: "UPCOMING"
items[].​travelerobject or null

Information on the person who will be traveling.

items[].​versioninteger(int32)>= 1required

The current version of the trip.

Example: 2
items[].​billable_atstring or null(date-time)

The time when the trip became billable. If absent, the trip is currently not billable.

Example: "2017-12-27T15:42:30Z"
items[].​starts_atstring or null(date-time)

The time when the first booking in the trip starts.

Example: "2017-12-27T15:42:30Z"
items[].​ends_atstring or null(date-time)

The time when the last booking in the trip ends.

Example: "2017-12-27T15:42:30Z"
Response
application/json
{ "next_cursor": "string", "items": [ {} ] }

Request

Retrieves a trip by ID.

Security
OAuth2(Required scopes:
travel.trips
travel.trips.readonly
)
Path
trip_idstringrequired
curl -i -X GET \
  'https://api.brex.com/v1/trips/{trip_id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

The trip that was retrieved.

Bodyapplication/json
idstringrequired

The ID of the trip.

Example: "trip_cl9rh1n8g001e0j84w6fb4fd1"
created_atstring(date-time)required

The time when the trip was created.

Example: "2017-12-27T15:42:30Z"
updated_atstring(date-time)required

The time when the latest trip update happened.

Example: "2017-12-27T15:42:30Z"
namestring or null<= 100 characters

The name of the trip as seen in the dashboard.

Example: "Trip to Rio de Janeiro"
booker_user_idstringrequired

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"
statusstringrequired

The current status of a trip.

Enum"PENDING""UPCOMING""IN_PROGRESS""COMPLETED""CANCELED""REFUNDED""VOIDED""DRAFT""DELETED""INVITED"
Example: "UPCOMING"
travelerobject or null

Information on the person who will be traveling.

versioninteger(int32)>= 1required

The current version of the trip.

Example: 2
billable_atstring or null(date-time)

The time when the trip became billable. If absent, the trip is currently not billable.

Example: "2017-12-27T15:42:30Z"
starts_atstring or null(date-time)

The time when the first booking in the trip starts.

Example: "2017-12-27T15:42:30Z"
ends_atstring or null(date-time)

The time when the last booking in the trip ends.

Example: "2017-12-27T15:42:30Z"
Response
application/json
{ "id": "trip_cl9rh1n8g001e0j84w6fb4fd1", "created_at": "2017-12-27T15:42:30Z", "updated_at": "2017-12-27T15:42:30Z", "name": "Trip to Rio de Janeiro", "booker_user_id": "cuuser_cky0xs54b004h01pidi0pcuz1", "status": "string", "traveler": { "type": "EMPLOYEE", "name": {}, "guest_email": "guest@gmail.com", "user_id": "cuuser_cky0xs54b004h01pidi0pcuz1" }, "version": 2, "billable_at": "2017-12-27T15:42:30Z", "starts_at": "2017-12-27T15:42:30Z", "ends_at": "2017-12-27T15:42:30Z" }

Request

Lists the bookings within a trip.

Security
OAuth2(Required scopes:
travel.trips
travel.trips.readonly
)
Path
trip_idstringrequired
Query
cursorstring or null
limitinteger or null(int64)
curl -i -X GET \
  'https://api.brex.com/v1/trips/{trip_id}/bookings' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

A page with a list of bookings.

Bodyapplication/json
next_cursorstring or null
itemsArray of objects(Booking)required
items[].​idstringrequired

The ID of the booking.

Example: "booking_cl9t5dnu800040m3071dandeq"
items[].​created_atstring(date-time)required

The time when the booking was created.

Example: "2017-12-27T15:42:30Z"
items[].​updated_atstring(date-time)required

The time when the booking was last updated.

Example: "2017-12-27T15:42:30Z"
items[].​trip_idstringrequired

The ID of the trip to which this booking belongs.

Example: "trip_cl9rh1n8g001e0j84w6fb4fd1"
items[].​versioninteger(int32)>= 1required

The current version of the booking.

Example: 2
items[].​typestring(Booking.Type)required

The type of a booking.

Enum"AIR""CAR_RENTAL""LODGING""RAIL"
Example: "AIR"
items[].​statusstring(BookingStatus)required

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.
Enum"HOLD""PENDING""CONFIRMED""COMPLETED""CANCELED""IN_PROGRESS""REFUNDED""VOIDED""PROCESSING""UNCONFIRMED"
Example: "CONFIRMED"
items[].​sourcestring(Booking.Source)required

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.
Enum"BREX_TRAVEL""EXTERNAL"
Example: "BREX_TRAVEL"
items[].​booking_dataobject(Booking.Data)required

Type-specific booking data.

items[].​booking_data.​lodging_detailsobject(LodgingBookingData.LodgingDetails)required

Information on a lodging venue.

items[].​booking_data.​lodging_details.​display_namestringrequired

The name of the venue as displayed to the user.

Example: "Fancy Hotel"
items[].​booking_data.​lodging_details.​contact_informationobject or null

Contact information of a venue.

items[].​booking_data.​lodging_details.​star_ratingnumber or null(float)

The star rating of the hotel. Some hotels have half stars.

Example: 3.5
items[].​booking_data.​lodging_details.​brand_namestring or null

The brand name of the hotel.

Example: "Marriott Hotels"
items[].​booking_data.​lodging_details.​chain_namestring or null

The name of the hotel chain.

Example: "Accor Hotels"
items[].​booking_data.​lodging_details.​locationobject or null

A location. All fields are optional, but the object will hold as much information as possible.

items[].​booking_data.​reservation_detailsobject(LodgingBookingData.ReservationDetails)required

Information on a reservation such as check-in, checkout, etc.

items[].​booking_data.​reservation_details.​confirmation_codestring or null

Confirmation code provided by the vendor.

Example: "7003XBQ504"
items[].​booking_data.​reservation_details.​check_in_timeobjectrequired

A time within a booking, including local time in the relevant location, and a timestamp when possible.

items[].​booking_data.​reservation_details.​check_in_time.​local_timestring(date-time)required

The local time in the relevant location in the ISO 8601 format.

items[].​booking_data.​reservation_details.​check_in_time.​timestampstring or null(date-time)

An ISO 8601 timestamp.

Example: "2017-12-27T15:42:30Z"
items[].​booking_data.​reservation_details.​checkout_timeobjectrequired

A time within a booking, including local time in the relevant location, and a timestamp when possible.

items[].​booking_data.​reservation_details.​checkout_time.​local_timestring(date-time)required

The local time in the relevant location in the ISO 8601 format.

items[].​booking_data.​reservation_details.​checkout_time.​timestampstring or null(date-time)

An ISO 8601 timestamp.

Example: "2017-12-27T15:42:30Z"
items[].​booking_data.​reservation_details.​roomobject or null

Information on a room that was booked.

items[].​booking_data.​typestring
Discriminator
Response
application/json
{ "next_cursor": "string", "items": [ {} ] }

Request

Retrieves a booking by trip and booking ID.

Security
OAuth2(Required scopes:
travel.trips
travel.trips.readonly
)
Path
trip_idstringrequired
booking_idstringrequired
curl -i -X GET \
  'https://api.brex.com/v1/trips/{trip_id}/bookings/{booking_id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

The booking that was retrieved.

Bodyapplication/json
idstringrequired

The ID of the booking.

Example: "booking_cl9t5dnu800040m3071dandeq"
created_atstring(date-time)required

The time when the booking was created.

Example: "2017-12-27T15:42:30Z"
updated_atstring(date-time)required

The time when the booking was last updated.

Example: "2017-12-27T15:42:30Z"
trip_idstringrequired

The ID of the trip to which this booking belongs.

Example: "trip_cl9rh1n8g001e0j84w6fb4fd1"
versioninteger(int32)>= 1required

The current version of the booking.

Example: 2
typestring(Booking.Type)required

The type of a booking.

Enum"AIR""CAR_RENTAL""LODGING""RAIL"
Example: "AIR"
statusstring(BookingStatus)required

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.
Enum"HOLD""PENDING""CONFIRMED""COMPLETED""CANCELED""IN_PROGRESS""REFUNDED""VOIDED""PROCESSING""UNCONFIRMED"
Example: "CONFIRMED"
sourcestring(Booking.Source)required

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.
Enum"BREX_TRAVEL""EXTERNAL"
Example: "BREX_TRAVEL"
booking_dataobject(Booking.Data)required

Type-specific booking data.

booking_data.​lodging_detailsobject(LodgingBookingData.LodgingDetails)required

Information on a lodging venue.

booking_data.​lodging_details.​display_namestringrequired

The name of the venue as displayed to the user.

Example: "Fancy Hotel"
booking_data.​lodging_details.​contact_informationobject or null

Contact information of a venue.

booking_data.​lodging_details.​star_ratingnumber or null(float)

The star rating of the hotel. Some hotels have half stars.

Example: 3.5
booking_data.​lodging_details.​brand_namestring or null

The brand name of the hotel.

Example: "Marriott Hotels"
booking_data.​lodging_details.​chain_namestring or null

The name of the hotel chain.

Example: "Accor Hotels"
booking_data.​lodging_details.​locationobject or null

A location. All fields are optional, but the object will hold as much information as possible.

booking_data.​reservation_detailsobject(LodgingBookingData.ReservationDetails)required

Information on a reservation such as check-in, checkout, etc.

booking_data.​reservation_details.​confirmation_codestring or null

Confirmation code provided by the vendor.

Example: "7003XBQ504"
booking_data.​reservation_details.​check_in_timeobjectrequired

A time within a booking, including local time in the relevant location, and a timestamp when possible.

booking_data.​reservation_details.​check_in_time.​local_timestring(date-time)required

The local time in the relevant location in the ISO 8601 format.

booking_data.​reservation_details.​check_in_time.​timestampstring or null(date-time)

An ISO 8601 timestamp.

Example: "2017-12-27T15:42:30Z"
booking_data.​reservation_details.​checkout_timeobjectrequired

A time within a booking, including local time in the relevant location, and a timestamp when possible.

booking_data.​reservation_details.​checkout_time.​local_timestring(date-time)required

The local time in the relevant location in the ISO 8601 format.

booking_data.​reservation_details.​checkout_time.​timestampstring or null(date-time)

An ISO 8601 timestamp.

Example: "2017-12-27T15:42:30Z"
booking_data.​reservation_details.​roomobject or null

Information on a room that was booked.

booking_data.​typestring
Discriminator
Response
application/json
{ "id": "booking_cl9t5dnu800040m3071dandeq", "created_at": "2017-12-27T15:42:30Z", "updated_at": "2017-12-27T15:42:30Z", "trip_id": "trip_cl9rh1n8g001e0j84w6fb4fd1", "version": 2, "type": "AIR", "status": "CONFIRMED", "source": "BREX_TRAVEL", "booking_data": { "journeys": [], "tickets": [], "redress_number": {}, "known_traveler_number": {}, "type": "string" } }