Description
This API is about to get list of available vouchers which you can buy.
This API must be requested from your server side
Request
Method
Content Type
URL
POST
Application/JSON
https://evoucher.giftz.vn/api/v1/get-available-vouchers
Params
Param Name (Case-sensitive)
Type
Required
Description
user_name
string
required
user, provided by GiftZ
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 GiftZ
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": "G0001_GZ",
"name": "Voucher A",
"price": 20000,
"publisher": "Grab",
"desc" : "description info",
"common_field" : "serial,valid_date",
"secret_field" : "code,url"},
{"voucher_id": "S0001_GZ",
"name": "Voucher B",
"price": 20000,
"publisher": "Shopee",
"desc":"description info",
"common_field" : "serial,valid_date",
"secret_field" : "code"} ] }
}
* 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"}}
Data
data
Desc
Sample data
voucher_id (*)
Voucher ID
"A0001"
name
Voucher Name
"Grab 20K"
desc
Voucher Description
"All Grab Service"
price
Voucher value
"20000"
publisher
Voucher Publisher (Grab/Shopee/Tiki/Lazada......)
"Grab"
common_field (*)
Voucher common field
"serial, valid_date"
secret_field (*)
Voucher secret field
"code,url"
(*) field used in Buy Voucher API
eVoucher Field (for Buy eVoucher API data extraction)
eVoucher Publisher
Common Fields
Secret field (encrypted
Grab
serial, valid_date (yyyy/mm/dd)
code, url
Shopee
serial, valid_date (yyyy/mm/dd)
code
Tiki
serial, valid_date (yyyy/mm/dd)
code
Lazada
serial, valid_date (yyyy/mm/dd)
code
Other APIs