Reading campaigns from GET /discounts
This guide is part of the New Engine Coupon Server integration. Use it when the POS, e-commerce platform, or middleware must read discount campaigns from GET /discounts (and related GET endpoints) and interpret the returned fields before applying a promotion locally.
Scope: discount campaigns evaluated on carts in Coupon Server mode (
apply_discounts: false). Custom events, triggers, and challenge progress belong to points, games, or challenge integrations. For the Coupon Server runtime model and responsibilities, see Coupon Server.
Guide contentsβ
| Page | What it covers |
|---|---|
| GET response | Query parameters, metadata, coupon_info, voucher_info, POS helper fields, and pagination |
| Conditions | rule_conditions: when a cart/customer qualifies |
| Application | rule_application: which cart lines receive the effect |
| Effects | rule_effects: discount type, distribution, limits, and bundle behavior |
Canonical rule modelβ
| Field | Question it answers | Integration role |
|---|---|---|
rule_conditions | Does this customer/cart qualify? | Eligibility: customer, cart, store, payment, products, categories, quantities |
rule_application | Where does the discount land? | Filters the lines or additional costs that receive the effect |
rule_effects | What benefit is granted? | Percentage, fixed amount, ratio, strikethrough, combo price, formula, distribution and limits |
How to read a campaign step by stepβ
- Read metadata and validity:
id,name,active,available_from,available_to,category,currency. - Read event and audience:
when,select_customers,coupon_required,coupon_info, and targetedvoucher_infoif present. - Check company mode: if the company works as a coupon server,
GET /discountscan include POS helper arrays for products and locations. - Parse
rule_conditions: this decides if the cart/customer qualifies. - Parse
rule_application: this decides where the effect applies. - Parse
rule_effects: this decides the discount type, value, distribution, effect limits, and bundle mechanics. - Apply stackability, campaign limits, voucher state, and local pricing logic as agreed for the integration model.
Integration checklistβ
- Use the correct filters on
GET /discounts:customer_id,customer_code,countries,location_id,location_code,campaign_audience,selected, and pagination. - Deserialize
rule_conditions,rule_application, andrule_effectswhen they arrive as JSON strings. - Treat
fieldas authoritative;keyis usually a platform label. - Do not confuse
rule_applicationwith distribution. Distribution is insiderule_effects. - For targeted campaigns, read
coupon_info.voucher_infofor customer-specific code, status, redemptions, selection state, and redemption window. - If POS helper arrays are empty, parse the rule JSON or use your own catalog mapping.
- Compare GET rule configuration with the final
POST /carts/realtimeresponse when debugging differences. - Walk
conditions.and(insiderule_conditions) and subgroups; one failed clause at root AND discards the campaign. - Victory limits (
once,once_limit,budget_*,maximum_discount_transaction) are distinct from effectlimits. category,stackability_properties, andprioritymust match Stackability.