Get voucher

Order API v1
GET*base*/vouchers/*id*
Authentication:API key

Return active/inactive voucher by specified Id. Cancelled vouchers are ignored.

Parameters

id

int
required
Voucher id.

xml

boolean
optional
Response in xml format instead of json.

Request example

1
GET <base>/vouchers/1 HTTP/1.1

Response

200 Content-type: application/json

status

string
required
ok if success, else no.

voucher

object
required

The voucher object.

id

int
ID of the voucher.

name

string
Name for the voucher.

code

string
Code of the voucher

startDate

date
The date in Y-m-d format when the voucher starts being active

stopDate

date
The date in Y-m-d format when the voucher stops being active

type

string
Type of the voucher e.g. priceoff, percentoff

value

float
Value of the voucher. Exists for percentoff voucher type

valueByPrcelist

object
Value of the voucher for each price list. Contains id of price list to value. Exists for priceoff voucher type

store

int
Store the voucher is valid for

markets

array
List of the markets voucher is valid for

limit

int
The voucher max usage limit

status

string
Status of the vaucher. One of active, inactive

priority

int
The voucher priority

conversionHtml

string
Conversion html for voucher

createdAt

datetime
The date in Y-m-d H-i-s format when the voucher was created.

Response example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "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"
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
    "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"
    }
}