> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/api-reference/events/register-a-transaction-or-custom-event-and-return-the-applied-effects.md).

# Register a transaction or custom event and return the applied effects

Integration\ <br>

Registers a Purchase Transaction or a Custom Event for a member and returns, in the same response, the effects the campaign engine applied. Use `event.type: "transaction"` for a Purchase Transaction; any other value is a Custom Event type and must match a custom event schema registered for the tenant — see `GET /{storeCode}/customEvent/schema/{eventType}/active`.

#### Modes

* **Write** (default) — the event is created and its effects are applied.
* **Dry run** (`dryRun=true`) — nothing is persisted; the response is the same as in write mode.

#### Rate limit

A deployment can limit how many write requests per second are processed synchronously. Dry runs are never limited, and a request rejected with `400` does not count towards the limit.

Above the limit the event is **not** rejected: it is registered and the endpoint answers `202` with the id of the created Transaction or Custom Event. Its effects are applied in the background, so the `202` response carries no `effectsSummary` or other response sections. Read the result from the resource in the `Location` header or from webhooks. Do not resend the request.

The `X-RateLimit-*` headers on write responses show the current state of the limit.

#### Validation errors (`400`)

Besides field-level validation of the event payload, the endpoint answers `400` when:

* `event` or `event.type` is missing, or `event` is not an object;
* `responseContent` contains `null`, an empty string or an unrecognized value;
* `data.header.documentNumber` is already used in the tenant — also when a concurrent request with the same document number commits first (the error is reported on `documentNumber`).

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Events","description":"Synchronous integration endpoint for sending purchase transactions and custom events and receiving the applied loyalty effects in the same response."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\n","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header","description":"Send the admin API key in this header. The `?auth_token=` query parameter is deprecated and is being switched off environment by environment — credentials in URLs land in access logs, proxies and browser history — so do not rely on it.\n"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}}},"schemas":{"EventMemberData":{"properties":{"memberId":{"type":"string","format":"uuid"},"email":{"type":"string","maxLength":255},"phone":{"type":"string","maxLength":255},"loyaltyCardNumber":{"type":"string","maxLength":255}},"type":"object","additionalProperties":false},"PurchaseTransactionEventData":{"required":["items","header"],"properties":{"items":{"description":"The current cart. At least one item is required, unless a dry-run request carries `productsToPrice` — then the list may be empty (the pure product-listing case).","type":"array","minItems":0,"maxItems":100,"items":{"$ref":"#/components/schemas/EventTransactionItem"}},"header":{"$ref":"#/components/schemas/EventTransactionHeader"},"channelId":{"type":"string","format":"uuid"},"productsToPrice":{"description":"Candidate products to price independently against the current cart, in both modes (`event.type: \"transaction\"` only). Same element shape as `items`. At least one entry; the list size is capped per environment and exceeding the cap is a validation error. The response carries one quote per entry, in this order. On a write the transaction is registered as usual and the quotes are priced against the member as they were before this purchase; the cart then needs at least one item. Sending it on a custom event or as an empty list is a validation error.","type":"array","minItems":1,"items":{"$ref":"#/components/schemas/EventTransactionItem"}}},"type":"object","additionalProperties":false},"EventTransactionItem":{"required":["sku","name","grossValue","category"],"properties":{"sku":{"type":"string","maxLength":255},"name":{"type":"string","maxLength":255},"grossValue":{"type":"number","format":"float"},"category":{"type":"string","maxLength":255},"highPrecisionQuantity":{"type":"number","format":"float","description":"Quantity of the line, with up to 3 decimal places. Must be provided."},"maker":{"type":"string","maxLength":255},"labels":{"type":"array","items":{"$ref":"#/components/schemas/TransactionLabelFormType"}}},"type":"object","description":"A basket line. Fields not listed here are ignored."},"TransactionLabelFormType":{"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"EventTransactionHeader":{"required":["documentNumber","purchasedAt"],"properties":{"documentNumber":{"type":"string","maxLength":255},"purchasedAt":{"type":"string","description":"Date and time of the purchase. The timezone offset is optional — both `2026-01-13 11:40:35+01:00` and `2026-01-13 11:40:35` are accepted; a value without an offset is interpreted in the store's timezone."},"documentType":{"type":"string","enum":["sell","return"],"default":"sell"},"linkedDocumentNumber":{"type":"string","description":"Required only when `documentType` is `return`; refers to the original `sell` document."},"purchasePlace":{"type":"string","maxLength":255},"labels":{"type":"array","items":{"$ref":"#/components/schemas/TransactionLabelFormType"}}},"type":"object","additionalProperties":false},"EventResponseContent":{"type":"array","items":{"type":"string","enum":["unitsPerProduct","suggestions","translations"]},"description":"Optional. Opt-in extra response sections, in any combination: `unitsPerProduct` adds the per-line split of granted units, `suggestions` adds the up-sell section, `translations` adds labels for the identifiers the response carries. `unitsPerProduct` and `suggestions` are produced for Purchase Transactions only; on a Custom Event they are accepted and never present. Omitted or empty adds nothing. An unrecognized value, `null` or an empty string is a `400`."},"CustomEventEventData":{"required":["eventDate"],"properties":{"eventDate":{"type":"string","description":"Date and time the event occurred. The timezone offset is optional — both `2026-01-13 11:40:35+01:00` and `2026-01-13 11:40:35` are accepted; a value without an offset is interpreted in the store's timezone."},"eventId":{"type":"string","maxLength":255,"description":"Client-supplied idempotency identifier. A duplicate `eventId` for the same event type is rejected with `400`."},"body":{"type":"object","additionalProperties":true,"description":"Event payload. The accepted fields are defined per tenant by the custom event schema\nregistered for `type`, so this object has no fixed shape.\n\nRetrieve the active schema for an event type via\n`GET /{storeCode}/customEvent/schema/{eventType}/active`.\n\nSupported field types: text, number, boolean, datetime, object (nested), collection.\n\nFields not present in the schema are rejected with `400`.\n"}},"type":"object","additionalProperties":false},"EventResponseEvent":{"required":["eventId","matched","createdAt"],"properties":{"eventId":{"type":"string","format":"uuid","description":"Generated for every request, including `dryRun=true` — never persisted in that mode."},"matched":{"type":"boolean","description":"`true` when a member was resolved from `memberData`. Reflects member resolution only — it does not indicate that any campaign rule matched."},"member":{"$ref":"#/components/schemas/EventResponseMember"},"createdAt":{"type":"string","format":"date-time","description":"Generated for every request, including `dryRun=true` — never persisted in that mode."},"createdBy":{"type":"string"}},"type":"object","additionalProperties":false},"EventResponseMember":{"properties":{"memberId":{"type":"string","format":"uuid"},"email":{"type":"string"},"phone":{"type":"string"},"loyaltyCardNumber":{"type":"string"}},"type":"object","additionalProperties":false},"EventEffectsSummary":{"properties":{"givenUnits":{"type":"array","items":{"$ref":"#/components/schemas/EventWalletUnits"}},"deductedUnits":{"type":"array","items":{"$ref":"#/components/schemas/EventWalletUnits"}},"givenRewards":{"type":"array","items":{"$ref":"#/components/schemas/EventGivenReward"}},"assignedMemberCustomAttributes":{"type":"array","items":{"$ref":"#/components/schemas/EventLabel"}},"removedMemberCustomAttributes":{"type":"array","items":{"$ref":"#/components/schemas/EventLabel"}},"grantedBadges":{"type":"array","items":{"$ref":"#/components/schemas/EventGrantedBadge"}},"assignedTiers":{"type":"array","items":{"$ref":"#/components/schemas/EventAssignedTier"},"description":"One entry per tier the campaign engine assigned the member to, identified by the tier set\nit belongs to and the tier itself. A campaign can move a member within several tier sets in\none event, so the array may hold more than one entry; it reports the assignment only, never\nthe tier the member held before.\n"}},"type":"object","additionalProperties":false},"EventWalletUnits":{"properties":{"walletCode":{"type":"string"},"units":{"type":"number","format":"float"}},"type":"object","additionalProperties":false},"EventGivenReward":{"properties":{"rewardId":{"type":"string","format":"uuid"},"couponValue":{"type":"number","format":"float"}},"type":"object","additionalProperties":false},"EventLabel":{"required":["key"],"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object","additionalProperties":false},"EventGrantedBadge":{"required":["badgeSystemCode"],"properties":{"badgeSystemCode":{"type":"string"}},"type":"object","additionalProperties":false},"EventAssignedTier":{"required":["tierSetId","tierId"],"properties":{"tierSetId":{"type":"string","format":"uuid"},"tierId":{"type":"string","format":"uuid"}},"type":"object","additionalProperties":false},"EventChallengeProgress":{"required":["campaignId","previousCompletedCount","completedCount","completed","limitReached","milestones"],"properties":{"campaignId":{"type":"string","format":"uuid","description":"Identifier of the challenge campaign."},"previousCompletedCount":{"type":"integer","description":"How many times the member had completed this challenge before the event."},"completedCount":{"type":"integer","description":"How many times the member has completed this challenge after the event."},"completed":{"type":"boolean","description":"`true` when this event completed the challenge, i.e. `completedCount` grew."},"limitReached":{"type":"boolean","description":"`true` when the challenge's completion limit is reached after this event."},"milestones":{"type":"array","items":{"$ref":"#/components/schemas/EventMilestoneProgress"},"description":"Per-milestone state after the event."}},"type":"object","additionalProperties":false,"description":"One entry per challenge progression the event produced. An event that completes a challenge\nseveral times in one go (surplus re-run) produces one entry per completion, with\n`previousCompletedCount`/`completedCount` advancing `0→1`, `1→2`, `2→3`.\n\nOnly the member the event belongs to is reported; a referrer's challenge progress is never part\nof this response. Campaigns whose activity window is closed at the event time are evaluated but\nnot reported.\n"},"EventMilestoneProgress":{"required":["milestoneId","currentValue","goal"],"properties":{"milestoneId":{"type":"string","format":"uuid","description":"Identifier of the challenge milestone (rule) this entry describes."},"currentValue":{"type":"number","format":"float","description":"Aggregated value of the current period after the event was applied. Resets to `0` when the\nmilestone period completes, so a completed milestone reports `0` here and the completion in\n`completedCount` of the parent entry.\n"},"goal":{"type":"number","format":"float","description":"Value the current period has to reach for the milestone to complete."},"completedConsecutivePeriods":{"type":"integer","nullable":true,"description":"Consecutive periods completed so far. Only set for milestones with a consecutive-period completion rule."},"consecutivePeriods":{"type":"integer","nullable":true,"description":"Consecutive periods the milestone requires. Only set for milestones with a consecutive-period completion rule."}},"type":"object","additionalProperties":false},"EventUnitsPerProductEntry":{"required":["campaignId","walletCode","units","lines"],"properties":{"campaignId":{"type":"string","format":"uuid","description":"Id of the campaign whose effect produced this entry. A campaign with two `give_points` rules yields two entries sharing the same `campaignId`."},"walletCode":{"type":"string","description":"Wallet code the effect granted units to."},"units":{"type":"number","format":"float","description":"Units the effect granted. Equals the sum of `lines[].units`, up to float rounding."},"lines":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/EventUnitsPerProductLine"},"description":"The basket lines that earned these units, in `event.data.items[]` order."}},"type":"object","additionalProperties":false,"description":"Purchase transactions only. One entry per granted `give_points` effect of a campaign built on `unitsRule`. Legacy `pointsRule` campaigns, other effect types, and refused or failed effects never produce an entry."},"EventUnitsPerProductLine":{"required":["lineIndex","sku","units"],"properties":{"lineIndex":{"type":"integer","description":"Index of the line in the request's `event.data.items[]`. This is the line's identity — the same SKU appearing on two lines is reported as two separate line objects, never merged."},"sku":{"type":"string","description":"The line's SKU, repeated here for convenience so it need not be looked up by index."},"units":{"type":"number","format":"float","description":"This line's share of the entry's `units`, always greater than 0. A line that earned nothing is absent from `lines` rather than reported as zero."}},"type":"object","additionalProperties":false},"EventSuggestion":{"required":["campaignId","missing","wouldEarn"],"properties":{"campaignId":{"type":"string","format":"uuid","description":"Id of the campaign whose rule was missed. One campaign can appear more than once, when several of its rules were near misses — the entries are then distinct suggestions sharing a `campaignId`."},"missing":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/EventSuggestionMissing"},"description":"Every unmet condition of the missed rule, one entry per condition. The entry's `type` selects its shape; read the fields listed for that `type` and ignore the rest."},"wouldEarn":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/EventSuggestionWouldEarn"},"description":"What the member would additionally receive once every `missing` entry is closed, projected against this event."}},"type":"object","additionalProperties":false,"description":"One near miss: a campaign rule this event did not satisfy, whose every unmet condition could be explained, together with the payout closing it would unlock."},"EventSuggestionMissing":{"oneOf":[{"$ref":"#/components/schemas/EventSuggestionMissingTransactionAmount"},{"$ref":"#/components/schemas/EventSuggestionMissingTransactionQuantity"},{"$ref":"#/components/schemas/EventSuggestionMissingTransactionLines"},{"$ref":"#/components/schemas/EventSuggestionMissingProductSetSku"},{"$ref":"#/components/schemas/EventSuggestionMissingProductSetCategory"},{"$ref":"#/components/schemas/EventSuggestionMissingProductSetCategoryExcluded"},{"$ref":"#/components/schemas/EventSuggestionMissingProductSetBrand"},{"$ref":"#/components/schemas/EventSuggestionMissingProductSetName"},{"$ref":"#/components/schemas/EventSuggestionMissingProductSetLabel"},{"$ref":"#/components/schemas/EventSuggestionMissingProductSetCollection"},{"$ref":"#/components/schemas/EventSuggestionMissingProductSetFilter"},{"$ref":"#/components/schemas/EventSuggestionMissingProductSetCatalogCategory"},{"$ref":"#/components/schemas/EventSuggestionMissingProductSetCatalogBrand"},{"$ref":"#/components/schemas/EventSuggestionMissingProductSetCatalogAttribute"},{"$ref":"#/components/schemas/EventSuggestionMissingBundle"},{"$ref":"#/components/schemas/EventSuggestionMissingDocumentType"},{"$ref":"#/components/schemas/EventSuggestionMissingDocumentNumber"},{"$ref":"#/components/schemas/EventSuggestionMissingChannelId"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberEmail"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberFirstName"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberLastName"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberPhone"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberGender"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberLoyaltyCardNumber"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberLegalConsent"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberMarketingConsent"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberDataProcessingConsent"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberTierId"},{"$ref":"#/components/schemas/EventSuggestionMissingPurchasedAt"},{"$ref":"#/components/schemas/EventSuggestionMissingCreatedAt"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberBirthDate"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberRegisteredDate"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberFirstTransactionDate"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberLastTransactionDate"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberTierAchievementDate"},{"$ref":"#/components/schemas/EventSuggestionMissingTransactionLabel"},{"$ref":"#/components/schemas/EventSuggestionMissingRequiredItemLabel"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberWalletBalance"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberBadge"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberTiers"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberSegments"},{"$ref":"#/components/schemas/EventSuggestionMissingMemberLabel"}],"discriminator":{"propertyName":"type","mapping":{"transactionAmount":"#/components/schemas/EventSuggestionMissingTransactionAmount","transactionQuantity":"#/components/schemas/EventSuggestionMissingTransactionQuantity","transactionLines":"#/components/schemas/EventSuggestionMissingTransactionLines","productSetSku":"#/components/schemas/EventSuggestionMissingProductSetSku","productSetCategory":"#/components/schemas/EventSuggestionMissingProductSetCategory","productSetCategoryExcluded":"#/components/schemas/EventSuggestionMissingProductSetCategoryExcluded","productSetBrand":"#/components/schemas/EventSuggestionMissingProductSetBrand","productSetName":"#/components/schemas/EventSuggestionMissingProductSetName","productSetLabel":"#/components/schemas/EventSuggestionMissingProductSetLabel","productSetCollection":"#/components/schemas/EventSuggestionMissingProductSetCollection","productSetFilter":"#/components/schemas/EventSuggestionMissingProductSetFilter","productSetCatalogCategory":"#/components/schemas/EventSuggestionMissingProductSetCatalogCategory","productSetCatalogBrand":"#/components/schemas/EventSuggestionMissingProductSetCatalogBrand","productSetCatalogAttribute":"#/components/schemas/EventSuggestionMissingProductSetCatalogAttribute","bundle":"#/components/schemas/EventSuggestionMissingBundle","documentType":"#/components/schemas/EventSuggestionMissingDocumentType","documentNumber":"#/components/schemas/EventSuggestionMissingDocumentNumber","channelId":"#/components/schemas/EventSuggestionMissingChannelId","memberEmail":"#/components/schemas/EventSuggestionMissingMemberEmail","memberFirstName":"#/components/schemas/EventSuggestionMissingMemberFirstName","memberLastName":"#/components/schemas/EventSuggestionMissingMemberLastName","memberPhone":"#/components/schemas/EventSuggestionMissingMemberPhone","memberGender":"#/components/schemas/EventSuggestionMissingMemberGender","memberLoyaltyCardNumber":"#/components/schemas/EventSuggestionMissingMemberLoyaltyCardNumber","memberLegalConsent":"#/components/schemas/EventSuggestionMissingMemberLegalConsent","memberMarketingConsent":"#/components/schemas/EventSuggestionMissingMemberMarketingConsent","memberDataProcessingConsent":"#/components/schemas/EventSuggestionMissingMemberDataProcessingConsent","memberTierId":"#/components/schemas/EventSuggestionMissingMemberTierId","purchasedAt":"#/components/schemas/EventSuggestionMissingPurchasedAt","createdAt":"#/components/schemas/EventSuggestionMissingCreatedAt","memberBirthDate":"#/components/schemas/EventSuggestionMissingMemberBirthDate","memberRegisteredDate":"#/components/schemas/EventSuggestionMissingMemberRegisteredDate","memberFirstTransactionDate":"#/components/schemas/EventSuggestionMissingMemberFirstTransactionDate","memberLastTransactionDate":"#/components/schemas/EventSuggestionMissingMemberLastTransactionDate","memberTierAchievementDate":"#/components/schemas/EventSuggestionMissingMemberTierAchievementDate","transactionLabel":"#/components/schemas/EventSuggestionMissingTransactionLabel","requiredItemLabel":"#/components/schemas/EventSuggestionMissingRequiredItemLabel","memberWalletBalance":"#/components/schemas/EventSuggestionMissingMemberWalletBalance","memberBadgeCompletions":"#/components/schemas/EventSuggestionMissingMemberBadge","memberTiers":"#/components/schemas/EventSuggestionMissingMemberTiers","memberSegments":"#/components/schemas/EventSuggestionMissingMemberSegments","memberLabels":"#/components/schemas/EventSuggestionMissingMemberLabel"}},"description":"One unmet condition of a missed rule. `type` is the discriminator — 42 values, each with its own\nschema, in three families:\n\n- **Actionable** (`transactionAmount`, `transactionQuantity`, `transactionLines`, the eleven\n  `productSet*` types and `bundle`) — a numeric gap a purchase can move. `required` / `current` /\n  `operator` say exactly how much more of what closes the rule.\n- **Informational, transaction-scoped** (`documentType`, `documentNumber`, `channelId`,\n  `purchasedAt`, `createdAt`, `transactionLabel`, `requiredItemLabel`) — the event fails a\n  condition no larger basket can close. `expected` / `current` name the value(s) that would\n  satisfy it; there is no \"how much more\".\n- **Member-scoped** (the twenty `member*` types) — the rule fails on who the member is or what they\n  hold, not on the cart. Either a numeric balance gap (`memberWalletBalance`,\n  `memberBadgeCompletions`) or an informational expectation (everything else).\n\nNull fields are omitted from the payload rather than sent as `null`, so check a key's presence,\nnot its value.\n"},"EventSuggestionMissingTransactionAmount":{"title":"transactionAmount","required":["type","required","current","operator"],"properties":{"type":{"type":"string","enum":["transactionAmount"]},"required":{"type":"number","format":"float","description":"The gross value the rule requires."},"current":{"type":"number","format":"float","description":"The transaction's own gross value, which is not necessarily the sum of `items[].grossValue`."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."}},"type":"object","additionalProperties":false,"description":"Actionable. `transactionAmount`: the transaction's gross value is below what the rule requires. The member closes it by adding `required - current` more gross value to the basket (a little more still, for `gt`)."},"EventSuggestionMissingTransactionQuantity":{"title":"transactionQuantity","required":["type","required","current","operator"],"properties":{"type":{"type":"string","enum":["transactionQuantity"]},"required":{"type":"number","format":"float","description":"The summed item quantity the rule requires."},"current":{"type":"number","format":"float","description":"The summed quantity of the basket items."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."}},"type":"object","additionalProperties":false,"description":"Actionable. `transactionQuantity`: the summed quantity of the basket items is below what the rule requires. The member closes it by adding `required - current` more items to the basket (a little more still, for `gt`)."},"EventSuggestionMissingTransactionLines":{"title":"transactionLines","required":["type","required","current","operator"],"properties":{"type":{"type":"string","enum":["transactionLines"]},"required":{"type":"number","format":"float","description":"The number of basket lines the rule requires."},"current":{"type":"number","format":"float","description":"The number of lines in the basket."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."}},"type":"object","additionalProperties":false,"description":"Actionable. `transactionLines`: the number of basket lines is below what the rule requires. The member closes it by adding `required - current` more lines to the basket (a little more still, for `gt`)."},"EventSuggestionMissingProductSetSku":{"title":"productSetSku","required":["type","required","current","unit","operator","sku"],"properties":{"type":{"type":"string","enum":["productSetSku"]},"required":{"type":"number","format":"float","description":"The threshold the rule compares against, in `unit`."},"current":{"type":"number","format":"float","description":"What the event's basket already contributes to the set, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count: item quantity, gross value or basket lines. Always present — the same set can be measured any of the three ways."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."},"sku":{"type":"string","description":"The SKU of the items the set counts."}},"type":"object","additionalProperties":false,"description":"Actionable. `productSetSku`: a numeric gap on the items with the SKU `sku`. The member closes it by adding `required - current` more `unit` of that set."},"EventSuggestionMissingProductSetCategory":{"title":"productSetCategory","required":["type","required","current","unit","operator","category"],"properties":{"type":{"type":"string","enum":["productSetCategory"]},"required":{"type":"number","format":"float","description":"The threshold the rule compares against, in `unit`."},"current":{"type":"number","format":"float","description":"What the event's basket already contributes to the set, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count: item quantity, gross value or basket lines. Always present — the same set can be measured any of the three ways."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."},"category":{"type":"string","description":"The category whose items the set counts."}},"type":"object","additionalProperties":false,"description":"Actionable. `productSetCategory`: a numeric gap on the items in the category `category`. The member closes it by adding `required - current` more `unit` of that set."},"EventSuggestionMissingProductSetCategoryExcluded":{"title":"productSetCategoryExcluded","required":["type","required","current","unit","operator","category"],"properties":{"type":{"type":"string","enum":["productSetCategoryExcluded"]},"required":{"type":"number","format":"float","description":"The threshold the rule compares against, in `unit`."},"current":{"type":"number","format":"float","description":"What the event's basket already contributes to the set, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count: item quantity, gross value or basket lines. Always present — the same set can be measured any of the three ways."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."},"category":{"type":"string","description":"The category the set excludes — only items outside it count."}},"type":"object","additionalProperties":false,"description":"Actionable. `productSetCategoryExcluded`: a numeric gap on the items **outside** the category `category`. The member closes it by adding `required - current` more `unit` of that set."},"EventSuggestionMissingProductSetBrand":{"title":"productSetBrand","required":["type","required","current","unit","operator","brand"],"properties":{"type":{"type":"string","enum":["productSetBrand"]},"required":{"type":"number","format":"float","description":"The threshold the rule compares against, in `unit`."},"current":{"type":"number","format":"float","description":"What the event's basket already contributes to the set, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count: item quantity, gross value or basket lines. Always present — the same set can be measured any of the three ways."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."},"brand":{"type":"string","description":"The brand whose items the set counts."}},"type":"object","additionalProperties":false,"description":"Actionable. `productSetBrand`: a numeric gap on the items of the brand `brand`. The member closes it by adding `required - current` more `unit` of that set."},"EventSuggestionMissingProductSetName":{"title":"productSetName","required":["type","required","current","unit","operator","name"],"properties":{"type":{"type":"string","enum":["productSetName"]},"required":{"type":"number","format":"float","description":"The threshold the rule compares against, in `unit`."},"current":{"type":"number","format":"float","description":"What the event's basket already contributes to the set, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count: item quantity, gross value or basket lines. Always present — the same set can be measured any of the three ways."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."},"name":{"type":"string","description":"The product name of the items the set counts."}},"type":"object","additionalProperties":false,"description":"Actionable. `productSetName`: a numeric gap on the items with the product name `name`. The member closes it by adding `required - current` more `unit` of that set."},"EventSuggestionMissingProductSetLabel":{"title":"productSetLabel","required":["type","required","current","unit","operator","labelKey"],"properties":{"type":{"type":"string","enum":["productSetLabel"]},"required":{"type":"number","format":"float","description":"The threshold the rule compares against, in `unit`."},"current":{"type":"number","format":"float","description":"What the event's basket already contributes to the set, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count: item quantity, gross value or basket lines. Always present — the same set can be measured any of the three ways."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."},"labelKey":{"type":"string","description":"The key of the item custom attribute the set requires."},"labelValue":{"type":"string","description":"The value `labelKey` must take. Absent when the rule matches the key regardless of value."}},"type":"object","additionalProperties":false,"description":"Actionable. `productSetLabel`: a numeric gap on the items carrying the custom attribute `labelKey`, with the value `labelValue` when present. The member closes it by adding `required - current` more `unit` of that set."},"EventSuggestionMissingProductSetCollection":{"title":"productSetCollection","required":["type","required","current","unit","operator","valueGroupId"],"properties":{"type":{"type":"string","enum":["productSetCollection"]},"required":{"type":"number","format":"float","description":"The threshold the rule compares against, in `unit`."},"current":{"type":"number","format":"float","description":"What the event's basket already contributes to the set, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count: item quantity, gross value or basket lines. Always present — the same set can be measured any of the three ways."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."},"valueGroupId":{"type":"string","format":"uuid","description":"The group of values (collection) the set draws on."},"filterCode":{"type":"string","description":"The code of the campaign-level item filter that narrows the collection. Absent when the collection is not narrowed."}},"type":"object","additionalProperties":false,"description":"Actionable. `productSetCollection`: a numeric gap on the items from the collection `valueGroupId`, narrowed by the item filter `filterCode` when present. The member closes it by adding `required - current` more `unit` of that set."},"EventSuggestionMissingProductSetFilter":{"title":"productSetFilter","required":["type","required","current","unit","operator","filterCode"],"properties":{"type":{"type":"string","enum":["productSetFilter"]},"required":{"type":"number","format":"float","description":"The threshold the rule compares against, in `unit`."},"current":{"type":"number","format":"float","description":"What the event's basket already contributes to the set, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count: item quantity, gross value or basket lines. Always present — the same set can be measured any of the three ways."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."},"filterCode":{"type":"string","description":"The code of the campaign-level item filter that selects the set."}},"type":"object","additionalProperties":false,"description":"Actionable. `productSetFilter`: a numeric gap on the items selected by the item filter `filterCode`. The member closes it by adding `required - current` more `unit` of that set."},"EventSuggestionMissingProductSetCatalogCategory":{"title":"productSetCatalogCategory","required":["type","required","current","unit","operator","catalogCategory"],"properties":{"type":{"type":"string","enum":["productSetCatalogCategory"]},"required":{"type":"number","format":"float","description":"The threshold the rule compares against, in `unit`."},"current":{"type":"number","format":"float","description":"What the event's basket already contributes to the set, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count: item quantity, gross value or basket lines. Always present — the same set can be measured any of the three ways."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."},"catalogCategory":{"type":"string","description":"The Product Catalog category whose items the set counts."}},"type":"object","additionalProperties":false,"description":"Actionable. `productSetCatalogCategory`: a numeric gap on the items in the Product Catalog category `catalogCategory`. The member closes it by adding `required - current` more `unit` of that set."},"EventSuggestionMissingProductSetCatalogBrand":{"title":"productSetCatalogBrand","required":["type","required","current","unit","operator","catalogBrand"],"properties":{"type":{"type":"string","enum":["productSetCatalogBrand"]},"required":{"type":"number","format":"float","description":"The threshold the rule compares against, in `unit`."},"current":{"type":"number","format":"float","description":"What the event's basket already contributes to the set, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count: item quantity, gross value or basket lines. Always present — the same set can be measured any of the three ways."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."},"catalogBrand":{"type":"string","description":"The Product Catalog brand whose items the set counts."}},"type":"object","additionalProperties":false,"description":"Actionable. `productSetCatalogBrand`: a numeric gap on the items of the Product Catalog brand `catalogBrand`. The member closes it by adding `required - current` more `unit` of that set."},"EventSuggestionMissingProductSetCatalogAttribute":{"title":"productSetCatalogAttribute","required":["type","required","current","unit","operator","attributeKey"],"properties":{"type":{"type":"string","enum":["productSetCatalogAttribute"]},"required":{"type":"number","format":"float","description":"The threshold the rule compares against, in `unit`."},"current":{"type":"number","format":"float","description":"What the event's basket already contributes to the set, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count: item quantity, gross value or basket lines. Always present — the same set can be measured any of the three ways."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` exactly closes the condition; `gt` means it must be strictly exceeded."},"attributeKey":{"type":"string","description":"The Product Catalog attribute key the set requires."},"attributeValue":{"type":"string","description":"The value `attributeKey` must take. Absent when the rule matches the key regardless of value."}},"type":"object","additionalProperties":false,"description":"Actionable. `productSetCatalogAttribute`: a numeric gap on the items whose Product Catalog attribute `attributeKey` has the value `attributeValue`. The member closes it by adding `required - current` more `unit` of that set."},"EventSuggestionMissingBundle":{"title":"bundle","required":["type","lineTargetCode","setsRequired","setsCurrent","operator","parts"],"properties":{"type":{"type":"string","enum":["bundle"]},"lineTargetCode":{"type":"string","description":"Code of the line target that defines the bundle."},"setsRequired":{"type":"number","format":"float","description":"How many complete sets of the bundle the rule requires."},"setsCurrent":{"type":"number","format":"float","description":"How many complete sets the basket already forms."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means forming `setsRequired` complete sets closes the condition; `gt` means more sets than that are needed."},"parts":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/EventSuggestionMissingBundlePart"},"description":"Only the parts that are still short, ascending by `partIndex`; a part that already supplies enough for the missing sets is not listed."}},"type":"object","additionalProperties":false,"description":"Actionable. `bundle`: a bundle line target whose parts do not yet form the required number of complete sets. Carries a set count plus `parts[]` naming what each deficient part still needs."},"EventSuggestionMissingBundlePart":{"oneOf":[{"$ref":"#/components/schemas/EventSuggestionMissingBundlePartAnyProduct"},{"$ref":"#/components/schemas/EventSuggestionMissingBundlePartSku"},{"$ref":"#/components/schemas/EventSuggestionMissingBundlePartCategory"},{"$ref":"#/components/schemas/EventSuggestionMissingBundlePartCategoryExcluded"},{"$ref":"#/components/schemas/EventSuggestionMissingBundlePartBrand"},{"$ref":"#/components/schemas/EventSuggestionMissingBundlePartName"},{"$ref":"#/components/schemas/EventSuggestionMissingBundlePartLabel"},{"$ref":"#/components/schemas/EventSuggestionMissingBundlePartCollection"},{"$ref":"#/components/schemas/EventSuggestionMissingBundlePartFilter"},{"$ref":"#/components/schemas/EventSuggestionMissingBundlePartCatalogCategory"},{"$ref":"#/components/schemas/EventSuggestionMissingBundlePartCatalogBrand"},{"$ref":"#/components/schemas/EventSuggestionMissingBundlePartCatalogAttribute"}],"description":"One deficient part of a `bundle` entry: what that part still needs for the missing sets to form. `type` names the part's product set; a part that matches any product carries no `type`."},"EventSuggestionMissingBundlePartAnyProduct":{"title":"Any product","required":["partIndex","required","current","unit"],"properties":{"partIndex":{"type":"integer","minimum":0,"description":"Zero-based position of this part in the bundle definition, so the gap can be matched back to the part the admin configured. Indexes of satisfied parts are simply missing from `parts[]`."},"required":{"type":"number","format":"float","description":"How much of this part the still-missing sets need, in `unit`."},"current":{"type":"number","format":"float","description":"How much of this part the basket already supplies, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count. Bundle parts are measured in `quantity` today."}},"type":"object","additionalProperties":false,"description":"One deficient part of a `bundle` entry that has no filter and matches any product, so it carries no `type` and no identifying field: what that part still needs for the missing sets to form."},"EventSuggestionMissingBundlePartSku":{"title":"SKU","required":["partIndex","type","required","current","unit","sku"],"properties":{"partIndex":{"type":"integer","minimum":0,"description":"Zero-based position of this part in the bundle definition, so the gap can be matched back to the part the admin configured. Indexes of satisfied parts are simply missing from `parts[]`."},"type":{"type":"string","enum":["productSetSku"]},"required":{"type":"number","format":"float","description":"How much of this part the still-missing sets need, in `unit`."},"current":{"type":"number","format":"float","description":"How much of this part the basket already supplies, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count. Bundle parts are measured in `quantity` today."},"sku":{"type":"string","description":"The SKU of the items the set counts."}},"type":"object","additionalProperties":false,"description":"One deficient part of a `bundle` entry, drawing on the items with the SKU `sku`: what that part still needs for the missing sets to form."},"EventSuggestionMissingBundlePartCategory":{"title":"Category","required":["partIndex","type","required","current","unit","category"],"properties":{"partIndex":{"type":"integer","minimum":0,"description":"Zero-based position of this part in the bundle definition, so the gap can be matched back to the part the admin configured. Indexes of satisfied parts are simply missing from `parts[]`."},"type":{"type":"string","enum":["productSetCategory"]},"required":{"type":"number","format":"float","description":"How much of this part the still-missing sets need, in `unit`."},"current":{"type":"number","format":"float","description":"How much of this part the basket already supplies, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count. Bundle parts are measured in `quantity` today."},"category":{"type":"string","description":"The category whose items the set counts."}},"type":"object","additionalProperties":false,"description":"One deficient part of a `bundle` entry, drawing on the items in the category `category`: what that part still needs for the missing sets to form."},"EventSuggestionMissingBundlePartCategoryExcluded":{"title":"Category excluded","required":["partIndex","type","required","current","unit","category"],"properties":{"partIndex":{"type":"integer","minimum":0,"description":"Zero-based position of this part in the bundle definition, so the gap can be matched back to the part the admin configured. Indexes of satisfied parts are simply missing from `parts[]`."},"type":{"type":"string","enum":["productSetCategoryExcluded"]},"required":{"type":"number","format":"float","description":"How much of this part the still-missing sets need, in `unit`."},"current":{"type":"number","format":"float","description":"How much of this part the basket already supplies, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count. Bundle parts are measured in `quantity` today."},"category":{"type":"string","description":"The category the set excludes — only items outside it count."}},"type":"object","additionalProperties":false,"description":"One deficient part of a `bundle` entry, drawing on the items **outside** the category `category`: what that part still needs for the missing sets to form."},"EventSuggestionMissingBundlePartBrand":{"title":"Brand","required":["partIndex","type","required","current","unit","brand"],"properties":{"partIndex":{"type":"integer","minimum":0,"description":"Zero-based position of this part in the bundle definition, so the gap can be matched back to the part the admin configured. Indexes of satisfied parts are simply missing from `parts[]`."},"type":{"type":"string","enum":["productSetBrand"]},"required":{"type":"number","format":"float","description":"How much of this part the still-missing sets need, in `unit`."},"current":{"type":"number","format":"float","description":"How much of this part the basket already supplies, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count. Bundle parts are measured in `quantity` today."},"brand":{"type":"string","description":"The brand whose items the set counts."}},"type":"object","additionalProperties":false,"description":"One deficient part of a `bundle` entry, drawing on the items of the brand `brand`: what that part still needs for the missing sets to form."},"EventSuggestionMissingBundlePartName":{"title":"Product name","required":["partIndex","type","required","current","unit","name"],"properties":{"partIndex":{"type":"integer","minimum":0,"description":"Zero-based position of this part in the bundle definition, so the gap can be matched back to the part the admin configured. Indexes of satisfied parts are simply missing from `parts[]`."},"type":{"type":"string","enum":["productSetName"]},"required":{"type":"number","format":"float","description":"How much of this part the still-missing sets need, in `unit`."},"current":{"type":"number","format":"float","description":"How much of this part the basket already supplies, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count. Bundle parts are measured in `quantity` today."},"name":{"type":"string","description":"The product name of the items the set counts."}},"type":"object","additionalProperties":false,"description":"One deficient part of a `bundle` entry, drawing on the items with the product name `name`: what that part still needs for the missing sets to form."},"EventSuggestionMissingBundlePartLabel":{"title":"Item label","required":["partIndex","type","required","current","unit","labelKey"],"properties":{"partIndex":{"type":"integer","minimum":0,"description":"Zero-based position of this part in the bundle definition, so the gap can be matched back to the part the admin configured. Indexes of satisfied parts are simply missing from `parts[]`."},"type":{"type":"string","enum":["productSetLabel"]},"required":{"type":"number","format":"float","description":"How much of this part the still-missing sets need, in `unit`."},"current":{"type":"number","format":"float","description":"How much of this part the basket already supplies, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count. Bundle parts are measured in `quantity` today."},"labelKey":{"type":"string","description":"The key of the item custom attribute the set requires."},"labelValue":{"type":"string","description":"The value `labelKey` must take. Absent when the rule matches the key regardless of value."}},"type":"object","additionalProperties":false,"description":"One deficient part of a `bundle` entry, drawing on the items carrying the custom attribute `labelKey`, with the value `labelValue` when present: what that part still needs for the missing sets to form."},"EventSuggestionMissingBundlePartCollection":{"title":"Collection","required":["partIndex","type","required","current","unit","valueGroupId"],"properties":{"partIndex":{"type":"integer","minimum":0,"description":"Zero-based position of this part in the bundle definition, so the gap can be matched back to the part the admin configured. Indexes of satisfied parts are simply missing from `parts[]`."},"type":{"type":"string","enum":["productSetCollection"]},"required":{"type":"number","format":"float","description":"How much of this part the still-missing sets need, in `unit`."},"current":{"type":"number","format":"float","description":"How much of this part the basket already supplies, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count. Bundle parts are measured in `quantity` today."},"valueGroupId":{"type":"string","format":"uuid","description":"The group of values (collection) the set draws on."},"filterCode":{"type":"string","description":"The code of the campaign-level item filter that narrows the collection. Absent when the collection is not narrowed."}},"type":"object","additionalProperties":false,"description":"One deficient part of a `bundle` entry, drawing on the items from the collection `valueGroupId`, narrowed by the item filter `filterCode` when present: what that part still needs for the missing sets to form."},"EventSuggestionMissingBundlePartFilter":{"title":"Item filter","required":["partIndex","type","required","current","unit","filterCode"],"properties":{"partIndex":{"type":"integer","minimum":0,"description":"Zero-based position of this part in the bundle definition, so the gap can be matched back to the part the admin configured. Indexes of satisfied parts are simply missing from `parts[]`."},"type":{"type":"string","enum":["productSetFilter"]},"required":{"type":"number","format":"float","description":"How much of this part the still-missing sets need, in `unit`."},"current":{"type":"number","format":"float","description":"How much of this part the basket already supplies, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count. Bundle parts are measured in `quantity` today."},"filterCode":{"type":"string","description":"The code of the campaign-level item filter that selects the set."}},"type":"object","additionalProperties":false,"description":"One deficient part of a `bundle` entry, drawing on the items selected by the item filter `filterCode`: what that part still needs for the missing sets to form."},"EventSuggestionMissingBundlePartCatalogCategory":{"title":"Catalog category","required":["partIndex","type","required","current","unit","catalogCategory"],"properties":{"partIndex":{"type":"integer","minimum":0,"description":"Zero-based position of this part in the bundle definition, so the gap can be matched back to the part the admin configured. Indexes of satisfied parts are simply missing from `parts[]`."},"type":{"type":"string","enum":["productSetCatalogCategory"]},"required":{"type":"number","format":"float","description":"How much of this part the still-missing sets need, in `unit`."},"current":{"type":"number","format":"float","description":"How much of this part the basket already supplies, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count. Bundle parts are measured in `quantity` today."},"catalogCategory":{"type":"string","description":"The Product Catalog category whose items the set counts."}},"type":"object","additionalProperties":false,"description":"One deficient part of a `bundle` entry, drawing on the items in the Product Catalog category `catalogCategory`: what that part still needs for the missing sets to form."},"EventSuggestionMissingBundlePartCatalogBrand":{"title":"Catalog brand","required":["partIndex","type","required","current","unit","catalogBrand"],"properties":{"partIndex":{"type":"integer","minimum":0,"description":"Zero-based position of this part in the bundle definition, so the gap can be matched back to the part the admin configured. Indexes of satisfied parts are simply missing from `parts[]`."},"type":{"type":"string","enum":["productSetCatalogBrand"]},"required":{"type":"number","format":"float","description":"How much of this part the still-missing sets need, in `unit`."},"current":{"type":"number","format":"float","description":"How much of this part the basket already supplies, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count. Bundle parts are measured in `quantity` today."},"catalogBrand":{"type":"string","description":"The Product Catalog brand whose items the set counts."}},"type":"object","additionalProperties":false,"description":"One deficient part of a `bundle` entry, drawing on the items of the Product Catalog brand `catalogBrand`: what that part still needs for the missing sets to form."},"EventSuggestionMissingBundlePartCatalogAttribute":{"title":"Catalog attribute","required":["partIndex","type","required","current","unit","attributeKey"],"properties":{"partIndex":{"type":"integer","minimum":0,"description":"Zero-based position of this part in the bundle definition, so the gap can be matched back to the part the admin configured. Indexes of satisfied parts are simply missing from `parts[]`."},"type":{"type":"string","enum":["productSetCatalogAttribute"]},"required":{"type":"number","format":"float","description":"How much of this part the still-missing sets need, in `unit`."},"current":{"type":"number","format":"float","description":"How much of this part the basket already supplies, in `unit`."},"unit":{"type":"string","enum":["quantity","value","lines"],"description":"What `required`/`current` count. Bundle parts are measured in `quantity` today."},"attributeKey":{"type":"string","description":"The Product Catalog attribute key the set requires."},"attributeValue":{"type":"string","description":"The value `attributeKey` must take. Absent when the rule matches the key regardless of value."}},"type":"object","additionalProperties":false,"description":"One deficient part of a `bundle` entry, drawing on the items whose Product Catalog attribute `attributeKey` has the value `attributeValue`: what that part still needs for the missing sets to form."},"EventSuggestionMissingDocumentType":{"title":"documentType","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["documentType"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Document types that would satisfy the condition. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."},"current":{"type":"string","description":"What the field holds today. Absent when the field is not set."}},"type":"object","additionalProperties":false,"description":"Informational. `documentType`: the transaction's document type does not match what the rule expects. Nothing about the basket closes it, so there is no `required`/`current` gap — `expected` names what would."},"EventSuggestionMissingDocumentNumber":{"title":"documentNumber","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["documentNumber"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Document numbers (or their prefix / suffix) that would satisfy the condition. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."},"current":{"type":"string","description":"What the field holds today. Absent when the field is not set."}},"type":"object","additionalProperties":false,"description":"Informational. `documentNumber`: the transaction's document number does not match what the rule expects. Nothing about the basket closes it, so there is no `required`/`current` gap — `expected` names what would."},"EventSuggestionMissingChannelId":{"title":"channelId","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["channelId"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Channel ids that would satisfy the condition. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."},"current":{"type":"string","description":"What the field holds today. Absent when the field is not set."}},"type":"object","additionalProperties":false,"description":"Informational. `channelId`: the channel the transaction came through does not match what the rule expects. Nothing about the basket closes it, so there is no `required`/`current` gap — `expected` names what would."},"EventSuggestionMissingMemberEmail":{"title":"memberEmail","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberEmail"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Email addresses (or their prefix / suffix) that would satisfy the condition. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberEmail`: the member's email address does not match what the rule expects. The member's current value is never published."},"EventSuggestionMissingMemberFirstName":{"title":"memberFirstName","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberFirstName"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"First names (or their prefix / suffix) that would satisfy the condition. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberFirstName`: the member's first name does not match what the rule expects. The member's current value is never published."},"EventSuggestionMissingMemberLastName":{"title":"memberLastName","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberLastName"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Last names (or their prefix / suffix) that would satisfy the condition. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberLastName`: the member's last name does not match what the rule expects. The member's current value is never published."},"EventSuggestionMissingMemberPhone":{"title":"memberPhone","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberPhone"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Phone numbers (or their prefix / suffix) that would satisfy the condition. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberPhone`: the member's phone number does not match what the rule expects. The member's current value is never published."},"EventSuggestionMissingMemberGender":{"title":"memberGender","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberGender"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Genders that would satisfy the condition. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberGender`: the member's gender does not match what the rule expects. The member's current value is never published."},"EventSuggestionMissingMemberLoyaltyCardNumber":{"title":"memberLoyaltyCardNumber","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberLoyaltyCardNumber"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Loyalty card numbers (or their prefix / suffix) that would satisfy the condition. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberLoyaltyCardNumber`: the member's loyalty card number does not match what the rule expects. The member's current value is never published."},"EventSuggestionMissingMemberLegalConsent":{"title":"memberLegalConsent","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberLegalConsent"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"The consent state that would satisfy the condition, as `\"true\"` / `\"false\"`. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberLegalConsent`: whether the member gave legal consent does not match what the rule expects. The member's current value is never published."},"EventSuggestionMissingMemberMarketingConsent":{"title":"memberMarketingConsent","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberMarketingConsent"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"The consent state that would satisfy the condition, as `\"true\"` / `\"false\"`. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberMarketingConsent`: whether the member gave marketing consent does not match what the rule expects. The member's current value is never published."},"EventSuggestionMissingMemberDataProcessingConsent":{"title":"memberDataProcessingConsent","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberDataProcessingConsent"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"The consent state that would satisfy the condition, as `\"true\"` / `\"false\"`. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberDataProcessingConsent`: whether the member consented to data processing does not match what the rule expects. The member's current value is never published."},"EventSuggestionMissingMemberTierId":{"title":"memberTierId","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberTierId"]},"operator":{"type":"string","enum":["eq","in","startsWith","endsWith"],"description":"How `expected` must be matched. `eq` and `in` compare the whole value (`in` accepts any entry of `expected`); `startsWith` / `endsWith` compare a prefix / suffix. Comparison is case-insensitive."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Tier ids that would satisfy the condition. A single entry for `eq` / `startsWith` / `endsWith`, one or more for `in`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberTierId`: the id of the member's current tier does not match what the rule expects. The member's current value is never published."},"EventSuggestionMissingPurchasedAt":{"title":"purchasedAt","required":["type","operator","current"],"properties":{"type":{"type":"string","enum":["purchasedAt"]},"operator":{"type":"string","enum":["gte","lte","between"],"description":"The bound the condition sets. `gte` carries `from` and is a **strict** \"after\" — the date must be later than `from`, not equal to it. `lte` carries `to` and is a strict \"before\". `between` carries both and is inclusive at both ends."},"from":{"type":"string","format":"date-time","description":"Lower bound, present for `gte` and `between`. Carried in the offset the condition was authored in — do not assume UTC when parsing it."},"to":{"type":"string","format":"date-time","description":"Upper bound, present for `lte` and `between`. Same offset caveat as `from`."},"current":{"type":"string","format":"date-time","description":"When the purchase was made."}},"type":"object","additionalProperties":false,"description":"Informational. `purchasedAt`: when the purchase was made falls outside the window the rule requires."},"EventSuggestionMissingCreatedAt":{"title":"createdAt","required":["type","operator","current"],"properties":{"type":{"type":"string","enum":["createdAt"]},"operator":{"type":"string","enum":["gte","lte","between"],"description":"The bound the condition sets. `gte` carries `from` and is a **strict** \"after\" — the date must be later than `from`, not equal to it. `lte` carries `to` and is a strict \"before\". `between` carries both and is inclusive at both ends."},"from":{"type":"string","format":"date-time","description":"Lower bound, present for `gte` and `between`. Carried in the offset the condition was authored in — do not assume UTC when parsing it."},"to":{"type":"string","format":"date-time","description":"Upper bound, present for `lte` and `between`. Same offset caveat as `from`."},"current":{"type":"string","format":"date-time","description":"When the transaction was created."}},"type":"object","additionalProperties":false,"description":"Informational. `createdAt`: when the transaction was created falls outside the window the rule requires."},"EventSuggestionMissingMemberBirthDate":{"title":"memberBirthDate","required":["type","operator"],"properties":{"type":{"type":"string","enum":["memberBirthDate"]},"operator":{"type":"string","enum":["gte","lte","between"],"description":"The bound the condition sets. `gte` carries `from` and is a **strict** \"after\" — the date must be later than `from`, not equal to it. `lte` carries `to` and is a strict \"before\". `between` carries both and is inclusive at both ends."},"from":{"type":"string","format":"date-time","description":"Lower bound, present for `gte` and `between`. Carried in the offset the condition was authored in — do not assume UTC when parsing it."},"to":{"type":"string","format":"date-time","description":"Upper bound, present for `lte` and `between`. Same offset caveat as `from`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberBirthDate`: the member's date of birth falls outside the window the rule requires. The member's current value is never published."},"EventSuggestionMissingMemberRegisteredDate":{"title":"memberRegisteredDate","required":["type","operator"],"properties":{"type":{"type":"string","enum":["memberRegisteredDate"]},"operator":{"type":"string","enum":["gte","lte","between"],"description":"The bound the condition sets. `gte` carries `from` and is a **strict** \"after\" — the date must be later than `from`, not equal to it. `lte` carries `to` and is a strict \"before\". `between` carries both and is inclusive at both ends."},"from":{"type":"string","format":"date-time","description":"Lower bound, present for `gte` and `between`. Carried in the offset the condition was authored in — do not assume UTC when parsing it."},"to":{"type":"string","format":"date-time","description":"Upper bound, present for `lte` and `between`. Same offset caveat as `from`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberRegisteredDate`: the date the member registered falls outside the window the rule requires. The member's current value is never published."},"EventSuggestionMissingMemberFirstTransactionDate":{"title":"memberFirstTransactionDate","required":["type","operator"],"properties":{"type":{"type":"string","enum":["memberFirstTransactionDate"]},"operator":{"type":"string","enum":["gte","lte","between"],"description":"The bound the condition sets. `gte` carries `from` and is a **strict** \"after\" — the date must be later than `from`, not equal to it. `lte` carries `to` and is a strict \"before\". `between` carries both and is inclusive at both ends."},"from":{"type":"string","format":"date-time","description":"Lower bound, present for `gte` and `between`. Carried in the offset the condition was authored in — do not assume UTC when parsing it."},"to":{"type":"string","format":"date-time","description":"Upper bound, present for `lte` and `between`. Same offset caveat as `from`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberFirstTransactionDate`: the date of the member's first transaction falls outside the window the rule requires. The member's current value is never published."},"EventSuggestionMissingMemberLastTransactionDate":{"title":"memberLastTransactionDate","required":["type","operator"],"properties":{"type":{"type":"string","enum":["memberLastTransactionDate"]},"operator":{"type":"string","enum":["gte","lte","between"],"description":"The bound the condition sets. `gte` carries `from` and is a **strict** \"after\" — the date must be later than `from`, not equal to it. `lte` carries `to` and is a strict \"before\". `between` carries both and is inclusive at both ends."},"from":{"type":"string","format":"date-time","description":"Lower bound, present for `gte` and `between`. Carried in the offset the condition was authored in — do not assume UTC when parsing it."},"to":{"type":"string","format":"date-time","description":"Upper bound, present for `lte` and `between`. Same offset caveat as `from`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberLastTransactionDate`: the date of the member's last transaction falls outside the window the rule requires. The member's current value is never published."},"EventSuggestionMissingMemberTierAchievementDate":{"title":"memberTierAchievementDate","required":["type","operator"],"properties":{"type":{"type":"string","enum":["memberTierAchievementDate"]},"operator":{"type":"string","enum":["gte","lte","between"],"description":"The bound the condition sets. `gte` carries `from` and is a **strict** \"after\" — the date must be later than `from`, not equal to it. `lte` carries `to` and is a strict \"before\". `between` carries both and is inclusive at both ends."},"from":{"type":"string","format":"date-time","description":"Lower bound, present for `gte` and `between`. Carried in the offset the condition was authored in — do not assume UTC when parsing it."},"to":{"type":"string","format":"date-time","description":"Upper bound, present for `lte` and `between`. Same offset caveat as `from`."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberTierAchievementDate`: the date the member reached their current tier falls outside the window the rule requires. The member's current value is never published."},"EventSuggestionMissingTransactionLabel":{"title":"transactionLabel","required":["type","operator","key","expected"],"properties":{"type":{"type":"string","enum":["transactionLabel"]},"operator":{"type":"string","enum":["in"],"description":"Always `in` — any one of `expected` satisfies the condition."},"key":{"type":"string","description":"The transaction custom attribute key the rule looks at."},"expected":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/EventSuggestionLabelExpectation"},"description":"The key/value pairs the transaction would have to carry, any one of them."}},"type":"object","additionalProperties":false,"description":"Informational. `transactionLabel`: the transaction does not carry any of the `expected` custom attributes."},"EventSuggestionLabelExpectation":{"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object","additionalProperties":false,"description":"One key/value custom attribute a rule expects."},"EventSuggestionMissingRequiredItemLabel":{"title":"requiredItemLabel","required":["type","operator","key","expected"],"properties":{"type":{"type":"string","enum":["requiredItemLabel"]},"operator":{"type":"string","enum":["in"],"description":"Always `in` — any one of `expected` satisfies the condition."},"key":{"type":"string","description":"The item custom attribute key the rule looks at."},"expected":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/EventSuggestionLabelExpectation"},"description":"The key/value pairs a basket line would have to carry, any one of them."}},"type":"object","additionalProperties":false,"description":"Informational. `requiredItemLabel`: no basket line carries any of the `expected` custom attributes."},"EventSuggestionMissingMemberWalletBalance":{"title":"memberWalletBalance","required":["type","walletCode","field","operator","required","current"],"properties":{"type":{"type":"string","enum":["memberWalletBalance"]},"walletCode":{"type":"string","description":"Code of the wallet the rule reads."},"field":{"type":"string","enum":["activeUnits","spentUnits","earnedUnits","lockedUnits","blockedUnits","expiredUnits"],"description":"Which bucket of that wallet the rule compares."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` closes the condition; `gt` means it must be exceeded. There is no `eq`, `in` or `between`: a condition authored with one of them is reported as `gte`, with `required` set to the lowest balance that satisfies it — the lower bound is the only part earning more can close."},"required":{"type":"number","format":"float","description":"The balance the rule requires."},"current":{"type":"number","format":"float","description":"The member's balance before this event."}},"type":"object","additionalProperties":false,"description":"Member-scoped, numeric. `memberWalletBalance`: the member's balance in a wallet is short of what the rule requires. The basket does not move it."},"EventSuggestionMissingMemberBadge":{"title":"memberBadgeCompletions","required":["type","badgeSystemCode","operator","required","current"],"properties":{"type":{"type":"string","enum":["memberBadgeCompletions"]},"badgeSystemCode":{"type":"string","description":"System code of the badge type whose completion count the rule reads."},"operator":{"type":"string","enum":["gt","gte"],"description":"The bound. `gte` means reaching `required` completions closes the condition; `gt` means it must be exceeded. A condition authored as `eq`, `in` or `between` is reported as `gte`, with `required` set to the lowest count that satisfies it — the lower bound is the only part more completions can close."},"required":{"type":"number","format":"float","description":"How many completions the rule requires."},"current":{"type":"number","format":"float","description":"How many times the member has completed the badge before this event; `0` when never."}},"type":"object","additionalProperties":false,"description":"Member-scoped, numeric. `memberBadgeCompletions`: the member has completed a badge fewer times than the rule requires."},"EventSuggestionMissingMemberTiers":{"title":"memberTiers","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberTiers"]},"operator":{"type":"string","enum":["in"],"description":"Always `in` — any one of `expected` satisfies the condition."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Tier ids that would satisfy the condition."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberTiers`: the member does not hold any of the tiers the rule requires."},"EventSuggestionMissingMemberSegments":{"title":"memberSegments","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberSegments"]},"operator":{"type":"string","enum":["in"],"description":"Always `in` — any one of `expected` satisfies the condition."},"expected":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Segment ids that would satisfy the condition."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberSegments`: the member does not belong to any of the segments the rule requires."},"EventSuggestionMissingMemberLabel":{"title":"memberLabels","required":["type","operator","expected"],"properties":{"type":{"type":"string","enum":["memberLabels"]},"operator":{"type":"string","enum":["in"],"description":"Always `in` — carrying any one of `expected` satisfies the condition."},"expected":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/EventSuggestionLabelExpectation"},"description":"The member labels that would satisfy the condition."}},"type":"object","additionalProperties":false,"description":"Member-scoped, informational. `memberLabels`: the member does not carry any of the key/value labels the rule requires."},"EventSuggestionWouldEarn":{"oneOf":[{"$ref":"#/components/schemas/EventSuggestionWouldEarnPoints"},{"$ref":"#/components/schemas/EventSuggestionWouldEarnDeduct"},{"$ref":"#/components/schemas/EventSuggestionWouldEarnReward"},{"$ref":"#/components/schemas/EventSuggestionWouldEarnBadge"},{"$ref":"#/components/schemas/EventSuggestionWouldEarnTier"},{"$ref":"#/components/schemas/EventSuggestionWouldEarnCustomAttribute"}],"discriminator":{"propertyName":"type","mapping":{"points":"#/components/schemas/EventSuggestionWouldEarnPoints","deduct":"#/components/schemas/EventSuggestionWouldEarnDeduct","reward":"#/components/schemas/EventSuggestionWouldEarnReward","badge":"#/components/schemas/EventSuggestionWouldEarnBadge","tier":"#/components/schemas/EventSuggestionWouldEarnTier","customAttribute":"#/components/schemas/EventSuggestionWouldEarnCustomAttribute"}},"description":"One effect the missed rule would apply, previewed against this event with every `missing` entry\nclosed. `type` is the discriminator.\n\nThese are projections, not promises: they are computed from the event as sent plus the minimum that\nwould close the gap, and the rule is still subject to its campaign's limits when the member\nactually shops. An effect the member would not actually receive — for example a reward that is\nunavailable, or a badge whose badge type is missing or inactive — has no entry.\n"},"EventSuggestionWouldEarnPoints":{"required":["type","value"],"properties":{"type":{"type":"string","enum":["points"]},"walletCode":{"type":"string","description":"Wallet the units would land in. Absent when the rule does not name one."},"value":{"type":"number","format":"float","description":"Units the member would additionally receive."}},"type":"object","additionalProperties":false,"description":"Wallet units the missed rule would grant."},"EventSuggestionWouldEarnDeduct":{"required":["type","value"],"properties":{"type":{"type":"string","enum":["deduct"]},"walletCode":{"type":"string","description":"Wallet the units would be taken from. Absent when the rule does not name one."},"value":{"type":"number","format":"float","description":"Units the rule would deduct, as a positive number."}},"type":"object","additionalProperties":false,"description":"Wallet units the missed rule would deduct."},"EventSuggestionWouldEarnReward":{"required":["type","rewardId"],"properties":{"type":{"type":"string","enum":["reward"]},"rewardId":{"type":"string","format":"uuid","description":"Id of the reward the member would receive."},"couponValue":{"type":"number","format":"float","description":"Face value of the coupon, when the reward has a fixed one. Absent when the value is computed at issue time from a rule."}},"type":"object","additionalProperties":false,"description":"A reward the missed rule would issue."},"EventSuggestionWouldEarnBadge":{"required":["type","badgeSystemCode"],"properties":{"type":{"type":"string","enum":["badge"]},"badgeSystemCode":{"type":"string","description":"System code of the badge the member would be granted."}},"type":"object","additionalProperties":false,"description":"A badge the missed rule would grant."},"EventSuggestionWouldEarnTier":{"required":["type","tierSetId","tierId"],"properties":{"type":{"type":"string","enum":["tier"]},"tierSetId":{"type":"string","format":"uuid","description":"Id of the tier set the member would be assigned within."},"tierId":{"type":"string","format":"uuid","description":"Id of the tier the member would be assigned to."}},"type":"object","additionalProperties":false,"description":"A tier assignment the missed rule would make."},"EventSuggestionWouldEarnCustomAttribute":{"required":["type","customAttributeKey"],"properties":{"type":{"type":"string","enum":["customAttribute"]},"customAttributeKey":{"type":"string","description":"Key of the custom attribute the rule would assign to the member."},"customAttributeValue":{"type":"string","description":"Value the rule would assign. Absent when it cannot be determined in advance; the entry then says only which attribute would be set."}},"type":"object","additionalProperties":false,"description":"A custom attribute the missed rule would assign to the member."},"EventPricedProduct":{"description":"One products-to-price quote: what adding this candidate product to the current cart would earn, as a DELTA against the cart alone. The baseline is a cart-alone preview evaluated with the same member state as the quotes: on a dry run that is exactly `effectsSummary`; on a write it is NOT necessarily the applied `effectsSummary`, which also carries challenge and referral effects the quotes never include.\nNumeric fields (`givenUnits`, `deductedUnits`) are signed per-wallet deltas — `value(cart + candidate) − value(cart)`. They can be NEGATIVE: a candidate can disable a campaign the cart alone triggers (e.g. an exclusion condition such as \"the cart must not contain product X\"). Note that a positive `deductedUnits` means the candidate causes MORE units to be deducted.\nList fields (rewards, badges, custom attributes) contain entries earned WITH the candidate and not earned by the cart alone — gains only; a reward the cart already earns without the candidate is not repeated, and losses are not reported.\nAn empty `earned` object (`{}`) means adding the candidate changes nothing — for example when a campaign's limit is exhausted.","required":["sku","earned"],"properties":{"sku":{"type":"string"},"earned":{"type":"object","allOf":[{"$ref":"#/components/schemas/EventEffectsSummary"}],"description":"The delta this candidate adds to the cart alone."}},"type":"object","additionalProperties":false},"EventTranslations":{"type":"object","additionalProperties":false,"minProperties":1,"description":"A dictionary of the human-readable labels for the identifiers this very response carries, so the caller can render the body without a second round of lookups.\nTwo levels: **family** (`campaigns`, `rewards`, `walletTypes`, `badgeTypes`, `tiers`, `tierSets`, `groupOfValues`, `milestones`), then the identifier exactly as it is spelled elsewhere in the response. Values are the translated fields.\nOnly what the response references is included. A family with no referenced identifier is absent — never `{}`, never `null` — and an identifier that has no translation in any locale of the chain has no entry, so a reference can legitimately have no counterpart here. Every identifier appears at most **once**, however many times the body mentions it.","properties":{"campaigns":{"type":"object","description":"Keyed by `campaignId`, as carried by `suggestions[].campaignId`, `challengeProgress[].campaignId` and `unitsPerProduct[].campaignId`.","additionalProperties":{"type":"object","allOf":[{"$ref":"#/components/schemas/EventTranslationEntry"}]}},"rewards":{"type":"object","description":"Keyed by `rewardId`, as carried by `effectsSummary.givenRewards[].rewardId` and by a suggestion's `wouldEarn[]` reward entry.","additionalProperties":{"type":"object","allOf":[{"$ref":"#/components/schemas/EventRewardTranslationEntry"}]}},"walletTypes":{"type":"object","description":"Keyed by `walletCode`, as carried by `effectsSummary.givenUnits[]` / `effectsSummary.deductedUnits[]`, `unitsPerProduct[].walletCode` and a suggestion's points/deduct `wouldEarn[]` and wallet-balance `missing[]` entries.","additionalProperties":{"type":"object","allOf":[{"$ref":"#/components/schemas/EventTranslationEntry"}]}},"badgeTypes":{"type":"object","description":"Keyed by `badgeSystemCode`, as carried by `effectsSummary.grantedBadges[]`, a suggestion's `wouldEarn[]` badge entry and its `memberBadgeCompletions` `missing[]` entry.","additionalProperties":{"type":"object","allOf":[{"$ref":"#/components/schemas/EventTranslationEntry"}]}},"tiers":{"type":"object","description":"Keyed by the tier identifier: the tier `effectsSummary.assignedTiers[]` just assigned, the one a suggestion's `wouldEarn[]` tier entry would assign, and the one its `missing[]` entry expects (or reports as current) for the `memberTiers` and `memberTierId` conditions.","additionalProperties":{"type":"object","allOf":[{"$ref":"#/components/schemas/EventTranslationEntry"}]}},"tierSets":{"type":"object","description":"Keyed by `tierSetId`, as carried by `effectsSummary.assignedTiers[]` and a suggestion's `wouldEarn[]` tier entry — the programme a storefront names next to a tier.","additionalProperties":{"type":"object","allOf":[{"$ref":"#/components/schemas/EventTranslationEntry"}]}},"groupOfValues":{"type":"object","description":"Keyed by `valueGroupId`, as carried by a suggestion's product-set and bundle-part `missing[]` entries.","additionalProperties":{"type":"object","allOf":[{"$ref":"#/components/schemas/EventTranslationEntry"}]}},"milestones":{"type":"object","description":"Keyed by `milestoneId`, as carried by `challengeProgress[].milestones[]`. Locale-invariant: a milestone has one authored `name`/`description` pair and no per-locale translations, so the entry does not change with `_locale`.","additionalProperties":{"type":"object","allOf":[{"$ref":"#/components/schemas/EventTranslationEntry"}]}}}},"EventTranslationEntry":{"type":"object","additionalProperties":false,"minProperties":1,"description":"The translated labels of one referenced object, resolved for the requested locale chain.\nA field is absent when it is empty in every locale of the chain — never `null`, never `\"\"`. Fields are resolved **independently**: an entry may carry `name` from the requested locale and `description` from the default one. An object whose every field is empty in every locale produces no entry at all, so this object is never `{}`.","properties":{"name":{"type":"string"},"description":{"type":"string"}}},"EventRewardTranslationEntry":{"type":"object","additionalProperties":false,"minProperties":1,"description":"The translated labels of one referenced reward, resolved for the requested locale chain.\nSame rules as every other entry: a field empty in every locale of the chain is absent, fields are resolved independently of one another, and a reward with no translated field at all produces no entry.","properties":{"name":{"type":"string"},"shortDescription":{"type":"string"},"conditionsDescription":{"type":"string"},"usageInstruction":{"type":"string"},"brandName":{"type":"string"},"brandDescription":{"type":"string"}}},"ExpiredToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"InvalidToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"Unauthorized":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}},"headers":{"XRateLimitLimit":{"description":"The number of write requests the deployment processes synchronously in a burst.","schema":{"type":"integer"}},"XRateLimitRemaining":{"description":"How many further write requests can be processed synchronously right now. `0` means the next write request is answered with `202`.","schema":{"type":"integer"}},"XRateLimitReset":{"description":"Unix time, in seconds, from which a write request is processed synchronously again. Equal to the current time while `X-RateLimit-Remaining` is above `0`.","schema":{"type":"integer"}}},"responses":{"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"required":["code","message","errors"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"required":["message","parameters","plural","code","path"],"properties":{"message":{"type":"string"},"parameters":{},"plural":{"type":"integer","nullable":true},"code":{"type":"string"},"path":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}},"Conflict":{"description":"Conflict — the resource is already being processed by another concurrent request.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/event":{"post":{"operationId":"_eventPost","tags":["Events"],"summary":"Register a transaction or custom event and return the applied effects","description":"<label style=\"background-color: #BFE1F6;padding:5px;\">Integration</label><br><br>\n\nRegisters a Purchase Transaction or a Custom Event for a member and returns, in the same\nresponse, the effects the campaign engine applied. Use `event.type: \"transaction\"` for a\nPurchase Transaction; any other value is a Custom Event type and must match a custom event\nschema registered for the tenant — see `GET /{storeCode}/customEvent/schema/{eventType}/active`.\n\n### Modes\n\n- **Write** (default) — the event is created and its effects are applied.\n- **Dry run** (`dryRun=true`) — nothing is persisted; the response is the same as in write mode.\n\n### Rate limit\n\nA deployment can limit how many write requests per second are processed synchronously. Dry runs\nare never limited, and a request rejected with `400` does not count towards the limit.\n\nAbove the limit the event is **not** rejected: it is registered and the endpoint answers `202`\nwith the id of the created Transaction or Custom Event. Its effects are applied in the background,\nso the `202` response carries no `effectsSummary` or other response sections.\nRead the result from the resource in the `Location` header or from webhooks. Do not resend\nthe request.\n\nThe `X-RateLimit-*` headers on write responses show the current state of the limit.\n\n### Validation errors (`400`)\n\nBesides field-level validation of the event payload, the endpoint answers `400` when:\n\n- `event` or `event.type` is missing, or `event` is not an object;\n- `responseContent` contains `null`, an empty string or an unrecognized value;\n- `data.header.documentNumber` is already used in the tenant — also when a concurrent request\n  with the same document number commits first (the error is reported on `documentNumber`).\n","parameters":[{"$ref":"#/components/parameters/storeCode"},{"name":"dryRun","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"When `true`, nothing is persisted and the response previews what the event would produce, in the same shape as in write mode."},{"name":"_locale","in":"query","required":false,"schema":{"type":"string"},"description":"Used only when `responseContent` includes `translations` — the locale that section is resolved for; ignored otherwise. Falls back to the locale's parent (`pl_PL` → `pl`) and then to the tenant's configured default language; an unknown locale resolves to the default rather than failing. A malformed value (not a locale tag such as `pl` or `en_US`, or longer than 35 characters) is ignored, as on every endpoint."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"title":"PurchaseTransactionEvent","required":["event"],"properties":{"event":{"required":["type","data"],"properties":{"type":{"type":"string","description":"Must be `transaction` to submit a Purchase Transaction."},"memberData":{"$ref":"#/components/schemas/EventMemberData"},"data":{"$ref":"#/components/schemas/PurchaseTransactionEventData"}},"type":"object","additionalProperties":false},"responseContent":{"$ref":"#/components/schemas/EventResponseContent"}},"type":"object","additionalProperties":false},{"title":"CustomEvent","required":["event"],"properties":{"event":{"required":["type","data"],"properties":{"type":{"type":"string","description":"Any value other than `transaction`. Must match a custom event schema registered for the tenant."},"memberData":{"$ref":"#/components/schemas/EventMemberData"},"data":{"$ref":"#/components/schemas/CustomEventEventData"}},"type":"object","additionalProperties":false},"responseContent":{"$ref":"#/components/schemas/EventResponseContent"}},"type":"object","additionalProperties":false}]}}}},"responses":{"200":{"description":"The event was processed. In `dryRun` mode this reflects what *would* happen; nothing was persisted.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"required":["event"],"properties":{"event":{"$ref":"#/components/schemas/EventResponseEvent"},"effectsSummary":{"type":"object","allOf":[{"$ref":"#/components/schemas/EventEffectsSummary"}],"description":"Present only when at least one effect was applied. Absent entirely — never `null`,\nnever an empty object — when the event triggered no effects.\n\nEach of the seven arrays follows the same rule: absent entirely when no effect of\nthat kind was applied, never `null` and never `[]`.\n\nOnly successfully applied effects are reported. Effects rejected by a campaign or\nwallet-type limit, or skipped because a rule condition was not met, are not\nincluded.\n"},"challengeProgress":{"type":"array","items":{"$ref":"#/components/schemas/EventChallengeProgress"},"description":"Present only when the event advanced at least one challenge campaign of the member.\nAbsent entirely — never `null`, never `[]` — otherwise, including when the tenant\nruns the legacy effects applier, which does not compute challenge progression.\n"},"unitsPerProduct":{"type":"array","items":{"$ref":"#/components/schemas/EventUnitsPerProductEntry"},"description":"Purchase Transactions only. Present when the request opted in via `responseContent: [\"unitsPerProduct\"]` and at least one granted effect produced a split; absent otherwise."},"suggestions":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/EventSuggestion"},"description":"Campaign rules this event narrowly missed, each with what closing it would earn. Purchase transactions only, in both modes; present only when requested via `responseContent: [\"suggestions\"]` and at least one rule qualifies. Ordered by the campaign's display order (campaigns without one last), then `campaignId`, then the rule's position in the campaign. Numeric amounts in `missing` and the would-earn `value` are rounded to 6 decimal places, like `effectsSummary` units."},"productsToPrice":{"description":"One quote per request candidate, in request order. Present when the request carried `productsToPrice`.","type":"array","minItems":1,"items":{"$ref":"#/components/schemas/EventPricedProduct"}},"translations":{"allOf":[{"$ref":"#/components/schemas/EventTranslations"}],"description":"The labels for the identifiers this response carries, resolved for `_locale`. Present only when the request opted in via `responseContent: [\"translations\"]` and at least one referenced identifier resolved to a translation. Absent entirely — never `null`, never `{}` — otherwise. A referenced identifier with no entry here is expected, not an error."}},"type":"object","additionalProperties":false}}}},"202":{"description":"Write mode only. The rate limit was exceeded, so the event was registered and its effects will be applied in the background — see *Rate limit* above.","headers":{"Location":{"description":"URL of the registered event: `GET /{storeCode}/transaction/{transaction}` or `GET /{storeCode}/customEvent/{customEvent}`.","schema":{"type":"string","format":"uri"}},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"oneOf":[{"title":"TransactionAccepted","required":["transactionId"],"properties":{"transactionId":{"description":"Registered transaction identity","type":"string","format":"uuid"}},"type":"object","additionalProperties":false},{"title":"CustomEventAccepted","required":["customEventId"],"properties":{"customEventId":{"description":"Custom Event Id","type":"string","format":"uuid"}},"type":"object","additionalProperties":false}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ExpiredToken"},{"$ref":"#/components/schemas/InvalidToken"},{"$ref":"#/components/schemas/Unauthorized"}]}}}},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"description":"`storeCode` does not match any existing store. The response has no body.\n\nNote: a member that cannot be resolved from `memberData` does **not** produce a 404 —\nthe request succeeds with `200` and `event.matched: false`.\n"},"409":{"$ref":"#/components/responses/Conflict"}}}}}}
````


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.openloyalty.io/api-reference/events/register-a-transaction-or-custom-event-and-return-the-applied-effects.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
