Brex Travel External API.
Travel API (1.0)
- Productionhttps://api.brex.com/v1/trips
- Staging (Note: This is not a sandbox. It will not work with customer tokens.)https://api-staging.brex.com/v1/trips
- curl
- JavaScript
- Node.js
- Python
- Ruby
- Java
curl -i -X GET \
https://api.brex.com/v1/trips \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'A page with a list of trips.
The time when the trip was created.
The time when the latest trip update happened.
The name of the trip as seen in the dashboard.
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.
The current status of a trip.
The time when the trip became billable. If absent, the trip is currently not billable.
The time when the first booking in the trip starts.
{ "next_cursor": "string", "items": [ { … } ] }
- Productionhttps://api.brex.com/v1/trips/{trip_id}
- Staging (Note: This is not a sandbox. It will not work with customer tokens.)https://api-staging.brex.com/v1/trips/{trip_id}
- curl
- JavaScript
- Node.js
- Python
- Ruby
- Java
curl -i -X GET \
'https://api.brex.com/v1/trips/{trip_id}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'The trip that was retrieved.
The time when the trip was created.
The time when the latest trip update happened.
The name of the trip as seen in the dashboard.
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.
The current status of a trip.
The time when the trip became billable. If absent, the trip is currently not billable.
The time when the first booking in the trip starts.
{ "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" }
- Productionhttps://api.brex.com/v1/trips/{trip_id}/bookings
- Staging (Note: This is not a sandbox. It will not work with customer tokens.)https://api-staging.brex.com/v1/trips/{trip_id}/bookings
- curl
- JavaScript
- Node.js
- Python
- Ruby
- Java
curl -i -X GET \
'https://api.brex.com/v1/trips/{trip_id}/bookings' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'A page with a list of bookings.
The time when the booking was created.
The time when the booking was last updated.
The ID of the trip to which this booking belongs.
The type of a booking.
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 thePROCESSINGstate 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.
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.
Type-specific booking data.
Information on a lodging venue.
The name of the venue as displayed to the user.
Contact information of a venue.
The star rating of the hotel. Some hotels have half stars.
The brand name of the hotel.
The name of the hotel chain.
Information on a reservation such as check-in, checkout, etc.
Confirmation code provided by the vendor.
A time within a booking, including local time in the relevant location, and a timestamp when possible.
The local time in the relevant location in the ISO 8601 format.
A time within a booking, including local time in the relevant location, and a timestamp when possible.
The local time in the relevant location in the ISO 8601 format.
{ "next_cursor": "string", "items": [ { … } ] }
- Productionhttps://api.brex.com/v1/trips/{trip_id}/bookings/{booking_id}
- Staging (Note: This is not a sandbox. It will not work with customer tokens.)https://api-staging.brex.com/v1/trips/{trip_id}/bookings/{booking_id}
- curl
- JavaScript
- Node.js
- Python
- Ruby
- Java
curl -i -X GET \
'https://api.brex.com/v1/trips/{trip_id}/bookings/{booking_id}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'The booking that was retrieved.
The time when the booking was created.
The time when the booking was last updated.
The ID of the trip to which this booking belongs.
The type of a booking.
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 thePROCESSINGstate 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.
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.
Type-specific booking data.
Information on a lodging venue.
The name of the venue as displayed to the user.
The star rating of the hotel. Some hotels have half stars.
The brand name of the hotel.
The name of the hotel chain.
Information on a reservation such as check-in, checkout, etc.
Confirmation code provided by the vendor.
A time within a booking, including local time in the relevant location, and a timestamp when possible.
A time within a booking, including local time in the relevant location, and a timestamp when possible.
{ "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" } }