The user token is used to authenticate your own Brex account. The OAuth token is used when building partner applications to authenticate other Brex accounts.
User tokens expire if they are not used to make an API call for 30 days. When used regularly, they will not expire. User tokens can also be revoked using the Brex dashboard if needed. The OAuth token lasts for one hour and then must be refreshed.
Yes, a Brex user can have multiple deposit accounts and cards. You can use the List Cash Accounts endpoint to get a list of deposit accounts and the List Cards endpoint to get a list of cards for a user.
This is not available through the API today.
This is not available through the API today, but the current workaround is to request all transactions and then filter the transactions on your side.
Yes, the List Cash Accounts endpoint returns the current balance of each account.
You can use the Get Card Number endpoint to get a card's PAN. That endpoint requires the card ID, which you can get using the List Cards endpoint.
There is no programmatic way to add credit cards to Apple Pay via the Brex API. Apple does not offer a way to add payment passes/credit cards to Apple Pay outside of the iOS environment.
Apple does offer options for adding an "Add to Apple Wallet" to your iOS app, but it requires a special entitlement to enable in-app provisioning of payment cards that only Apple can grant.
It is in the API response header called X-Brex-Trace-Id.
Only settled transactions are returned from the API. We don't return pending transactions today, so transactions are not returned in real-time as they happen, and will only be returned in the API as transactions settle.
Vendors are unique to a customer account. Currently, it is not possible to share a vendor between accounts. As a workaround, you can add the same vendor to each account.
List Transfers returns a list of transfer payments (ACH, wire, or mail check) to vendors that are initiated via Brex.
List Cash Transactions and List Card Transactions return all transactions for a Brex deposits account and Brex card respectively.
Receiving payments, such as initiating an ACH debit to an external account, is not supported through the API today.
The differences are documented here.
A book transfer is a transfer type used to move funds between Brex deposit accounts.