Bank Account API
The Bank Account API helps retrieve the list of bank accounts added to SePay. Query detailed information of each account, balance of each account.
What Can You Do with This API?
SePay allows you to perform the following queries with Bank Accounts:
https://my.sepay.vn/userapi/bankaccounts/list- Get list of bank accounts
https://my.sepay.vn/userapi/bankaccounts/details/{bank_account_id}- Get details of a bank account
https://my.sepay.vn/userapi/bankaccounts/count- Count number of bank accounts
Get List of Bank Accounts
https://my.sepay.vn/userapi/bankaccounts/listGet all bank accounts. By default, only the 100 most recently added bank accounts are displayed.
Query Parameters
HTTP status code
Error message (null if successful)
View bank names corresponding to the short_name field here
Code Examples
curl --request GET \--url 'https://my.sepay.vn/userapi/bankaccounts/list?short_name=Vietcombank&last_transaction_date_min=2023-04-30&last_transaction_date_max=2023-05-02&since_id=20&limit=20&accumulated_min=1&accumulated_max=1000000000' \--header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
Response
{
"status": 200,
"error": null,
"messages": {
"success": true
},
"bankaccounts": [
{
"id": "25",
"account_holder_name": "NGUYEN THI B",
"account_number": "102871015203",
"accumulated": "2525493.00",
"last_transaction": "2023-02-16 16:16:00",
"label": "",
"active": "1",
"created_at": "2023-02-16 15:57:26",
"bank_short_name": "VietinBank",
"bank_full_name": "Ngân hàng TMCP Công Thương Việt Nam",
"bank_bin": "970415",
"bank_code": "ICB"
}
]
}HTTP status code
Error message (null if successful)
Usage Examples
Get bank accounts with transactions after 08:00 on April 30, 2023 and before 12:00 on May 02, 2023
curl -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"
Get bank accounts from ID 20 onwards
curl -X GET "https://my.sepay.vn/userapi/bankaccounts/list?since_id=20" \-H "Content-Type: application/json" \-H "Authorization: Bearer YOUR_API_TOKEN"
Get 20 accounts from Vietcombank
curl -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 balance >= 1 VND
curl -X GET "https://my.sepay.vn/userapi/bankaccounts/list?accumulated_min=1" \-H "Content-Type: application/json" \-H "Authorization: Bearer YOUR_API_TOKEN"
Get Bank Account Details
https://my.sepay.vn/userapi/bankaccounts/details/{bank_account_id}Get detailed information of a bank account by ID.
Path Parameters
HTTP status code
Error message (null if successful)
Code Examples
curl --request GET \--url https://my.sepay.vn/userapi/bankaccounts/details/18 \--header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
Response
{
"status": 200,
"error": null,
"messages": {
"success": true
},
"bankaccount": {
"id": "18",
"account_holder_name": "NGUYEN VAN A",
"account_number": "0071000899999",
"accumulated": "2625076186.00",
"last_transaction": "2023-08-09 07:59:48",
"label": "",
"active": "1",
"created_at": "2023-02-12 20:05:47",
"bank_short_name": "Vietcombank",
"bank_full_name": "Ngân hàng TMCP Ngoại Thương Việt Nam",
"bank_bin": "970436",
"bank_code": "VCB"
}
}HTTP status code
Error message (null if successful)
Count Bank Accounts
https://my.sepay.vn/userapi/bankaccounts/countCount the total number of bank accounts.
Query Parameters
HTTP status code
Error message (null if successful)
Total bank account count
Code Examples
curl --request GET \--url 'https://my.sepay.vn/userapi/bankaccounts/count?short_name=Vietcombank&last_transaction_date_min=2023-04-30&last_transaction_date_max=2023-05-02&since_id=20&accumulated_min=1&accumulated_max=1000000000' \--header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
Response
{
"status": 200,
"error": null,
"messages": {
"success": true
},
"count_bankaccounts": 9
}HTTP status code
Error message (null if successful)
Total bank account count
Usage Example
Count the total number of bank accounts with balance >= 1.
curl -X GET "https://my.sepay.vn/userapi/bankaccounts/count?accumulated_min=1" \-H "Content-Type: application/json" \-H "Authorization: Bearer YOUR_API_TOKEN"
Error Handling
401UnauthorizedInvalid or missing token.
404Not FoundBank account not found.
429Too Many RequestsRate limit of 2 requests/second exceeded. Check x-sepay-userapi-retry-after header.