Brex: List trip bookings
Brex travel.travelListTripBookings: arguments, response, policy and SDK examples.
← Travel operations · Get started
Operation brex.travel_listtripbookings
Provider route: GET /v1/trips/{trip_id}/bookings. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”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"]["travelListTripBookings"]>[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.travelListTripBookings(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom 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_list_trip_bookings(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.trip_id | string | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.cursor | JSON | Optional | |
query.cursor (anyOf 1) | string | Alternative | |
query.cursor (anyOf 2) | null | Alternative | |
query.limit | JSON | Optional | |
query.limit (anyOf 1) | integer | Alternative | Format: int64 |
query.limit (anyOf 2) | null | Alternative | |
query.load_custom_fields | JSON | Optional | |
query.load_custom_fields (anyOf 1) | boolean | Alternative | |
query.load_custom_fields (anyOf 2) | null | Alternative |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand List trip bookings — response body |
Referenced models: List trip bookings — response body
Schemas
Section titled “Schemas”50 more schemas are linked from the tables above, on the schema pages.
List trip bookings — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
items | array | Required within parent | |
items[] | Model | Each item | Expand Get booking — response body |
next_cursor | JSON | Optional | |
next_cursor (anyOf 1) | string | Alternative | |
next_cursor (anyOf 2) | null | Alternative |
Referenced models: Get booking — response body
Get booking — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A booking representation. |
booking_data | Model | Required within parent | Expand Get booking — response body — booking data |
booking_reference | JSON | Optional | |
booking_reference (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
created_at | string | Required within parent | The time when the booking was created. Format: date-time |
custom_fields | JSON | Optional | |
custom_fields (anyOf 1) | array | Alternative | Custom field values associated with this resource. |
custom_fields (anyOf 1)[] | Model | Each item | Expand Get trip — response body — custom fields Custom field values associated with this resource item |
custom_fields (anyOf 2) | null | Alternative | |
id | string | Required within parent | The ID of the booking. |
policy | JSON | Optional | |
policy (anyOf 1) | JSON | Alternative | The 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) | Model | All variants apply | Expand Get booking — response body — policy out of policy, violations out of policy, violations |
policy (anyOf 2) | null | Alternative | |
source | string | Required within parent | 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. Known values: BREX_TRAVEL, EXTERNAL |
status | Model | Required within parent | Expand Get booking — response body — status |
trip_id | string | Required within parent | The ID of the trip to which this booking belongs. |
trip_reference | JSON | Optional | |
trip_reference (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
type | string | Required within parent | The type of a booking. Known values: AIR, CAR_RENTAL, LODGING, RAIL |
updated_at | string | Required within parent | The time when the booking was last updated. Format: date-time |
version | JSON | Required within parent | |
version (anyOf 1) | integer | Alternative | The current version of the booking. Format: int32 Minimum: 1 |
version (anyOf 2) | string | Alternative | Pattern: ^-?[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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Type-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) | Model | Alternative | Expand Get booking — response body — booking data Air-specific booking information |
$ (anyOf 2) | Model | Alternative | Expand Get booking — response body — booking data Car rental-specific booking information |
$ (anyOf 3) | Model | Alternative | Expand Get booking — response body — booking data Lodging-specific booking information |
$ (anyOf 4) | Model | Alternative | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The 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_policy | boolean | Required within parent | Whether the booking is out of policy, i.e. at least one travel policy rule was broken. |
violations | array | Optional | The specific travel policy rules that this booking violated. Empty when the booking is in policy. |
violations[] | Model | Each item | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | 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. 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 Car rental-specific booking information
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Car rental-specific booking information. |
car_details | Model | Required within parent | Expand Get booking — response body — booking data Car rental-specific booking information car details |
reservation_details | Model | Required within parent | Expand Get booking — response body — booking data Car rental-specific booking information reservation details |
type | string | Optional |
Referenced models: Get booking — response body — booking data Car rental-specific booking information car details, Get booking — response body — booking data Car rental-specific booking information reservation details
Get booking — response body — booking data Rail-specific booking information
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Rail-specific booking information. |
journeys | array | Required within parent | The journeys that make up this booking. |
journeys[] | Model | Each item | Expand Get booking — response body — booking data Rail-specific booking information journeys item |
type | string | Optional |
Referenced models: Get booking — response body — booking data Rail-specific booking information journeys item
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: brex.travel_listtripbookings. Catalog operation: travel:listTripBookings. 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"]