SePay API v2 Sandbox

The SePay API v2 Sandbox is a test environment isolated from Production: test the transaction, account, and VA APIs with simulated data, no real bank needed.

||

Sandbox is the SePay API v2 test environment, fully isolated from Production. You test the full set of transaction, bank account, and VA query APIs using simulated data, without touching real transaction data or linking a real bank account. That makes Sandbox a good fit for development, automated testing, and teaching API integration.

Sandbox base URL

The base URL for the SePay API v2 Sandbox environment:

EnvironmentBase URL
Sandboxhttps://userapi-sandbox.sepay.vn/v2

Get a Sandbox token

Create a Sandbox token in API Access while in Test mode on the Dashboard. Production and Sandbox tokens are separate sets, and each one only authenticates on its own environment's base URL.

1. Enable Test mode

On my.sepay.vn, open Test mode in the sidebar and flip the switch on. A yellow Test mode banner at the top confirms you are in the test environment.

Enable Test mode on my.sepay.vn to get a SePay API Sandbox token
Click to expand
Open Test mode in the my.sepay.vn sidebar to enable the test environment

2. Open API Access in Test mode

Go to Company SettingsAPI Access. Every token created here only authenticates on userapi-sandbox.sepay.vn/v2, fully isolated from Production.

API Access page in Test mode for creating a SePay API Sandbox token
Click to expand
The API Access page in Test mode with tokens masked

3. Create and copy the token

Click Create token, name it, and confirm. The token is shown in full only once right after creation, so copy it immediately to a safe place for use in the Authorization: Bearer header.

SePay API v2 Sandbox token shown in full once after creation
Click to expand
The token is shown in full only once, copy it right away to a safe place

For the full walkthrough, see API Access in Test mode.

Transaction, account, and VA data in Sandbox comes from simulated transactions in Test mode, fully isolated from Production.

Call the API on Sandbox

Set the Sandbox base URL userapi-sandbox.sepay.vn/v2 and send your Sandbox Bearer token in the header:

>
>
curl https://userapi-sandbox.sepay.vn/v2/transactions \
-H 'Authorization: Bearer YOUR_SANDBOX_TOKEN'

For how to send the token, the rate limit, and handling 401/429 errors, see Authentication & Rate Limiting.

Order VAs supported on the Sandbox

The entire Order VAs API (BIDV, Sacombank, Vietcombank) is supported on the Sandbox: create orders, VA prefixes, terminals and simulate payments in Test mode.

Switch to Production when ready

Once your Sandbox tests pass, create a Production token in Live mode, update your application config with the new token in place of the Sandbox one, and change the base URL to https://userapi.sepay.vn/v2. The rest of your integration stays the same.