Documentation
This section only applies if the module Gift certificate is active.

POST gift/validate

Used for

Function to check gift certificate
There is a limit of 10 gift vouchers to check at once.
If a gift voucher is invalid, it it shown as valid:false.
If it is valid the details are shown of the specific voucher.

Authentication

Requires authentication.

Parameters

Parameter Description Required Example
voucher Array or single voucher Yes ["VOUCHER1", "VOUCHER2"]] of "VOUCHER1"
product_id Product ID to be checked for the voucher validity.
If not specified com_id should be specified.
Nee 1
com_id Combination to be checked for the voucher validity.
If not specified product_idshould be specified.
Nee 2

Response codes

  • 200 OK

EXAMPLE

Validate voucher codes VALIDVOUCHER1, VALIDVOUCHER2 and INVALIDVOUCHER for product 1.

POST api/rest/gift/validate/ 
Request: 
{
  "voucher": ["VALIDVOUCHER1","VALIDVOUCHER2","INVALIDVOUCHER"],
  "product_id": 1
}
Response: 
{
  "VALIDVOUCHER1": {
    "valid": true,
    "validtill": "2024-11-30T00:00:00+0100",
    "percentage": 100,
    "price": "0",
    "currency": "EUR",
    "product_id": "1",
    "combi_id": "0"
  },
  "VALIDVOUCHER2": {
    "valid": true,
    "validtill": "2018-05-31T00:00:00+0200",
    "percentage": 0,
    "price": "10",
    "currency": "EUR",
    "product_id": "1",
    "combi_id": "0"
  },
  "INVALIDVOUCHER": {
    "valid": false
  }
}
The following rights may be necessary in order to use this functionality.