# Check Voucher Status
This API call is used to obtain details of the current status of the voucher to ensure it can be redeemed in the shop.
This is step ❶ before redeeming vouchers.
# Needed Information
product_class: reference to the catalogue of products. For our DEMO and UAT environments, the value for this parameter is ETX_001.ref: unique reference displayed on the voucher. Also available on the voucher as a QR or bar code depending on the its design.X-Client-IdandX-Client-Secret: credentials of the shop interacting with the API, see also Authentication.
# Returned Information
product_code: Unique code that identifies the product used to issue the voucher (see as well products).product_label: The name of the product.remaining_value: the remaining amount in cents in the voucher currency for value-based products, the remaining number of products for product-based vouchers.expiration_date: The expiration date for this voucher.links: a list of API links of available actions after this API call.
The main returned information are the remaining_value and expiration_date which are used to validate that the voucher can be redeemed.
product_code and product_label can be used by the merchant to control that the voucher is meant to be redeemed in the shop for the requested item or service.
# Voucher Status
The status of the voucher is active when:
- the API request status is
succeeded - the
remaining_valueis not zero - the
expiration_dateis not in the past
In case the API request status is not succeeded, please retry the request once to ensure no technical error prevents the voucher information to be returned.
# Example of an API Call
# API Endpoint
GET https://api.merchant.demo.uniqrewards.com/v1/vouchers/{product_class}-{ref}
Note that this API call is using the GET method (the others are POST).
# Request Headers
X-Client-Id: a1f64ebc9c4fef739df58f5933ceec94
X-Client-Secret: 1231f6112bbff1b03892306f53281bb0
# Response Body
{
"data": {
"product_code": "MAMVDDMMYY01",
"product_label": "$10 UNIQGIFT Value Based Test Voucher",
"remaining_value": 1000,
"expiration_date": "2024-12-31 23:59:59"
},
"meta": {
"status": "succeeded"
},
"links": [
{
"rel": "authorize",
"href": "/api/transactions"
}
]
}
Note: the sample values in this page are mock-up values. They are not valid credentials and they are not associated to any actual product or voucher.
More details can be found on the Technical Documentation (opens new window).