Quick Start
Get started with SePay API - query transactions and bank account information in just 5 minutes.
API v1 is no longer being developed. Please use API v2 for new integrations. See the upgrade guide for details.
If you need a test environment, register an account at my.dev.sepay.vn. Here you can create simulated transactions and API calls for development purposes. After registration, please contact SePay to activate your account.
Integration Overview
The diagram below illustrates the API integration flow — from creating an API token to querying bank accounts and transactions.
What can you do with SePay API?
- Bank Accounts — List all linked bank accounts, get account details
- Transactions — List transactions with filters, get transaction details
- Counting — Count transactions and accounts for reporting
Quick Start
Step 1: Create API Token
Access API Settings
Log in to my.sepay.vn → go to Company Settings → API Access.
Add a New API Key
Click the + Add API button, fill in the required information, then click Add.
Copy Your Token
Copy the generated API token. You will use this token in the Authorization header for all API calls.
- Never commit API tokens to source code — use environment variables instead
- Your API Token has full access to all bank account and transaction data
- Only call the API from server-side code — never expose your token in frontend JavaScript or mobile apps
- If you suspect a token has been compromised, delete and create a new one immediately at API Access
Full guide: Create API Token
Step 2: Your First API Call — List Bank Accounts
cURL:
curl -X GET "https://my.sepay.vn/userapi/bankaccounts/list" \-H "Content-Type: application/json" \-H "Authorization: Bearer YOUR_API_TOKEN"
<?php$apiToken = getenv('SEPAY_API_TOKEN');$opts = ['http' => ['method' => 'GET','header' => "Content-Type: application/json\r\nAuthorization: Bearer $apiToken"]];$context = stream_context_create($opts);$response = file_get_contents('https://my.sepay.vn/userapi/bankaccounts/list', false, $context);$data = json_decode($response, true);print_r($data);
Sample response:
{
"status": 200,
"messages": { "success": true },
"bankaccounts": [
{
"id": 123,
"bank_short_name": "Vietcombank",
"bank_full_name": "Joint Stock Commercial Bank for Foreign Trade of Vietnam",
"account_number": "0071000888888",
"account_holder_name": "NGUYEN VAN A",
"accumulated": 19077000,
"last_transaction_date": "2023-05-02 10:30:00"
}
]
}Step 3: List Transactions
cURL:
curl -X GET "https://my.sepay.vn/userapi/transactions/list" \-H "Content-Type: application/json" \-H "Authorization: Bearer YOUR_API_TOKEN"
<?php$apiToken = getenv('SEPAY_API_TOKEN');$opts = ['http' => ['method' => 'GET','header' => "Content-Type: application/json\r\nAuthorization: Bearer $apiToken"]];$context = stream_context_create($opts);$response = file_get_contents('https://my.sepay.vn/userapi/transactions/list', false, $context);$data = json_decode($response, true);print_r($data);
Sample response:
{
"status": 200,
"messages": { "success": true },
"transactions": [
{
"id": 92704,
"bank_brand_name": "Vietcombank",
"account_number": "0071000888888",
"transaction_date": "2023-05-02 10:30:00",
"amount_out": 0,
"amount_in": 2277000,
"accumulated": 19077000,
"transaction_content": "chuyen tien mua hang DH001",
"reference_number": "MBVCB.3278907687",
"code": "DH001",
"sub_account": null,
"bank_account_id": 123
}
]
}Step 4: Get Transaction Details
To retrieve details for a specific transaction, pass the transaction ID:
curl -X GET "https://my.sepay.vn/userapi/transactions/details/92704" \-H "Content-Type: application/json" \-H "Authorization: Bearer YOUR_API_TOKEN"
API Rate Limits
SePay API enforces a rate limit of 3 requests per second per API token.
- When the limit is exceeded, the API returns HTTP status code 429 (Too Many Requests)
- The response header
x-sepay-userapi-retry-afterindicates the number of seconds to wait before retrying
Next Steps
- SePay API Overview — Understand the full API architecture, authentication, and error handling
- Transaction API — Query, filter, and paginate transactions
- Bank Account API — Manage and query linked bank accounts
- VA Order API — Create and manage Virtual Account orders
- SePay Webhooks — Receive real-time transaction notifications via webhooks