Brex: Get trip
Brex travel.travelGetTrip: arguments, response, policy and SDK examples.
← Travel operations · Get started
Operation brex.travel_gettrip
Provider route: GET /v1/trips/{trip_id}. 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"]["travelGetTrip"]>[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.travelGetTrip(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_get_trip(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.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 Get trip — response body |
Referenced models: Get trip — response body
Schemas
Section titled “Schemas”19 more schemas are linked from the tables above, on the schema pages.
Get trip — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A trip representation. |
billable_at | JSON | Optional | |
billable_at (anyOf 1) | string | Alternative | The time when the trip became billable. If absent, the trip is currently not billable. Format: date-time |
billable_at (anyOf 2) | null | Alternative | |
booker_user_id | string | Required within parent | 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. |
created_at | string | Required within parent | The time when the trip 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 | |
ends_at | JSON | Optional | |
ends_at (anyOf 1) | string | Alternative | The time when the last booking in the trip ends. Format: date-time |
ends_at (anyOf 2) | null | Alternative | |
id | string | Required within parent | The ID of the trip. |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The name of the trip as seen in the dashboard. Maximum length: 100 |
name (anyOf 2) | null | Alternative | |
starts_at | JSON | Optional | |
starts_at (anyOf 1) | string | Alternative | The time when the first booking in the trip starts. Format: date-time |
starts_at (anyOf 2) | null | Alternative | |
status | JSON | Required within parent | |
status (allOf 1) | string | All variants apply | The current status of a trip. Known values: PENDING, UPCOMING, IN_PROGRESS, COMPLETED, CANCELED, REFUNDED, VOIDED, DRAFT, DELETED, PROCESSING, UNCONFIRMED, AIRLINE_CONTROL, PAYMENT_DECLINED, SCHEDULE_CHANGE, HOLD, APPROVAL_REQUESTED, APPROVAL_DENIED, CANCELLATION_IN_PROGRESS |
status (allOf 2) | JSON | All variants apply | The current status of the trip. |
traveler | JSON | Optional | |
traveler (anyOf 1) | JSON | Alternative | |
traveler (anyOf 1) (allOf 1) | Model | All variants apply | Expand Get trip — response body — traveler / type: EMPLOYEE, GUEST type: EMPLOYEE, GUEST |
traveler (anyOf 1) (allOf 2) | JSON | All variants apply | Information on the person who will be traveling. |
traveler (anyOf 2) | null | Alternative | |
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 | |
updated_at | string | Required within parent | The time when the latest trip update happened. Format: date-time |
version | JSON | Required within parent | |
version (anyOf 1) | integer | Alternative | The current version of the trip. Format: int32 Minimum: 1 |
version (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Referenced models: Get trip — response body — custom fields Custom field values associated with this resource item, Get trip — response body — traveler / type: EMPLOYEE, GUEST type: EMPLOYEE, GUEST
Get trip — response body — traveler / type: EMPLOYEE, GUEST type: EMPLOYEE, GUEST
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Information on the person who will be traveling. |
guest_email | JSON | Optional | |
guest_email (anyOf 1) | string | Alternative | If the traveler is a guest, this is their email. |
guest_email (anyOf 2) | null | Alternative | |
name | JSON | Optional | |
name (anyOf 1) | JSON | Alternative | |
name (anyOf 1) (allOf 1) | Model | All variants apply | Expand Get trip — response body — traveler / type: EMPLOYEE, GUEST type: EMPLOYEE, GUEST name The name of the traveler The name of the traveler |
name (anyOf 1) (allOf 2) | JSON | All variants apply | |
name (anyOf 2) | null | Alternative | |
type | string | Required within parent | Whether the trip is for an employee or a guest. Known values: EMPLOYEE, GUEST |
user_id | JSON | Optional | |
user_id (anyOf 1) | string | Alternative | If the traveler is an employee, this is their user ID. |
user_id (anyOf 2) | null | Alternative |
Referenced models: Get trip — response body — traveler / type: EMPLOYEE, GUEST type: EMPLOYEE, GUEST name The name of the traveler The name of the traveler
Get trip — response body — custom fields Custom field values associated with this resource item value The value of the custom field Boolean list value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Boolean list value for a custom field |
data | JSON | Optional | |
data (anyOf 1) | array | Alternative | |
data (anyOf 1)[] | boolean | Each item | The data of the custom field. |
data (anyOf 2) | null | Alternative | |
data_type | JSON | Required within parent | |
data_type (allOf 1) | string | All variants apply | The type of the custom field data. Known values: STRING, DECIMAL, BOOLEAN, ENUM, TIMESTAMP, DATE, MONEY, OPTION_STRING |
data_type (allOf 2) | JSON | All variants apply | The type of the custom field data. |
$ (allOf 1) | Model | All variants apply | Expand Get trip — response body — custom fields Custom field values associated with this resource item value The value of the custom field Date list value Base class for custom field values |
$ (allOf 2) | Model | All variants apply | Expand Get trip — response body — custom fields Custom field values associated with this resource item value Base class for custom field values |
Referenced models: Get trip — response body — custom fields Custom field values associated with this resource item value Base class for custom field values, Get trip — response body — custom fields Custom field values associated with this resource item value The value of the custom field Date list value Base class for custom field values
Get trip — response body — custom fields Custom field values associated with this resource item value The value of the custom field Boolean value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Boolean value for a custom field |
data | JSON | Optional | |
data (anyOf 1) | boolean | Alternative | The data of the custom field. |
data (anyOf 2) | null | Alternative | |
data_type | JSON | Required within parent | |
data_type (allOf 1) | string | All variants apply | The type of the custom field data. Known values: STRING, DECIMAL, BOOLEAN, ENUM, TIMESTAMP, DATE, MONEY, OPTION_STRING |
data_type (allOf 2) | JSON | All variants apply | The type of the custom field data. |
$ (allOf 1) | Model | All variants apply | Expand Get trip — response body — custom fields Custom field values associated with this resource item value The value of the custom field Date value Base class for custom field values |
$ (allOf 2) | Model | All variants apply | Expand Get trip — response body — custom fields Custom field values associated with this resource item value Base class for custom field values |
Referenced models: Get trip — response body — custom fields Custom field values associated with this resource item value Base class for custom field values, Get trip — response body — custom fields Custom field values associated with this resource item value The value of the custom field Date value Base class for custom field values
Get trip — response body — custom fields Custom field values associated with this resource item value Base class for custom field values
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Base class for custom field values |
data_type | JSON | Required within parent | |
data_type (allOf 1) | string | All variants apply | The type of the custom field data. Known values: STRING, DECIMAL, BOOLEAN, ENUM, TIMESTAMP, DATE, MONEY, OPTION_STRING |
data_type (allOf 2) | JSON | All variants apply | The type of the custom field data. |
value_type | JSON | Required within parent | |
value_type (allOf 1) | string | All variants apply | The type of the custom field value. Known values: SINGLE_VALUE, LIST |
value_type (allOf 2) | JSON | All variants apply | The type of the custom field value. |
Get trip — response body — traveler / type: EMPLOYEE, GUEST type: EMPLOYEE, GUEST name The name of the traveler The name of the traveler
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The name of the traveler. |
first_name | string | Optional | The traveler's first name. |
last_name | string | Optional | The traveler's last name. |
middle_name | JSON | Optional | |
middle_name (anyOf 1) | string | Alternative | The traveler's middle name. |
middle_name (anyOf 2) | null | Alternative | |
suffix | JSON | Optional | |
suffix (anyOf 1) | string | Alternative | The suffix in the traveler's name. |
suffix (anyOf 2) | null | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: brex.travel_gettrip. Catalog operation: travel:getTrip. 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"]