Skip to content

Validate couponΒΆ

This endpoint expects to receive data entered by the visitor of a website. This endpoint will return whether this is a generic or a unique coupon, or neither.

/api/v1.0/Switch/Coupon/Validate

Request:

{
  "barcode": "user-data"
}

Response:

{
  "success": true, // whether the input was recognized
  "couponRangeId": "string", // generic coupon id, use this in Treazure Promo
  "type": "Generic", // generic or unique
  "displayMode": "Number",
  "description": "string",
  "uniqueCoupon": { // populated for unique coupons
    "barcode": "string",
    "serialNumber": "string",
    "couponRangeId": "string",
    "createdAt": "2024-11-20T12:56:02.185Z",
    "customerReference": "string",
    "status": "Created", // unique coupon status
    "validFrom": "2024-11-20T12:56:02.185Z",
    "validTo": "2024-11-20T12:56:02.185Z"
  },
  "errorMessage": "string"
}