Accounting API Examples
Get a list of card and Brex Cash account details.
GET https://platform.brexapis.com/v1/accounting/accounts
RESPONSE
{
"items": [
{
"available_balance": {
"amount": 100,
"currency": "usd"
},
"card": {
"account_limit": {
"amount": 1000,
"currency": "usd"
},
"current_statement_period": {
"end": "2021-05-24",
"start": "2021-05-17"
}
},
"current_balance": {
"amount": 1000,
"currency": "usd"
},
"description": "Brex Card Account",
"id": "aacc_456",
"instrument": "CARD",
"name": "Joe Company Brex Card Account",
"settlement_currency": "usd",
"status": "ACTIVE",
"type": "LIABILITY"
},
{
"available_balance": {
"amount": 100,
"currency": "usd"
},
"cash": {
"account_number": "123456789",
"current_statement_period": {
"end": "2021-05-31",
"start": "2021-05-01"
},
"routing_number": "00000000"
},
"current_balance": {
"amount": 1000,
"currency": "usd"
},
"description": "Brex Cash Account",
"id": "dpacc_123",
"instrument": "CASH",
"name": "Joe Company Cash Account",
"settlement_currency": "usd",
"status": "ACTIVE",
"type": "ASSET"
}
],
"next_cursor": null
}
Get historical data for an account in chronological order.
GET https://platform.brexapis.com/v1/accounting/accounts/{account_id}/transactions?limit=1
RESPONSE
{
"items": [
{
"amount": {
"amount": 1000000,
"currency": "usd"
},
"balance": {
"amount": 2000000,
"currency": "usd"
},
"cash_transaction_details": {
"payment": {
"bai2_code": null,
"counterparty": {
"name": "counterparty name"
}
},
"type": "PAYMENT"
},
"description": "counterparty name",
"id": "sdtxns_123",
"initiated_at": "2021-05-16T17:22:00Z",
"method": {
"ach": {},
"type": "ACH"
},
"posted_at": "2021-05-18T01:15:18Z",
"source_type": "CASH",
"statement_id": "ststmts_123",
"status": "POSTED"
}
],
"next_cursor": "null"
}
Get card account statements.
GET https://platform.staging.brexapps.com/v1/accounting/accounts/{account_id}/statements?limit=1
RESPONSE
{
"items": [
{
"document_url": null,
"end_balance": {
"amount": 1000,
"currency": "usd"
},
"id": "pst_123",
"period": {
"end": "2021-03-08T00:00:00Z",
"start": "2021-03-01T00:00:00Z"
},
"start_balance": {
"amount": 1000,
"currency": "usd"
}
}
],
"next_cursor": "null"
}