Skip to content

Issue coupon

Use the following endpoint to issues a single, unique coupon. This issues a new coupon, you don't have to have the unique coupon barcode beforehand. The issued coupon is Active.

/api/v1.0/Switch/Coupon/Issue

{
  "couponRangeId": "string", // generic coupon code
  "customerReference": "string", // customer reference, optional
  "validFrom": "2024-11-20T12:54:48.967Z",
  "validTo": "2024-11-20T12:54:48.967Z"
}

Properties:

  • couponRangeId Logical coupon id / generic coupon id
  • customerReference customer reference. When supplied, locks this coupon to this customer. Optional

Response:

{
  "success": true,
  "activationId": "string",
  "restrictedToCustomer": true,
  "coupon": {
    "barcode": "string",
    "serialNumber": "string",
    "couponRangeId": "string",
    "createdAt": "2024-12-12T12:44:04.666Z",
    "customerReference": "string",
    "status": "Active",
    "validFrom": "2024-12-12T12:44:04.666Z",
    "validTo": "2024-12-12T12:44:04.666Z"
  }
}

Properties:

  • restrictedToCustomer Whether the coupon was issued as restricted to a specific customer. This is dependent on coupon definition settings.

Cancel coupon issuing

/api/v1.0/Switch/Coupon/Activate/Cancel

Cancels issued coupon. This is the same endpoint as for coupon activation.

This operation is intended for immediate cancellation, e.g. rollback in checkout process.