Trips

Retrieves a trip by ID.

get/v1/trips/{trip_id}

Request

  • Base URL
    https://api.brex.com
  • Auth
    OAuth 2
    Authorization codehttps://accounts-api.brex.com/oauth2/default/v1/authorize
    Token URLhttps://accounts-api.brex.com/oauth2/default/v1/token
    Scopestravel.trips, travel.trips.readonly
  • TypeScript
    A function with typed inputs. Its response is checked against the schema.

Path parameters

trip_idstring required

Query parameters

load_custom_fieldsboolean nullable

Whether to load custom field values on the returned resources.

Response

The trip that was retrieved.

idstring required

The ID of the trip.

created_atstring date-time required

The time when the trip was created.

updated_atstring date-time required

The time when the latest trip update happened.

namestring nullable

The name of the trip as seen in the dashboard.

booker_user_idstring required

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.

status'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' required

The current status of the trip.

versioninteger required

The current version of the trip.

billable_atstring date-time nullable

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

starts_atstring date-time nullable

The time when the first booking in the trip starts.

ends_atstring date-time nullable

The time when the last booking in the trip ends.

trip_referencestring nullable

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.

Example response

{
  "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": "UPCOMING",
  "traveler": {
    "type": "EMPLOYEE",
    "name": {
      "first_name": "John",
      "middle_name": "Paul",
      "last_name": "Doe",
      "suffix": "Jr."
    },
    "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",
  "trip_reference": "7117228246",
  "custom_fields": [
    {
      "value": {
        "data": {
          "amount": 700,
          "currency": "USD"
        }
      }
    }
  ]
}

Changes

    • info

      added the new optional query request parameter load_custom_fields

    • info

      added the optional property to the response with the status

    • info

      removed the INVITED enum value from the //// response property for the response status