Skip to content

Brex: Get booking

Brex travel.travelGetBooking: arguments, response, policy and SDK examples.

← Travel operations · Get started

Operation brex.travel_getbooking

Provider route: GET /v1/trips/{trip_id}/bookings/{booking_id}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/brex with npm, or alter-sdk-brex with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { BrexIntegration } from "@alter-ai/brex";
async function execute(input: Parameters<BrexIntegration["travel"]["travelGetBooking"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new BrexIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.travel.travelGetBooking(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_brex import BrexIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = BrexIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.travel.travel_get_booking(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.trip_idstringRequired within parent
path.booking_idstringRequired within parent
queryobjectOptionalAdditional keys: not allowed
query.load_custom_fieldsJSONOptional
query.load_custom_fields (anyOf 1)booleanAlternative
query.load_custom_fields (anyOf 2)nullAlternative

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get booking — response body

Referenced models: Get booking — response body

51 more schemas are linked from the tables above, on the schema pages.

Get booking — response body
FieldTypePresenceDescription and constraints
$objectRootA booking representation.
booking_dataModelRequired within parentExpand Get booking — response body — booking data
booking_referenceJSONOptional
booking_reference (anyOf 1)stringAlternativeThe booking reference number shown in the dashboard and used when contacting Brex Support. This is the reference from the travel provider, not the Brex internal booking ID. May be null if the booking has no associated reference.
booking_reference (anyOf 2)nullAlternative
created_atstringRequired within parentThe time when the booking was created.
Format: date-time
custom_fieldsJSONOptional
custom_fields (anyOf 1)arrayAlternativeCustom field values associated with this resource.
custom_fields (anyOf 1)[]ModelEach itemExpand Get trip — response body — custom fields Custom field values associated with this resource item
custom_fields (anyOf 2)nullAlternative
idstringRequired within parentThe ID of the booking.
policyJSONOptional
policy (anyOf 1)JSONAlternativeThe result of evaluating the customer's travel policy against this booking, as shown to the traveler when the booking was made. Mirrors the policy information available in the booking export. May be null when no policy was evaluated for the booking.
policy (anyOf 1) (allOf 1)ModelAll variants applyExpand Get booking — response body — policy out of policy, violations out of policy, violations
policy (anyOf 2)nullAlternative
sourcestringRequired within parentThe 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.
Known values: BREX_TRAVEL, EXTERNAL
statusModelRequired within parentExpand Get booking — response body — status
trip_idstringRequired within parentThe ID of the trip to which this booking belongs.
trip_referenceJSONOptional
trip_reference (anyOf 1)stringAlternativeThe trip reference number shown in the dashboard and used when contacting Brex Support. This is the reference from the travel provider, not the Brex internal trip ID. May be null if the trip has no associated reference.
trip_reference (anyOf 2)nullAlternative
typestringRequired within parentThe type of a booking.
Known values: AIR, CAR_RENTAL, LODGING, RAIL
updated_atstringRequired within parentThe time when the booking was last updated.
Format: date-time
versionJSONRequired within parent
version (anyOf 1)integerAlternativeThe current version of the booking.
Format: int32
Minimum: 1
version (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Get booking — response body — booking data, Get booking — response body — policy out of policy, violations out of policy, violations, Get booking — response body — status, Get trip — response body — custom fields Custom field values associated with this resource item

Get booking — response body — booking data
FieldTypePresenceDescription and constraints
$objectRootType-specific booking data.
discriminator: {"mapping": {"AIR": "#/components/schemas/travel__AirBookingData", "CAR_RENTAL": "#/components/schemas/travel__CarRentalBookingData", "LODGING": "#/components/schemas/travel__LodgingBookingData", "RAIL": "#/components/schemas/travel__RailBookingData"}, "propertyName": "type"}
$ (anyOf 1)ModelAlternativeExpand Get booking — response body — booking data Air-specific booking information
$ (anyOf 2)ModelAlternativeExpand Get booking — response body — booking data Car rental-specific booking information
$ (anyOf 3)ModelAlternativeExpand Get booking — response body — booking data Lodging-specific booking information
$ (anyOf 4)ModelAlternativeExpand Get booking — response body — booking data Rail-specific booking information

Referenced models: Get booking — response body — booking data Air-specific booking information, Get booking — response body — booking data Car rental-specific booking information, Get booking — response body — booking data Lodging-specific booking information, Get booking — response body — booking data Rail-specific booking information

Get booking — response body — policy out of policy, violations out of policy, violations
FieldTypePresenceDescription and constraints
$objectRootThe result of evaluating the customer's travel policy against this booking, as shown to the traveler when the booking was made. Mirrors the policy information available in the booking export. May be null when no policy was evaluated for the booking.
out_of_policybooleanRequired within parentWhether the booking is out of policy, i.e. at least one travel policy rule was broken.
violationsarrayOptionalThe specific travel policy rules that this booking violated. Empty when the booking is in policy.
violations[]ModelEach itemExpand Get booking — response body — policy out of policy, violations out of policy, violations violations item

Referenced models: Get booking — response body — policy out of policy, violations out of policy, violations violations item

Get booking — response body — status
FieldTypePresenceDescription and constraints
$stringRootThe 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.
Known values: HOLD, PENDING, CONFIRMED, COMPLETED, CANCELED, IN_PROGRESS, REFUNDED, VOIDED, PROCESSING, UNCONFIRMED, AIRLINE_CONTROL, PAYMENT_DECLINED, SCHEDULE_CHANGE, APPROVAL_REQUESTED, APPROVAL_DENIED, CANCELLATION_IN_PROGRESS
Get booking — response body — booking data Air-specific booking information
FieldTypePresenceDescription and constraints
$objectRootAir-specific booking information.
journeysarrayRequired within parentThe journeys that make up this booking.
journeys[]ModelEach itemExpand Get booking — response body — booking data Air-specific booking information journeys item
known_traveler_numberJSONOptional
known_traveler_number (anyOf 1)JSONAlternative
known_traveler_number (anyOf 1) (allOf 1)ModelAll variants applyExpand Get booking — response body — booking data Air-specific booking information known traveler number document number, issuing country document number, issuing country
known_traveler_number (anyOf 1) (allOf 2)JSONAll variants applyThe Known Traveler Number associated with this booking.
known_traveler_number (anyOf 2)nullAlternative
redress_numberJSONOptional
redress_number (anyOf 1)JSONAlternative
redress_number (anyOf 1) (allOf 1)ModelAll variants applyExpand Get booking — response body — booking data Air-specific booking information known traveler number document number, issuing country document number, issuing country
redress_number (anyOf 1) (allOf 2)JSONAll variants applyThe Redress Number associated with this booking.
redress_number (anyOf 2)nullAlternative
ticketsarrayRequired within parentThe flight tickets in this booking.
tickets[]ModelEach itemExpand Get booking — response body — booking data Air-specific booking information tickets item
typestringOptional

Referenced models: Get booking — response body — booking data Air-specific booking information known traveler number document number, issuing country document number, issuing country, Get booking — response body — booking data Air-specific booking information tickets item, Get booking — response body — booking data Air-specific booking information journeys item

SDK function policy ID: brex.travel_getbooking. Catalog operation: travel:getBooking. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["travel.trips", "travel.trips.readonly"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.