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.
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:
|
This is the basic object that provides a top-level view of a company's available accounts.
read:Accounts
) Successful operation
Bad Request
Unauthorized
Not Found
Internal Server Error
Service Unavailable
curl -i -X GET \ https://platform.staging.brexapps.com/v1/accounting/accounts \ -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
{- "items": [
- {
- "id": "dpacc_12345",
- "type": "ASSET",
- "instrument": "CASH",
- "name": "Company Name Cash Account",
- "description": "Brex Cash Account",
- "status": "ACTIVE",
- "settlement_currency": "usd",
- "current_balance": {
- "amount": 888800,
- "currency": "usd"
}, - "available_balance": {
- "amount": 3400,
- "currency": "usd"
}, - "cash": {
- "account_number": "668288305125",
- "routing_number": "122105100",
- "current_statement_period": {
- "start": "2020-02-01",
- "end": "2020-02-31"
}
}
}, - {
- "id": "cuacc_12345",
- "type": "LIABILITY",
- "instrument": "CARD",
- "name": "Company Name Card Account",
- "description": "Brex Card Account",
- "status": "ACTIVE",
- "settlement_currency": "usd",
- "current_balance": {
- "amount": 666600,
- "currency": "usd"
}, - "available_balance": {
- "amount": 3400,
- "currency": "usd"
}, - "card": {
- "account_limit": {
- "amount": 100000,
- "currency": "usd"
}, - "current_statement_period": {
- "start": "2020-02-01",
- "end": "2020-02-31"
}
}
}
]
}
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.
read:Accounts
) Successful operation
Bad Request
Unauthorized
Not Found
curl -i -X GET \ 'https://platform.staging.brexapps.com/v1/accounting/accounts/{accountId}/transactions' \ -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
{- "next_cursor": "bGltaXQ9MjAmb2Zmc2V0PTE",
- "items": [
- {
- "id": "ptx_1234",
- "kind": "CARD",
- "status": "POSTED",
- "amount": {
- "amount": 12340,
- "currency": "usd"
}, - "balance": {
- "amount": 888800,
- "currency": "usd"
}, - "description": "Uber",
- "initiated_at": "2019-09-01T00:00:00Z",
- "posted_at": "2019-09-03T00:00:00Z",
- "statement_id": "st_123",
- "method": {
- "type": "CREDIT_CARD",
- "credit_card": {
- "id": "card_1234",
- "network": "VISA",
- "last_four": "7890",
- "first_six": "123456",
- "cardholder_name": "First Last"
}
}, - "card_transaction_details": {
- "type": "PURCHASE",
- "purchase": {
- "raw_descriptor": "PAYPAL *UBER",
- "mcc_code": "145"
}
}
}
]
}
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.
read:Accounts
) Successful operation
Bad Request
Unauthorized
Not Found
curl -i -X GET \ 'https://platform.staging.brexapps.com/v1/accounting/accounts/{accountId}/statements' \ -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
{- "next_cursor": "bGltaXQ9MjAmb2Zmc2V0PTE",
- "items": [
- {
- "id": "pst_123",
- "start_balance": {
- "amount": 123400,
- "currency": "usd"
}, - "end_balance": {
- "amount": 333000,
- "currency": "usd"
}, - "period": {
- "start": "2019-09-01T00:00:00Z",
- "end": "2019-09-30T23:59:59Z"
},
}
]
}