# Brex

> Manage Brex card spend, expenses, transactions, and virtual cards.

App · Payments & Billing · 8 actions. Web page: https://docs.lodol.com/docs/integrations/brex

## Actions

### Create a Brex card

Create a new virtual or physical Brex card. For a vendor card with its own spending limit, set the limit type to CARD. For an employee card that uses the person's existing limit, set the limit type to USER.

**Inputs**

- Owner user ID (`owner_user_id`, text, required): The ID of the user the card is issued to. You can find user IDs with the List Brex users action.
- Card name (`card_name`, text, required): Display name for the card (e.g. 'AWS - Vendor').
- Card type (`card_type`, text, required): Choose VIRTUAL or PHYSICAL. Vendor cards must be VIRTUAL.
- Limit type (`limit_type`, text, required): Choose CARD (a vendor card with its own limit) or USER (a corporate card that uses the person's limit). If you choose CARD, the spend limit amount and spend duration are required.
- Spend limit amount (`spend_limit_amount`, number): Required when the limit type is CARD. Enter the amount in the smallest currency unit (for example, cents for USD, so 50000 means $500).
- Spend limit currency (`spend_limit_currency`, text): Three-letter currency code, for example USD. Default is USD. Default: `USD`.
- Spend duration (`spend_duration`, text): Required when the limit type is CARD. How long the spend limit applies: MONTHLY, QUARTERLY, YEARLY, or ONE_TIME.
- Reason (`reason`, text): The reason for the spend limit.
- Lock after date (`lock_after_date`, text): The card locks automatically after this date. Use the format yyyy-mm-dd, for example 2026-12-31.
- Mailing address (`mailing_address`, object): Required for physical cards. The shipping details, with these fields: recipient_name, phone_number, and address (which contains line1, line2, city, state, postal_code, and country).

**Outputs**

- `card_name` (text)
- `card_type` (text)
- `id` (text): New card ID. Use as card_id in subsequent actions (list_card_transactions filter, future lock/terminate).
- `last_four` (text): Last four digits of the new card.
- `limit_type` (text)
- `owner` (object): {type, user_id}. Echoes the input.
- `spend_controls` (object): Echoes the input spend_controls when limit_type=CARD.
- `status` (text): Initial status, typically ACTIVE.

**Example output**

```json
{
  "card_name": "AWS - Vendor",
  "card_type": "VIRTUAL",
  "id": "card_abc123",
  "last_four": "4242",
  "limit_type": "CARD",
  "status": "ACTIVE"
}
```

### Get a Brex expense

Fetch a single card expense by ID.

**Inputs**

- Expense ID (`expense_id`, text, required): The ID of the expense. You can find it with the List Brex expenses or List Brex card transactions actions.
- Extra details to include (`expand`, list): Extra details to include with the expense. Options: merchant, location, department, receipts.download_uris, user, budget, payment, spending_entity, policy.

**Outputs**: A single Brex expense object. Same shape as one entry of list_expenses.items.

**Example output**

```json
{
  "amount": {
    "amount": 1800,
    "currency": "USD"
  },
  "id": "expense_abc123",
  "memo": "Notion subscription"
}
```

### List Brex card transactions

List settled transactions on the primary card account. Pending transactions are not included. Regular users can only see their own purchase, refund, and chargeback transactions.

**Inputs**

- User IDs (`user_ids`, list): Only include transactions made by these users. You can find user IDs with the List Brex users action.
- Posted date from (`posted_at_start`, text): Only include transactions posted at or after this time (for example, 2026-04-01T00:00:00Z).
- Cursor (`cursor`, text): To get the next page of results, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return per page, up to 100. Default is 50. Default: `50`.

**Outputs**

- `items` (list): Settled card transactions.
- `next_cursor` (text): Cursor for the next page.

**Example output**

```json
{
  "items": [
    {
      "amount": {
        "amount": 1800,
        "currency": "USD"
      },
      "description": "NOTION LABS INC",
      "id": "txn_abc123",
      "type": "PURCHASE"
    }
  ],
  "next_cursor": null
}
```

### List Brex cards

List Brex cards, optionally filtered by user.

**Inputs**

- User ID (`user_id`, text): Only include cards owned by this user. You can find user IDs with the List Brex users action.
- Cursor (`cursor`, text): To get the next page of results, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return per page, up to 100. Default is 50. Default: `50`.

**Outputs**

- `items` (list): List of Brex card objects.
- `next_cursor` (text): Cursor for the next page.

**Example output**

```json
{
  "items": [
    {
      "card_name": "AWS - Vendor",
      "card_type": "VIRTUAL",
      "id": "card_abc123",
      "last_four": "4242",
      "limit_type": "CARD",
      "status": "ACTIVE"
    }
  ],
  "next_cursor": null
}
```

### List Brex expenses

List card expenses, with optional filters by user, budget, status, payment status, and purchase date range. Results come back one page at a time.

**Inputs**

- User ID (`user_id`, list): Only include expenses owned by these users. You can find user IDs with the List Brex users action.
- Budget ID (`budget_id`, list): Filter to expenses charged against these budget IDs.
- Parent expense ID (`parent_expense_id`, list): Only include expenses that belong to these parent expenses.
- Expense status (`expense_status`, list): Only include expenses with these statuses: DRAFT, SUBMITTED, APPROVED, OUT_OF_POLICY, VOID, CANCELED, SPLIT, or SETTLED.
- Payment status (`payment_status`, list): Only include expenses with these payment statuses: NOT_STARTED, PROCESSING, CANCELED, DECLINED, CLEARED, REFUNDING, REFUNDED, CASH_ADVANCE, CREDITED, AWAITING_PAYMENT, or SCHEDULED.
- Purchase date from (`purchased_at_start`, text): Only include expenses purchased at or after this time (for example, 2026-04-01T00:00:00Z).
- Purchase date to (`purchased_at_end`, text): Only include expenses purchased up to this time (for example, 2026-04-30T00:00:00Z).
- Extra details to include (`expand`, list): Extra details to include with each expense. Options: merchant, location, department, receipts.download_uris, user, budget, payment, spending_entity, policy.
- Cursor (`cursor`, text): To get the next page of results, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return per page, up to 100. Default is 50. Default: `50`.

**Outputs**

- `items` (list): List of Brex expense objects.
- `next_cursor` (text): Cursor for the next page. null/empty when there are no more pages.

**Example output**

```json
{
  "items": [
    {
      "amount": {
        "amount": 1800,
        "currency": "USD"
      },
      "expense_status": "SETTLED",
      "id": "expense_abc123",
      "memo": "Notion subscription",
      "payment_status": "CLEARED"
    }
  ],
  "next_cursor": null
}
```

### List Brex users

List users in the Brex account, with an optional email filter. Use the user IDs from this action to create cards or to filter expenses and cards by user.

**Inputs**

- Email (`email`, text): Filter to a user by email address.
- Remote display ID (`remote_display_id`, text): Filter by the user's ID from your HR or sign-in system.
- Cursor (`cursor`, text): To get the next page of results, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return per page, up to 100. Default is 50. Default: `50`.

**Outputs**

- `items` (list): List of Brex users.
- `next_cursor` (text): Cursor for the next page.

**Example output**

```json
{
  "items": [
    {
      "email": "alex@example.com",
      "first_name": "Alex",
      "id": "user_abc123",
      "last_name": "Chen",
      "status": "ACTIVE"
    }
  ],
  "next_cursor": null
}
```

### Update a Brex expense

Update the memo on a card expense. The memo is the only field Brex allows this action to change.

**Inputs**

- Expense ID (`expense_id`, text, required): The ID of the expense to update. You can find it with the List Brex expenses action.
- Memo (`memo`, text, required): The new memo text. It replaces the existing memo; leave it empty to clear the memo.

**Outputs**: Updated expense object. Subset of the full expense schema returned by get_expense.

- `id` (text): Updated expense ID.
- `memo` (text): Memo after update.
- `updated_at` (text): RFC 3339 timestamp reflecting this update.

**Example output**

```json
{
  "id": "expense_abc123",
  "memo": "Updated memo",
  "updated_at": "2026-04-07T12:00:00Z"
}
```

### Upload a Brex receipt

Upload a receipt file to Brex. If you provide an expense ID, the receipt is attached to that expense. Otherwise Brex matches it to an expense by amount, merchant, and date.

**Inputs**

- Receipt name (`receipt_name`, text, required): Filename including extension (e.g. 'receipt-2026-04-07.pdf').
- File (`file`, text, required): The receipt file to upload (PDF, PNG, or JPG). You can attach a file or enter its file path.
- Expense ID (`expense_id`, text): Optional. The expense to attach the receipt to. You can find expense IDs with the List Brex expenses action. If left blank, Brex matches the receipt to an expense automatically.

**Outputs**

- `id` (text): Brex receipt ID. Use to look up the matched expense via list_expenses with expand=receipts.download_uris.
- `matched_expense_id` (text): Expense the receipt matched to. Null when match is still pending. Use as expense_id in get_expense / update_expense.
- `status` (text): Upload status: 'uploaded' or 'pending_match'.

**Example output**

```json
{
  "id": "receipt_xyz789",
  "matched_expense_id": "expense_abc123",
  "status": "uploaded"
}
```
