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:

GET
https://my.sepay.vn/userapi/bankaccounts/list
  • Get list of bank accounts
GET
https://my.sepay.vn/userapi/bankaccounts/details/{bank_account_id}
  • Get details of a bank account
GET
https://my.sepay.vn/userapi/bankaccounts/count
  • Count number of bank accounts

Get List of Bank Accounts

GET
https://my.sepay.vn/userapi/bankaccounts/list

Get all bank accounts. By default, only the 100 most recently added bank accounts are displayed.

Query Parameters
statusinteger

HTTP status code

errorstring

Error message (null if successful)

messagesobject
bankaccountsarray<object>
Information

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
Response 200 - Bank account list
{
  "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"
    }
  ]
}
statusinteger

HTTP status code

errorstring

Error message (null if successful)

messagesobject
bankaccountsarray<object>
Usage Examples

Get bank accounts with transactions after 08:00 on April 30, 2023 and before 12:00 on May 02, 2023

JScURL
1
2
3
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

JScURL
1
2
3
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

JScURL
1
2
3
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

JScURL
1
2
3
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

GET
https://my.sepay.vn/userapi/bankaccounts/details/{bank_account_id}

Get detailed information of a bank account by ID.

Path Parameters
statusinteger

HTTP status code

errorstring

Error message (null if successful)

messagesobject
bankaccountobject
Code Examples
>
>
>
curl --request GET \
--url https://my.sepay.vn/userapi/bankaccounts/details/18 \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
Response
Response 200 - Bank account details
{
  "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"
  }
}
statusinteger

HTTP status code

errorstring

Error message (null if successful)

messagesobject
bankaccountobject

Count Bank Accounts

GET
https://my.sepay.vn/userapi/bankaccounts/count

Count the total number of bank accounts.

Query Parameters
statusinteger

HTTP status code

errorstring

Error message (null if successful)

messagesobject
count_bankaccountsinteger

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
Response 200 - Bank account count
{
  "status": 200,
  "error": null,
  "messages": {
    "success": true
  },
  "count_bankaccounts": 9
}
statusinteger

HTTP status code

errorstring

Error message (null if successful)

messagesobject
count_bankaccountsinteger

Total bank account count

Usage Example

Count the total number of bank accounts with balance >= 1.

JScURL
1
2
3
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

401Unauthorized

Invalid or missing token.

404Not Found

Bank account not found.

429Too Many Requests

Rate limit of 2 requests/second exceeded. Check x-sepay-userapi-retry-after header.