Skip to main content

Discounts — New Engine Integration

The current engine (LE 2025) supports two integration scopes for discounts. Loyal Guru is always the source of truth for campaign eligibility and rule evaluation; the integration scope only defines who performs the final price calculation.

Integration scopes​

ScopeMain runtime endpointapply_discountsWho calculates the final price?
Promo EnginePOST /carts/simulate, POST /carts/realtimetrueLoyal Guru
Coupon ServerGET /discounts, GET /vouchers/{code}, POST /carts/realtimeUsually falsePOS/external system

Technical flow​

Before implementation​

Confirm these points with the Loyal Guru project team:

  • Whether the company runs as Promo Engine or Coupon Server.
  • Which identifiers the cart lines will send: product_id, product_code, or both.
  • Which store identifier is authoritative: location_id or location_code.
  • Whether coupons are shared static codes, per-customer vouchers, or both.
  • Whether the checkout needs a preview step with POST /carts/simulate.
  • Retry and rollback strategy for network failures, cancellations, and payment rejection.

Rule interpretation (Coupon Server)​

When the external system calculates the final price (Coupon Server), it must read and interpret campaign rules from GET /discounts. That guide lives under Coupon Server → Reading from GET and explains rule_conditions, rule_application, and rule_effects.

Promo Engine integrations do not need to parse those fields for price calculation — Loyal Guru returns calculated effects[] on the cart endpoints.

Confirming redemption​

Coupon Server integrations on the current engine should confirm the applied amount with POST /discounts/redeem. Do not rely on POST /vouchers/redeem alone for campaign budget and discount history. See Vouchers redeem vs Discounts redeem.