Coupons
Coupon templates and issued coupons.
Create a coupon template
Creates a coupon template in your wallet along with its pass template. Send the request as `multipart/form-data` with the strip image (`strip`). Returns the created template; then use `POST /coupons/{id}/passes/send` to send coupons to your clients.
List coupon templates
Returns the paginated list of coupon templates in your wallet. You can filter by status, name, promo code, template type (single or multiple instance) and creation date, or run a free-text search.
Update a coupon template
Updates a coupon template and its pass template; coupons already sent are updated accordingly. Accepts `application/json` or `multipart/form-data` (to replace the `strip` image). Warning: if you do not send `expirationDate`, the template's expiration date is cleared.
Delete a coupon template
Permanently deletes a coupon template and its pass template. Returns the deleted template.
Get a coupon template
Returns a coupon template by its ID. Returns `MODEL_NOT_FOUND` if the template does not exist.
List the coupons of a template
Returns the paginated list of coupons sent from a template. By default, only coupons with status `active` or `expired` are returned, newest first.
Send coupons
Sends a coupon to existing clients or to recipients who are not clients. With `clientId`, the client's store card data is used; without `clientId`, `firstName`, `lastName` and `email` are required. Accepts `multipart/form-data` to override the strip image. `webhookUrl` and `forceSync` are optional. Returns a bulk operation: track its status and results with `GET /bulk-operations/{operationId}`.
Get a coupon
Returns a sent coupon, identified by its template and its `instanceId`. Returns `PASS_NOT_FOUND` if no coupon of this template matches.
Update a coupon
Updates the values specific to a sent coupon: `promoCode`, `description`, `value`, `expirationDate` and `bannerOverrideUrl`. Only the fields you send are changed; other values stay those of the coupon or, failing that, of the template. Returns the updated coupon.
Delete a coupon
Permanently deletes a sent coupon. On a multiple-instance template, this call deletes the whole template and all its coupons (see below).
Expire a coupon
Expires a sent coupon immediately: its status becomes `expired` and its expiration date is set to now. Returns the updated coupon, or `PASS_ALREADY_EXPIRED` if it has already expired.
Update the status of a coupon
Allowed statuses: `EXPIRED`, `USED`, `UNUSED`.
List the coupons of a client
Searches sent coupons using the value passed in `clientId`: coupons whose barcode equals this value, or whose first name, last name or email contains it. Only coupons with status `active` or `expired` are returned.
Get coupon statistics for a template
Returns two counters for a coupon template: the number of coupons sent (`countOfSentCouponPasses`) and the number of coupons added to a mobile wallet (`countOfDownloadedPasses`).
Bulk update coupons
Returns a bulk operation: track its status and results with `GET /bulk-operations/{operationId}`.
Bulk delete coupons
Returns a bulk operation: track its status and results with `GET /bulk-operations/{operationId}`.