Brex Card
Fetch card transactions from Brex.
Generate an API token at Brex Dashboard > Developer > API tokens with read access to transactions.
export BREX_API_KEY=brex_token_...vgrid fetch brex-card --from 2026-01-01 --to 2026-02-01 --out brex-card.csvOptions
Section titled “Options”| Flag | Description | Default |
|---|---|---|
--from |
Start date inclusive (YYYY-MM-DD) | required |
--to |
End date exclusive (YYYY-MM-DD) | required |
--api-key |
Brex API token | BREX_API_KEY env |
--out |
Output CSV path | stdout |
-q / --quiet |
Suppress progress messages | off |
Type mapping
Section titled “Type mapping”| Brex type | Canonical type | Sign |
|---|---|---|
PURCHASE |
purchase |
negative (outflow) |
REFUND |
refund |
positive (inflow) |
CHARGEBACK |
chargeback |
positive (inflow) |
COLLECTION |
collection |
negative (outflow) |
REWARDS_CREDIT |
credit |
positive (inflow) |
| anything else | adjustment |
negative (outflow) |
Date handling
Section titled “Date handling”effective_date—posted_at_datefrom Brexposted_date— same aseffective_date(Brex card transactions only provide a posted date)
The --to flag is exclusive: internally converted to inclusive by subtracting one day for the API call.
Amounts. Brex provides amounts in minor units (cents) — no float conversion needed.
group_id. Set to the card_id, grouping transactions by physical card.
source field. brex_card.
Pagination. Cursor-based (next_cursor) with stuck-cursor detection.
Sort order. posted_date ascending, then source_id ascending.