Skip to main content

New Engine Coupon Server

Use this model when the external system must keep final price calculation, but Loyal Guru remains the source of truth for campaign eligibility, coupon/voucher validation, customer assignment, limits, and redemption state.

Responsibilities​

The split here is the opposite of Promo Engine's, and it is what makes this model heavier to build: Loyal Guru still owns eligibility and redemption state, but the arithmetic moves to your side:

SystemResponsibility
Loyal GuruExposes active campaign rules through GET /discounts, validates coupon/voucher ownership and status, records redemption or rollback.
POS / e-commerceReads campaign fields, maps them to local pricing logic, calculates the final amount, and sends confirmed usage back to Loyal Guru.

What this model covers​

Coupon Server is a coupon and voucher integration. That is its scope at the till, and it is the main trade-off to weigh against Promo Engine.

caution

What the POS calculates, and what it does not. Because your POS owns the calculation, it can only apply what it is able to compute: discounts driven by coupons and vouchers. Points, cashback, games and challenges are not calculated at the till in this model β€” the POS has no rules to evaluate them with.

That does not mean the customer loses them. Points still accrue when the confirmed cart is sent to POST /carts/realtime afterwards β€” Loyal Guru evaluates the loyalty mechanics on the persisted cart, so earning works normally in this model. The difference is when: the customer does not see those effects on the receipt at the moment of payment.

What the POS cannot do is let the customer spend those points. Redeeming points as a cashback discount changes the amount payable, so it has to happen inside the price calculation β€” which in this model your POS owns, and it has no access to the customer's balance or to the distribution rules. A project that needs points redeemed as cashback, or a cashback balance shown on the receipt, requires Promo Engine.

Campaigns come in three audiences, and in this model your POS has to handle them differently:

AudienceAPI valueHow the POS gets it
MASSall_customersRead from GET /discounts and applied to any cart that qualifies
CLUBloyaltyRead from GET /discounts once the customer is identified as a member
TARGETEDtargetedAssigned to one customer as a voucher; read from the customer's voucher list or validated by code

End-to-end flow​

The diagram below places the two sides next to each other: what Loyal Guru exposes and records, and what the POS reads, calculates and confirms. Follow the arrows crossing the boundary β€” each one is an integration point you have to build:

The POS owns the promotional mechanics: it reads active campaign and voucher data, calculates the discount locally, prints or validates the voucher when needed, and confirms usage back to Loyal Guru. Loyal Guru remains the source of truth for Customer identity, campaign eligibility, voucher assignment, limits, and redemption state.

Two activation paths​

The endpoints are the same for every customer. What changes is how the voucher reaches the transaction β€” and in this model that changes which call the POS makes to obtain it. The two paths differ in when the customer activated the voucher and whether the checkout has to name the code, not in where the customer is shopping.

Digital pre-activation β€” the customer chose their vouchers before checkout​

The customer activated their offers in the app or the website before the transaction. The POS identifies the customer and asks Loyal Guru what is active for them in this store β€” no code is presented. This works the same at a till as in e-commerce.

GET /discounts?customer_id={id}&location_id={loc}&selected=true is the load-bearing call on this path, not an optional display step: it is how the POS learns which vouchers to attempt, and it returns the rule JSON the POS needs to calculate them. See Vouchers Pre-Activation for the parameters and the app-side flow that produces the selection.

Individual activation β€” one code at a time at the checkout​

Nothing was activated beforehand. The customer presents a code β€” printed on a receipt or a mailing, or shown on their screen β€” and the POS validates each one before applying it.

Here validation is mandatory, not a courtesy: the POS is about to apply a discount on the strength of a code, and Loyal Guru is the only system that knows whether that code belongs to this customer, is still valid, and has redemptions left.

note

Most retailers run both paths at once, and the POS decides per transaction which one applies: a code was presented, or it was not. The confirmation half β€” redeem, then persist the cart β€” is identical either way.

Supporting data sync​

Before the POS can calculate promotions locally, Loyal Guru needs the data used by campaign rules and audience eligibility:

Data areaIntegration role
CustomersKeep Customer identity and profile fields aligned so vouchers and audiences can be resolved. Legacy integrations that still read/write custom1–custom11 / custom1f–custom8f should migrate to the attributes object β€” see Custom fields β†’ Attributes.
ProductsKeep product IDs, codes, and taxonomy fields aligned with the catalog used by POS pricing logic.
LocationsKeep store/location identifiers aligned with the stores where discounts can apply.
Cart events and linesSend historical and ongoing cart data so Customer behavior, audiences, and usage reporting stay consistent.

These sync flows can use files or APIs depending on project scope. Endpoint-level schemas belong in the API Reference.

Runtime endpoints​

These are the calls a Coupon Server integration makes at runtime, from identifying the customer through to confirming what was applied:

EndpointUse it for
GET /customers/{value} / POST /customers/searchResolve the Customer used to request available campaigns or validate vouchers.
GET /discountsThe main read call on both activation paths. Campaign catalog, customer-specific campaigns, campaign rule fields, coupon metadata and targeted voucher details. Add customer_id + location_id + selected=true for digital pre-activation; use customer_id + location_id and locate the presented code in the response for individual activation. See Vouchers Pre-Activation.
GET /discounts/{value}Campaign detail; use search_by=campaign_history_id when the same targeted campaign was sent more than once.
PUT /vouchers/select / POST /vouchers/{code}/selectMark vouchers as selected for the next purchase. This is normally the customer's action in the app β€” see Vouchers Pre-Activation. Call it from the POS only when the till itself offers a selection step.
PUT /vouchers/deselect / POST /vouchers/{code}/deselectUndo a selection.
POST /vouchers/{code}/freeze / POST /vouchers/{code}/unfreezePut an operational hold on a voucher. A frozen voucher is neither printed nor redeemable until unfrozen.
POST /carts/realtimePersist the confirmed cart and usage with apply_discounts: false. This is also where points and cashback accrue for the transaction.
POST /discounts/redeemConfirm campaign usage when the POS calculated the amount. Send the applied amount in cents. Preferred confirmation call for New Engine Coupon Server.
POST /vouchers/redeem / POST /vouchers/rollbackExplicit voucher lifecycle mark-as-used or rollback. Prefer POST /discounts/redeem for New Engine campaign amount confirmation β€” see Vouchers redeem vs Discounts redeem.
POST /vouchers/printGet the batch of vouchers to print on the receipt, ordered by campaign priority, voucher priority, then soonest expiration.

GET /discounts is paginated: follow next_token_starts_after with starting_after so a customer with many assignments is not silently truncated. When a voucher's product allocation points at an internal category, the POS receives the expanded product_ids by default; receiving the external category as well requires company configuration.

note

GET /customers/{id}/vouchers, GET /customers/{id}/vouchers/selected and GET /vouchers/{code} are deprecated on the current engine. Do not use them in a new integration.

Reading and interpreting GET endpoints​

In Coupon Server mode the POS (or middleware) must read campaign and voucher data from Loyal Guru and interpret it before calculating the final price locally.

EndpointWhat to interpret
GET /discountsActive campaigns, metadata, coupon/voucher info, and rule JSON (rule_conditions, rule_application, rule_effects)
GET /discounts/{value}Single campaign detail (use search_by=campaign_history_id when needed)
GET /discounts with customer_id + location_idCode ownership, status, redemptions and validity before apply β€” read from coupon_info and coupon_info.voucher_info
Customer lookupWhich Customer the campaigns/vouchers belong to

The response of GET /discounts may include:

  • Campaign metadata: id, name, active, available_from, available_to, currency, category, priority.
  • Audience and code metadata: select_customers, coupon_required, coupon_info.
  • Targeted voucher data: coupon_info.voucher_info for customer-specific assignments.
  • Rule JSON: rule_conditions, rule_application, rule_effects.
  • POS helper arrays: product_ids_rule_conditions, product_ids_rule_application, locations_ids, location_codes. The Company must have default_apply_discounts: false (coupon server). If that slug is missing or true, GET does not return these arrays. When the company is a coupon server, each campaign still decides whether to populate them (internal taxonomy vs direct IDs/codes). See POS helper fields.

Full field-by-field guide (nested under this Coupon Server section): Reading from GET β€” response shape, conditions, application, and effects.

Static coupons and vouchers​

Both arrive in the same GET /discounts response, but they mean different things and carry different guarantees:

Code typeHow it behaves
Static couponShared code configured on the campaign. It can be shown publicly or entered manually, subject to campaign limits and configuration.
VoucherCustomer-specific assignment with its own code, status, date window, redemptions, and customer ownership.

Do not treat static coupons and vouchers as interchangeable. A voucher proves that a specific customer received a personalized campaign or benefit; a static coupon is the campaign-level code configuration.

Confirming usage after the POS calculates the price​

After the POS applies the discount locally, confirm usage in Loyal Guru:

  • Prefer POST /discounts/redeem for New Engine Coupon Server so Loyal Guru records the applied amount for budget, limits, and discount history.
  • Do not also call POST /vouchers/redeem for the same confirmation β€” POST /discounts/redeem marks the related voucher as used when applicable.
  • For cart-linked reporting, send or create the cart first, then redeem with cart_id or cart_code.

Full decision guide: Vouchers redeem vs Discounts redeem.

Implementation notes​

  • Cache GET /discounts for a short interval only; campaign availability, budget, limits, and targeted delivery history can change.
  • Always re-check customer-specific vouchers before final application if the checkout flow can last more than a few minutes.
  • When POS helper arrays are empty, parse rule_conditions, rule_application, and rule_effects directly or use your local catalog mapping.
  • Send apply_discounts: false in cart confirmation when the POS has already calculated the final price. The company slug default_apply_discounts must also be false for coupon-server mode (otherwise GET omits POS helper arrays and the engine may still try to calculate discounts).
  • Keep rollback behavior explicit for failed payments, order cancellations, and returns.
  • For campaign amount confirmation on New Engine Coupon Server, use POST /discounts/redeem rather than only POST /vouchers/redeem.
  • Always send the store when reading selected vouchers. Voucher validity is location-scoped: the same activated voucher can be valid in one store and not in another.
  • Send the cart even though you calculated the price yourself. POST /carts/realtime with apply_discounts: false is what feeds audiences, tier calculation, reporting β€” and what accrues the customer's points and cashback for the transaction.
  • Call POST /vouchers/print after the cart is confirmed if the receipt should carry new vouchers. It marks them printed, so the next call returns a different batch.

Troubleshooting​

SymptomWhat to check
A campaign is missing from GET /discountsactive, date window, customer filter, campaign_audience, country/store filters, targeted voucher state, and pagination.
POS helper arrays are emptyCompany default_apply_discounts must be false. If it is, this campaign may use direct IDs/external taxonomy that cannot be expanded β€” parse rule_*.
Voucher appears twice for the same campaignThe campaign may have been sent in multiple deliveries; use campaign_history_id to identify the intended delivery.
POS applies a discount but Loyal Guru rejects the codeCheck voucher ownership, status, available redemptions, store scope, expiration, and whether the static coupon code is unique to the campaign.
Campaign budget / discount history missing after POS applied a discountConfirm the integration calls POST /discounts/redeem with the applied amount in cents, not only POST /vouchers/redeem.