Bank Account API
The Bank Account API helps you retrieve the list of bank accounts added to SePay, query detailed information for each account, and check account balances.
What can you do with this API?
SePay allows you to perform the following queries with Bank Accounts:
GEThttps://my.sepay.vn/userapi/bankaccounts/list- Retrieve a list of bank accounts
GEThttps://my.sepay.vn/userapi/bankaccounts/details/{bank_account_id}- Retrieve details of a specific bank account
GEThttps://my.sepay.vn/userapi/bankaccounts/count- Count the total number of bank accounts
Retrieve bank account list
GET
/userapi/bankaccounts/listContent-Type: application/json
Authorization: Bearer {YOUR_API_TOKEN}
- Retrieves all bank accounts. By default, only the 100 most recently added bank accounts are displayed.
- Query parameters
Name Type Required Description short_namestring Not required Bank name corresponding to the short_name fieldlast_transaction_date_minstring Not required Filter accounts with the latest transaction after (>=) this date. Format: yyyy-mm-ddlast_transaction_date_maxstring Not required Filter accounts with the latest transaction before (<=) this date. Format: yyyy-mm-ddsince_idinteger Not required Show bank accounts from the specified ID (>=)limitinteger Not required Limit the number of returned accounts. Default is 100accumulated_minnumber Not required Filter accounts with balance greater than or equal to (>=)accumulated_maxnumber Not required Filter accounts with balance less than or equal to (<=)
Information
View the list of bank short names here
Example usage
Retrieve bank accounts with transactions after 08:00 on April 30, 2023, and before 12:00 on May 2, 2023
cURLcurl -X GET "https://my.sepay.vn/userapi/bankaccounts/list?last_transaction_date_min=2023-04-30%2008:00:00&last_transaction_date_max=2023-05-02%2012:00:00" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_TOKEN"Retrieve bank accounts starting from ID 20
cURLcurl -X GET "https://my.sepay.vn/userapi/bankaccounts/list?since_id=20" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_TOKEN"Retrieve 20 Vietcombank accounts
cURLcurl -X GET "https://my.sepay.vn/userapi/bankaccounts/list?short_name=Vietcombank&limit=20" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_TOKEN"Filter bank accounts with a balance ≥ 1 VND
cURLcurl -X GET "https://my.sepay.vn/userapi/bankaccounts/list?accumulated_min=1" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_TOKEN"
Retrieve details of a specific bank account
GET
/userapi/bankaccounts/details/{bank_account_id}Content-Type: application/json
Authorization: Bearer {YOUR_API_TOKEN}
- Retrieve detailed information about a specific bank account by ID
- Path parameters
Name Type Required Description bank_account_idinteger Required ID of a bank account
Count total number of bank accounts
GET
/userapi/bankaccounts/countAuthorization: Basic secret_key Content-Type: application/json
Count the total number of existing bank accounts.
Name Type Required Description short_namestring Not required Bank name corresponding to the short_name fieldlast_transaction_date_minstring Not required Filter accounts with last transaction after (>=). Format: yyyy-mm-ddlast_transaction_date_maxstring Not required Filter accounts with last transaction before (<=). Format: yyyy-mm-ddsince_idinteger Not required Show bank accounts from the specified ID (>=)accumulated_minnumber Not required Filter accounts with balance greater than or equal to (>=)accumulated_maxnumber Not required Filter accounts with balance less than or equal to (<=)
Example usage
- Count total number of bank accounts with balance ≥ 1cURL
curl -X GET "https://my.sepay.vn/userapi/bankaccounts/count?accumulated_min=1" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_TOKEN"
- Count total number of bank accounts with balance ≥ 1