Bank Accounts API
Documentation on how to use the Bank Accounts API via OAuth2 in SePay.
Introduction
SePay’s Bank Accounts API lets you query detailed information about bank accounts that have been added to SePay. You can fetch the account list, view details of each account, and the sub-accounts linked to it.
To use this API, your Access Token must include the
bank-account:readscope.
Endpoints
The Bank Accounts API provides the following endpoints:
GET/api/v1/bank-accounts- Retrieve the list of all bank accounts
GET/api/v1/bank-accounts/{id}- Retrieve detailed information for a specific bank account
GET/api/v1/bank-accounts/{id}/sub-accounts- Retrieve the list of sub-accounts for a bank account
Get the list of bank accounts
GET
/api/v1/bank-accounts Authorization: Bearer {YOUR_ACCESS_TOKEN}
- This endpoint returns the list of bank accounts belonging to your company.
Required permissions
- Scope:
bank-account:read - User permission: Bank Accounts (View account list)
- Scope:
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | Not required | Page number, starting from 1 |
limit | integer | Not required | Number of results per page |
Get bank account details
GET
/api/v1/bank-accounts/{id} Authorization: Bearer {YOUR_ACCESS_TOKEN}
This endpoint returns detailed information of a bank account by its ID.
Required permissions
- Scope:
bank-account:read - User permission: Bank Accounts (View account details)
- Scope:
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The bank account ID |
Get sub-accounts list
GET
/api/v1/bank-accounts/{id}/sub-accountsAuthorization: Bearer {YOUR_ACCESS_TOKEN}
This endpoint returns the list of sub-accounts of a bank account.
Required permissions
- Scope:
bank-account:read - User permission: Bank Accounts (View account list)
- Scope:
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The bank account ID |
- Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | Not required | Page number, starting from 1 |
limit | integer | Not required | Number of results per page |
Error Codes
- Below are possible error codes when using the Bank Accounts API:
HTTP Code Error Code Description 401 unauthorizedToken is invalid or expired403 forbiddenYou do not have permission to access this resource404 resource_not_foundThe bank account does not exist
Next Steps
- Next, explore the Transactions API to retrieve information about transactions related to bank accounts.