Sample account
Param name
Value
Note
user_name
sandbox_01
sandbox_02
Use one of them, use other user_name value to test failure case
secure_key
U1iho7QKZUANJj
hOEccESTVClzXm
Use one of them accordingly with user_name
password
ASTFBIEPUrN7MjDvPtiEEDQw1cmEEXKC
O0TeGwUIcJuwJvAyDYC1NYaVvVbRs74N
Use these passwords to decrypt subscription_data in buy-voucher API.Use one of them accordingly with user_name
Example api case
To test scenario 202, please set value of time to 1234567202
Request
Method
Content Type
URL
POST
Application/JSON
https://sandbox.t-plus.vn/api/v1/get-available-vouchers
Params
Param Name (Case-sensitive)
Type
Required
Description
user_name
string
required
user, provided by V-Com
time
integer
required
current timestamp
checksum
string
required
Check sum of transaction
$checksum = base64_encode(hash('sha256', $user_name . $secure_key . $time, true));$secure_key: provided by T-Plus
Note: We use
sha256 with
binary mode, the parameter with "true" indicates this
Response
Status
Code
Response
success
200
{
"data": {
"code": "200",
"status": "success",
"message": "List of vouchers",
"vouchers": [
{
"voucher_id": "znke",
"name": "Voucher A",
"price": 20000,
"desc":"description info",
"publisher": "Grab",
"custom_fields": ["serial","valid_date"],
"secure_fields": ["code"]
},
{
"voucher_id": "ddwa",
"name": "Voucher B",
"price": 50000,
"desc":"description info",
"publisher": "Shopee",
"custom_fields": ["serial","expire_date"],
"secure_fields": ["code","url"]
}
]
}}
* use voucher_id to buy vouchers using buy-voucher api.
fail
202
{"data": { "code": "202", "status": "fail", "message": "vouchers are not available"}}
fail
106
{"errors": {"code": 106, "status": "error", "message": "Parameter is invalid"}}
fail
108
{"errors": {"code": 108, "status": "error", "message": "Request from IP is not allowed"}}
Sample Voucher Response
Field
Value Sample 1
Value Sample 2
voucher_id
S001_SB
G001_SB
name
Shopee voucher for Sandbox
Test Grab Voucher
desc
Shopee voucher info
Grab Voucher info
price
20000
50000
publisher
Shopee
Grab
custom_fields
serial,valid_date
serial,valid_date
secure_fields
code
code,url