Skip to main content

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​

PageWhat it covers
GET responseQuery parameters, metadata, coupon_info, voucher_info, POS helper fields, and pagination
Conditionsrule_conditions: when a cart/customer qualifies
Applicationrule_application: which cart lines receive the effect
Effectsrule_effects: discount type, distribution, limits, and bundle behavior

Canonical rule model​

FieldQuestion it answersIntegration role
rule_conditionsDoes this customer/cart qualify?Eligibility: customer, cart, store, payment, products, categories, quantities
rule_applicationWhere does the discount land?Filters the lines or additional costs that receive the effect
rule_effectsWhat benefit is granted?Percentage, fixed amount, ratio, strikethrough, combo price, formula, distribution and limits

How to read a campaign step by step​

  1. Read metadata and validity: id, name, active, available_from, available_to, category, currency.
  2. Read event and audience: when, select_customers, coupon_required, coupon_info, and targeted voucher_info if present.
  3. Check company mode: if the company works as a coupon server, GET /discounts can include POS helper arrays for products and locations.
  4. Parse rule_conditions: this decides if the cart/customer qualifies.
  5. Parse rule_application: this decides where the effect applies.
  6. Parse rule_effects: this decides the discount type, value, distribution, effect limits, and bundle mechanics.
  7. 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, and rule_effects when they arrive as JSON strings.
  • Treat field as authoritative; key is usually a platform label.
  • Do not confuse rule_application with distribution. Distribution is inside rule_effects.
  • For targeted campaigns, read coupon_info.voucher_info for 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/realtime response when debugging differences.
  • Walk conditions.and (inside rule_conditions) and subgroups; one failed clause at root AND discards the campaign.
  • Victory limits (once, once_limit, budget_*, maximum_discount_transaction) are distinct from effect limits.
  • category, stackability_properties, and priority must match Stackability.