Accounting API (Legacy Support) (1.2.2)

Download OpenAPI specification:Download

Note: Support for this API is only for existing developers. We are no longer onboarding new developers to this API.

Below are specifications for a Brex accounting API to be used for pull-based integrations with accounting partners.

Authentication

BrexOAuth2Authentication

OAuth2 security scheme. Users with the account admin or bookkeeper role may access the accounting API.

Security Scheme Type OAuth2
authorizationCode OAuth Flow
Authorization URL: https://accounts.brex.com/oauth2/v1/auth
Token URL: https://accounts.brex.com/oauth2/v1/token
Scopes:
  • openid -

    openid

  • https://accounting.brexapis.com/cash -

    Read Brex Cash account data

  • https://accounting.brexapis.com/card -

    Read Brex Card account data

bearerAuth

Security Scheme Type HTTP
HTTP Authorization Scheme bearer

Accounts

Query data for Brex Cash and card accounts, transactions, and statements.

Get information for an account

This is the basic object that provides a top-level view of a company's available accounts.

Request
Security:
bearerAuth (read:Accounts)
Responses
200

Successful operation

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

503

Service Unavailable

get/v1/accounting/accounts
Request samples
curl -i -X GET \
  https://platform.staging.brexapps.com/v1/accounting/accounts \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Response samples
application/json
{
  • "items": [
    ]
}

Get transactions for an account

This endpoint supports both PENDING and POSTED transactions. For now, this endpoint will only return posted transactions. However, you should build against it assuming it returns both PENDING and POSTED.

If the transaction is PENDING, the balance, posted_at, and statement_id fields will be null.

If the transaction is POSTED but the statement has not closed yet, statement_id will be null.

Note that amount.amount is the amount of a transaction, whereas balance.amount is the running balance of the account including the amount of this transaction. Most of the time, the 2 values will be different.

All amounts will have signage.

For CASH, a debit activity will have a positive value. i.e. depositing a paycheck. A credit activity will have a negative sign. i.e. paying a bill via outgoing ACH transfer.

For CREDIT CARD, a debit activity will have a negative value. i.e. paying off the credit card bill. A credit activity will have a positive sign. i.e. purchasing coffee.

Request
Security:
bearerAuth (read:Accounts)
path Parameters
accountId
required
string

ID of the account to get transactions for

query Parameters
start_time
string

Inclusive UTC ISO timestamp, optional. For posted transactions, this will filter on the posted_at field For pending transactions, this will filter on the initiated_at field

statement_id
string

If this parameter is given, only POSTED transactions will be returned

limit
integer

optional, maximum allowed is 100

Responses
200

Successful operation

400

Bad Request

401

Unauthorized

404

Not Found

get/v1/accounting/accounts/{accountId}/transactions
Request samples
curl -i -X GET \
  https://platform.staging.brexapps.com/v1/accounting/accounts/:accountId/transactions \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Response samples
application/json
{
  • "next_cursor": "bGltaXQ9MjAmb2Zmc2V0PTE",
  • "items": [
    ]
}

Get statements for an account

Retrieve the statement information for a given account. By default, it returns statements in order of period.end (latest first). The data returned by this endpoint is immutable, so it will only return closed statements. The current "open" statement (which is mutable) will not be returned.

Request
Security:
bearerAuth (read:Accounts)
path Parameters
accountId
required
string

ID of the account to get statements for

Responses
200

Successful operation

400

Bad Request

401

Unauthorized

404

Not Found

get/v1/accounting/accounts/{accountId}/statements
Request samples
curl -i -X GET \
  https://platform.staging.brexapps.com/v1/accounting/accounts/:accountId/statements \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Response samples
application/json
{
  • "next_cursor": "bGltaXQ9MjAmb2Zmc2V0PTE",
  • "items": [
    ]
}
Copyright © Brex 2019–2021. All rights reserved.