Brex: List card expenses
Brex expenses.expensesListExpenses1: arguments, response, policy and SDK examples.
← Expenses operations · Get started
Operation brex.expenses_listexpenses_1
Provider route: GET /v1/expenses/card. 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["expenses"]["expensesListExpenses1"]>[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.expenses.expensesListExpenses1(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.expenses.expenses_list_expenses_1(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Optional | Additional keys: not allowed |
query.expand[] | JSON | Optional | |
query.expand[] (anyOf 1) | array | Alternative | |
query.expand[] (anyOf 1)[] | string | Each item | |
query.expand[] (anyOf 2) | null | Alternative | |
query.user_id[] | JSON | Optional | |
query.user_id[] (anyOf 1) | array | Alternative | |
query.user_id[] (anyOf 1)[] | string | Each item | |
query.user_id[] (anyOf 2) | null | Alternative | |
query.parent_expense_id[] | JSON | Optional | |
query.parent_expense_id[] (anyOf 1) | array | Alternative | |
query.parent_expense_id[] (anyOf 1)[] | string | Each item | |
query.parent_expense_id[] (anyOf 2) | null | Alternative | |
query.budget_id[] | JSON | Optional | |
query.budget_id[] (anyOf 1) | array | Alternative | |
query.budget_id[] (anyOf 1)[] | string | Each item | |
query.budget_id[] (anyOf 2) | null | Alternative | |
query.spending_entity_id[] | JSON | Optional | |
query.spending_entity_id[] (anyOf 1) | array | Alternative | |
query.spending_entity_id[] (anyOf 1)[] | string | Each item | |
query.spending_entity_id[] (anyOf 2) | null | Alternative | |
query.status[] | JSON | Optional | |
query.status[] (anyOf 1) | array | Alternative | |
query.status[] (anyOf 1)[] | string | Each item | One of: DRAFT, SUBMITTED, APPROVED, OUT_OF_POLICY, VOID, CANCELED, SPLIT, SETTLED |
query.status[] (anyOf 2) | null | Alternative | |
query.payment_status[] | JSON | Optional | |
query.payment_status[] (anyOf 1) | array | Alternative | |
query.payment_status[] (anyOf 1)[] | string | Each item | The payment status of the expense. HELD means a bill payment is on hold until the vendor’s new payment method is approved. New values may be added to this enum, so handle unknown values. One of: NOT_STARTED, PROCESSING, CANCELED, DECLINED, CLEARED, REFUNDING, REFUNDED, CASH_ADVANCE, CREDITED, AWAITING_PAYMENT, SCHEDULED, HELD |
query.payment_status[] (anyOf 2) | null | Alternative | |
query.compliance_status[] | JSON | Optional | |
query.compliance_status[] (anyOf 1) | array | Alternative | |
query.compliance_status[] (anyOf 1)[] | string | Each item | One of: DUE, OVERDUE, COMPLETED |
query.compliance_status[] (anyOf 2) | null | Alternative | |
query.derived_compliance_status[] | JSON | Optional | |
query.derived_compliance_status[] (anyOf 1) | array | Alternative | |
query.derived_compliance_status[] (anyOf 1)[] | string | Each item | One of: COMPLETED, DOCUMENTATION_DUE, REVIEW_DUE |
query.derived_compliance_status[] (anyOf 2) | null | Alternative | |
query.purchased_at_start | JSON | Optional | |
query.purchased_at_start (anyOf 1) | string | Alternative | Format: date-time |
query.purchased_at_start (anyOf 2) | null | Alternative | |
query.purchased_at_end | JSON | Optional | |
query.purchased_at_end (anyOf 1) | string | Alternative | Format: date-time |
query.purchased_at_end (anyOf 2) | null | Alternative | |
query.updated_at_start | JSON | Optional | |
query.updated_at_start (anyOf 1) | string | Alternative | Format: date-time |
query.updated_at_start (anyOf 2) | null | Alternative | |
query.updated_at_end | JSON | Optional | |
query.updated_at_end (anyOf 1) | string | Alternative | Format: date-time |
query.updated_at_end (anyOf 2) | null | Alternative | |
query.payment_posted_at_start | JSON | Optional | |
query.payment_posted_at_start (anyOf 1) | string | Alternative | Format: date-time |
query.payment_posted_at_start (anyOf 2) | null | Alternative | |
query.payment_posted_at_end | JSON | Optional | |
query.payment_posted_at_end (anyOf 1) | string | Alternative | Format: date-time |
query.payment_posted_at_end (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 | |
query.load_expense_addenda | JSON | Optional | |
query.load_expense_addenda (anyOf 1) | boolean | Alternative | |
query.load_expense_addenda (anyOf 2) | null | Alternative | |
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: int32 |
query.limit (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 expenses — response body |
Referenced models: List expenses — response body
Schemas
Section titled “Schemas”49 more schemas are linked from the tables above, on the schema pages.
List expenses — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
items | array | Required within parent | |
items[] | Model | Each item | Expand Get an expense — response body |
next_cursor | JSON | Optional | |
next_cursor (anyOf 1) | string | Alternative | |
next_cursor (anyOf 2) | null | Alternative |
Referenced models: Get an expense — response body
Get transfer — response body — amount
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Money fields can be signed or unsigned. Fields are signed (an unsigned value will be interpreted as positive). The amount of money will be represented in the smallest denomination of the currency indicated. For example, USD 7.00 will be represented in cents with an amount of 700. |
amount | JSON | Required within parent | |
amount (anyOf 1) | integer | Alternative | The amount of money, in the smallest denomination of the currency indicated by currency. For example, when currency is USD, amount is in cents. Format: int64 |
amount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
currency | JSON | Optional | |
currency (anyOf 1) | string | Alternative | The type of currency, in ISO 4217 format. Default: USD |
currency (anyOf 2) | null | Alternative |
Get an expense — response body — budget id, name id, name
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
id | string | Required within parent | Unique ID for the Budget. |
name | string | Required within parent | Name for the Budget. |
Get an expense — response body — category The category of expenses The category of expenses
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | The category of expenses. Known values: ADVERTISING_AND_MARKETING, GROCERY, TELEPHONY, OFFICE_SUPPLIES, PRIVATE_AIR_TRAVEL, CLOTHING, CAR_RENTAL, VEHICLE_EXPENSES, RESTAURANTS, GAMBLING, FLOWERS, ELECTRONICS, LEGAL_SERVICES, UTILITIES, FURNITURE, BARS_AND_NIGHTLIFE, LAUNDRY, EVENT_EXPENSES, SHIPPING, OTHER_TRAVEL_EXPENSES, CHARITY, SOFTWARE_NON_RECURRING, LODGING, FACILITIES_EXPENSES, SERVERS, CONFERENCES, FOOD_DELIVERY, RENT, AIRLINE_EXPENSES, OTHER_BUSINESS_EXPENSES, BANK_AND_FINANCIAL_FEES, BOOKS_AND_NEWSPAPERS, CONSULTANT_AND_CONTRACTOR, CORPORATE_INSURANCE, DIGITAL_GOODS, FEES_AND_LICENSES_AND_TAXES, GAS_AND_FUEL, GENERAL_MERCHANDISE, MEDICAL, MEMBERSHIPS_AND_CLUBS, PARKING_EXPENSES, POLITICAL_DONATIONS, PUBLIC_TRANSPORTATION, RECURRING_SOFTWARE_AND_SAAS, RIDESHARE_AND_TAXI, TOLL_AND_BRIDGE_FEES, TRAINING_AND_EDUCATION, TRAVEL_WIFI |
Get an expense — response body — cost center The cost center associated with the expense The cost center associated with the expense
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The cost center associated with the expense. |
id | string | Required within parent | The unique identifier for the cost center. |
name | string | Required within parent | The name of the cost center. |
Get user — response body — custom fields array item
Referenced models: Get user — response body — custom fields array item value The value of the custom field Boolean list value, Get user — response body — custom fields array item value The value of the custom field Boolean value, Get user — response body — custom fields array item value Base class for custom field values, Get user — response body — custom fields array item value The value of the custom field Date list value, Get user — response body — custom fields array item value The value of the custom field Date value, Get user — response body — custom fields array item value The value of the custom field Decimal list value, Get user — response body — custom fields array item value The value of the custom field Decimal value, Get user — response body — custom fields array item value The value of the custom field Enum list value, Get user — response body — custom fields array item value The value of the custom field Enum value, Get user — response body — custom fields array item value The value of the custom field Money list value, Get user — response body — custom fields array item value The value of the custom field Money value, Get user — response body — custom fields array item value The value of the custom field Option string list value, Get user — response body — custom fields array item value The value of the custom field Option string value, Get user — response body — custom fields array item value The value of the custom field String list value, Get user — response body — custom fields array item value The value of the custom field String value, Get user — response body — custom fields array item value The value of the custom field Timestamp list value, Get user — response body — custom fields array item value The value of the custom field Timestamp value
Get an expense — response body — location The location associated with the expense The location associated with the expense
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The location associated with the expense. |
id | string | Required within parent | The unique identifier for the location. |
name | string | Required within parent | The name of the location. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: brex.expenses_listexpenses_1. Catalog operation: expenses:listExpenses_1. 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: ["expenses.card", "expenses.card.readonly"]