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:

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

Retrieve bank account list

GET
/userapi/bankaccounts/list
Content-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
    NameTypeRequiredDescription
    short_name
    stringNot required
    Bank name corresponding to the short_name field
    last_transaction_date_min
    stringNot required
    Filter accounts with the latest transaction after (>=) this date. Format: yyyy-mm-dd
    last_transaction_date_max
    stringNot required
    Filter accounts with the latest transaction before (<=) this date. Format: yyyy-mm-dd
    since_id
    integerNot required
    Show bank accounts from the specified ID (>=)
    limit
    integerNot required
    Limit the number of returned accounts. Default is 100
    accumulated_min
    numberNot required
    Filter accounts with balance greater than or equal to (>=)
    accumulated_max
    numberNot 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

      cURL
      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"
    • Retrieve bank accounts starting from ID 20

      cURL
      curl -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

      cURL
      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 a balance ≥ 1 VND

      cURL
      curl -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
    NameTypeRequiredDescription
    bank_account_id
    integerRequired
    ID of a bank account

Count total number of bank accounts

GET
/userapi/bankaccounts/count
Authorization: Basic secret_key
Content-Type: application/json
  • Count the total number of existing bank accounts.

    NameTypeRequiredDescription
    short_name
    stringNot required
    Bank name corresponding to the short_name field
    last_transaction_date_min
    stringNot required
    Filter accounts with last transaction after (>=). Format: yyyy-mm-dd
    last_transaction_date_max
    stringNot required
    Filter accounts with last transaction before (<=). Format: yyyy-mm-dd
    since_id
    integerNot required
    Show bank accounts from the specified ID (>=)
    accumulated_min
    numberNot required
    Filter accounts with balance greater than or equal to (>=)
    accumulated_max
    numberNot required
    Filter accounts with balance less than or equal to (<=)
  • Example usage

    • Count total number of bank accounts with balance ≥ 1
      cURL
      curl -X GET "https://my.sepay.vn/userapi/bankaccounts/count?accumulated_min=1" \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer YOUR_API_TOKEN"