Appearance
Account ​
Your business has a primary account and can have sub-accounts, each with its own balances, history, deposit details and bank accounts. Use sub-accounts to keep funds apart, for example by desk, product or client, and move funds between them with a transfer.
Choosing the account a request acts on ​
Every signed request acts on one account:
- Without
X-VALR-SUB-ACCOUNT-ID, it acts on your primary account, whose ID is0. - With
X-VALR-SUB-ACCOUNT-IDset to a sub-account'sid, it acts on that sub-account. Include the ID in the signature too; see Authentication.
A key limited to specific sub-accounts can only act on those, so it must always send the header. Endpoints that manage sub-accounts, or that cover your whole business, such as balances for all accounts, are called on your primary account by a key that isn't limited to sub-accounts.
Common tasks ​
- See every balance at once: Get balances for all accounts returns each account's balances in one call. Balances of your payments accounts are under Payouts.
- Create a sub-account: Create a sub-account returns its ID. Mark accounts that hold your clients' money with the
CLIENT_FUNDStag. - Move funds: Transfer between accounts moves funds between your primary account and sub-accounts. It's processed asynchronously, so confirm it from balances or transaction history.
- Reconcile: transaction history is per account, newest first. An account's history doesn't include its sub-accounts' transactions; list them together with List transactions for all sub-accounts.
Before you start ​
| Bundle | Allows |
|---|---|
TREASURY_READ | Read balances, history, deposit details, sub-accounts and withdrawals |
TREASURY_WRITE | Everything in TREASURY_READ, plus create, rename and delete sub-accounts and transfer between accounts |
Endpoints ​
Balances ​
Account balances.
| Endpoint | Request | Needs |
|---|---|---|
| Get balances | GET /v1/account/balances | ACCOUNT_BALANCES_READ |
| Get balances for all accounts | GET /v1/account/balances/all | ACCOUNT_BALANCES_READ |
Sub-accounts ​
Your business's primary account and its sub-accounts: list, create, rename and delete sub-accounts, and move funds between your accounts. Your primary account's ID is 0. To call another endpoint on a sub-account, send the sub-account's id in the X-VALR-SUB-ACCOUNT-ID header; without it, requests act on your primary account. A key limited to some sub-accounts can only act on those, so it must always send the header.
| Endpoint | Request | Needs |
|---|---|---|
| List sub-accounts | GET /v1/account/subaccounts | SUB_ACCOUNTS_READ |
| Get a sub-account | GET /v1/account/subaccount/{accountPublicId} | SUB_ACCOUNTS_READ |
| Create a sub-account | POST /v1/account/subaccount | SUB_ACCOUNTS_MANAGE |
| Rename a sub-account | PUT /v1/account/subaccount | SUB_ACCOUNTS_MANAGE |
| Delete a sub-account | DELETE /v1/account/subaccount | SUB_ACCOUNTS_MANAGE |
| Transfer between accounts | POST /v1/account/subaccounts/transfer | TRANSFERS_CREATE |
Transaction history ​
Transactions and trades on your accounts, newest first. Unless an endpoint says otherwise, it reads the account you call it on: your primary account, or the sub-account selected with X-VALR-SUB-ACCOUNT-ID. An account's history doesn't include its sub-accounts' transactions.
| Endpoint | Request | Needs |
|---|---|---|
| List transactions | GET /v1/account/transactionhistory | TRANSACTION_HISTORY_READ |
| List transactions for all sub-accounts | GET /v1/account/transactionhistory/subaccounts | TRANSACTION_HISTORY_READ |