Audience by product — how many clients bought a product or category
Clients who bought a given product in a window — matched by product name pattern or SKU — the audience the QON builder can't express, because it has no item, SKU, category or brand column at all. Answers "who bought luggage over $500 this semester", "buyers of these SKUs", in a single call instead of paging hundreds of thousands of line items and grouping client-side.
Match by productNameLike (a list of patterns, OR between them, case- and
accent-insensitive, contains) and/or skuRefId (exact). At least one is
required. Narrow by unit price (unitPriceMin/unitPriceMax) and by pieces
(minQuantity, net of cancellation).
price is the unit price, net of discount — so unitPriceMin/Max filter
the unit directly, not price/quantity. This is what separates a real
product from a 1-cent promo gift in the same family. value is
SUM(price × net quantity) — money spent on the matching items, in cents.
Per row: pieces (net quantity bought), value, lastDate, and
matchedPatterns — which of your productNameLike patterns the client hit,
so you can show why each one is in the audience. The window and lastDate
are in the org timezone. Rows are paginated (e/p); total is the full
audience size.
This is the order side only — client id + metrics. Name, email, phone,
last store and store group live in register; so do the "exclude these lists"
and "must have contact" filters. Enrich and filter with the register operations,
and close the loop with register.audience-list.person.create (which takes the
client ids).
Name matching inherits the POS naming mess. category/categoryRefId come
in empty or inconsistent on some orgs (Cloe included), so name is the reliable
key today — but it carries legacy spellings and external-ref patterns. Widen
productNameLike when in doubt, and read matchedPatterns to see what actually
caught.
Try-it values populated from environment ACME (Demo)
Authentication
Token
Send your user token in the x-guper-authorization header.