Create
Adds a rule to a campaign. A rule NARROWS what the campaign matches — the order, the items or the audience — so the campaign only rewards when every rule passes.
A rule is a code (which rule) plus params (the values it checks). The three things
that trip people up:
- Each
codeexpects a DIFFERENTparamsformat — cents for amounts, arrays of IDs for categories/brands, an object for tier level. Using the wrong shape silently makes the rule never match. The per-code format is listed underparamsbelow. - Monetary params are in CENTS.
["250001"]on code 1 means R$ 2.500,01 — not 250k. - The rule's SCOPE must match the campaign's
trigger. Codes 1–16 arecampaignscope (normal campaigns). Codes 17–18 aremember-eventscope and only work on a campaign whosetriggerismember-event. Mixing them makes the rule dead weight.
The authoritative list comes from GET /api/loyalty/rule; the table below is a snapshot.
Try-it values populated from environment ACME (Demo)
Authentication
Token
Send your user token in the x-guper-authorization header. Endpoints that
support a Public mode (e.g. acúmulo and resgate previews) accept the same
request without the header — Private mode adds customer data and a
confirmation token to the response.
Headers
Request body
Content-Type:
application/json