Activate coupon¶
Use this endpoint to activate a specific coupon. You have to have the unique coupon code beforehand. For instance, have a database with available coupon barcodes, or have a physical coupon at a till.
Endpoint: /api/v1.0/Switch/Coupon/Activate.
{
"barcode": "string",
"customerReference": "string"
}
barcodeUnique coupon barcodecustomerReferencecustomer reference. When supplied, locks this coupon to this customer. Optional
Response:
{
"success": true,
"activationId": "string",
"coupon": {
"barcode": "string",
"serialNumber": "string",
"couponRangeId": "string",
"createdAt": "2024-12-12T12:47:07.926Z",
"customerReference": "string",
"status": "Active",
"validFrom": "2024-12-12T12:47:07.926Z",
"validTo": "2024-12-12T12:47:07.926Z"
}
}
Cancel¶
Use endpoint /api/v1.0/Switch/Coupon/Activate/Cancel to cancel an activated coupon. This operation is intended for immediate cancellation, e.g. rollback in checkout process.