Skip to content

Brex Card

Fetch card transactions from Brex.

Generate an API token at Brex Dashboard > Developer > API tokens with read access to transactions.

Terminal window
export BREX_API_KEY=brex_token_...
Terminal window
vgrid fetch brex-card --from 2026-01-01 --to 2026-02-01 --out brex-card.csv
FlagDescriptionDefault
--fromStart date inclusive (YYYY-MM-DD)required
--toEnd date exclusive (YYYY-MM-DD)required
--api-keyBrex API tokenBREX_API_KEY env
--outOutput CSV pathstdout
-q / --quietSuppress progress messagesoff
Brex typeCanonical typeSign
PURCHASEpurchasenegative (outflow)
REFUNDrefundpositive (inflow)
CHARGEBACKchargebackpositive (inflow)
COLLECTIONcollectionnegative (outflow)
REWARDS_CREDITcreditpositive (inflow)
anything elseadjustmentnegative (outflow)
  • effective_dateposted_at_date from Brex
  • posted_date — same as effective_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.