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:read scope.


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)
  • Query parameters

NameTypeRequiredDescription
page
integerNot required
Page number, starting from 1
limit
integerNot 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)
  • Path parameters

NameTypeRequiredDescription
id
integerRequired
The bank account ID

Get sub-accounts list

GET
/api/v1/bank-accounts/{id}/sub-accounts
Authorization: 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)
  • Path parameters

NameTypeRequiredDescription
id
integerRequired
The bank account ID
  • Query parameters
NameTypeRequiredDescription
page
integerNot required
Page number, starting from 1
limit
integerNot required
Number of results per page

Error Codes

  • Below are possible error codes when using the Bank Accounts API:
    HTTP CodeError CodeDescription
    401
    unauthorized
    Token is invalid or expired
    403
    forbidden
    You do not have permission to access this resource
    404
    resource_not_found
    The bank account does not exist

Next Steps

  • Next, explore the Transactions API to retrieve information about transactions related to bank accounts.