用途 本技能用于通过 Brex API 读取企业信用卡、费用、付款、交易、账户与团队相关数据。当用户提到“Brex”“corporate card”“expenses”“card”等关键词时可触发使用。
主要能力
- 查询交易:列出主卡交易(分页)、获取现金账户交易。
- 查询账户:列出卡账户、列出现金账户、获取主现金账户。
- 常见工作流:导出近期卡消费、按币种汇总支出。
使用方式 认证:在 app.vm0.ai/connectors 连接 Brex 连接器,连接器提供 BREX_TOKEN(Brex API Token)。所有请求使用 bearer 认证,请求头为:Authorization: Bearer $BREX_TOKEN。基础 URL 为 https://api.brex.com。
交易示例:
curl -s "https://api.brex.com/v2/transactions/card/primary?limit=100"
--header "Authorization: Bearer $BREX_TOKEN" | jq .
使用响应中的 next_cursor 进行分页:
curl -s "https://api.brex.com/v2/transactions/card/primary?limit=100&cursor=<next-cursor>"
--header "Authorization: Bearer $BREX_TOKEN" | jq .
获取现金账户交易:
curl -s "https://api.brex.com/v2/transactions/cash/<cash-account-id>?limit=100"
--header "Authorization: Bearer $BREX_TOKEN" | jq .
账户示例:
列出卡账户:
curl -s "https://api.brex.com/v2/accounts/card"
--header "Authorization: Bearer $BREX_TOKEN" | jq .
列出现金账户:
curl -s "https://api.brex.com/v2/accounts/cash"
--header "Authorization: Bearer $BREX_TOKEN" | jq .
获取主现金账户:
curl -s "https://api.brex.com/v2/accounts/cash/primary"
--header "Authorization: Bearer $BREX_TOKEN" | jq .
常见工作流:
导出近期卡消费:
curl -s "https://api.brex.com/v2/transactions/card/primary?limit=100"
--header "Authorization: Bearer $BREX_TOKEN"
| jq '.items[] | {id, posted_at_date, description, type, amount}'
按币种汇总支出:
curl -s "https://api.brex.com/v2/transactions/card/primary?limit=100"
--header "Authorization: Bearer $BREX_TOKEN"
| jq '.items | group_by(.amount.currency)[] | {currency: .[0].amount.currency, total_minor_units: map(.amount.amount) | add}'
故障排查 如果请求失败,可运行: zero doctor check-connector --env-name BREX_TOKEN 或: zero doctor check-connector --url https://api.brex.com/v2/accounts/card --method GET
官方文档 开发者门户:https://developer.brex.com/ 交易 API:https://developer.brex.com/openapi/transactions_api/ 交易示例:https://developer.brex.com/examples/transactions_examples
指南
- Brex Token 具有权限范围限制。如果端点返回 403,Token 可能缺少所需权限范围。
- 批量导出时使用游标分页。
- 将交易、账户、收据和员工数据视为敏感财务数据。
- 优先使用读取端点;仅在用户明确要求时才执行付款或团队管理类的写入操作。
限制 除上述内容外,收费标准、定价、平台支持范围、具体效果等事实暂未提供。