Order API - Get Voucher
Get voucher
Endpoint: GET *base*/vouchers/*id*
Authentication: API Key
Return active/inactive voucher by specified ID. Cancelled vouchers are ignored.
Parameters
Voucher id.
Response in xml format instead of json.
Request example
GET <base>/vouchers/1 HTTP/1.1
Response
200
Content-type: application/json
ok
if success, else no
.
The voucher object.
ID of the voucher.
Name for the voucher.
Code of the voucher
The date in Y-m-d
format when the voucher starts being active
The date in Y-m-d
format when the voucher stops being active
Type of the voucher e.g. priceoff
, percentoff
Value of the voucher. Exists for percentoff
voucher type
Value of the voucher for each price list. Contains id of price list to value. Exists for priceoff
voucher type
Store the voucher is valid for
List of the markets voucher is valid for
The voucher max usage limit
Status of the voucher. One of active
, inactive
The voucher priority
Conversion html for voucher
The date in Y-m-d H-i-s
format when the voucher was created.
Response example
{
"status": "ok",
"voucher": {
"id": 1,
"name": "Welcome 10%",
"code": "welcome10",
"conversionHtml": "",
"startDate": "2020-06-26",
"stopDate": "2020-07-09",
"type": "percentoff",
"value": "10",
"store": 1,
"markets": [
1
],
"limit": 1,
"status": "active",
"priority": 1,
"createdAt": "2020-06-25 12:00:00"
}
}
{
"status": "ok",
"voucher": {
"id": 1,
"name": "Welcome 10",
"code": "welcome10",
"conversionHtml": "",
"startDate": "2020-06-26",
"stopDate": "2020-07-09",
"type": "priceoff",
"value": null,
"valueByPricelist": {
"1": 10,
"2": 44,
"3": 13,
"4": 130,
},
"store": 1,
"markets": [
1
],
"limit": 1,
"status": "active",
"priority": 1,
"createdAt": "2020-06-25 12:00:00"
}
}