> 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/campaign/simulate-campaigns-result.md).

# Simulate campaigns result

Integration\
\
This method returns detailed information about all Campaigns created in the system.

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Campaign","description":"These endpoints will allow you to easily manage campaigns."}],"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`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\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.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}}},"schemas":{"SimulateFormType":{"required":["trigger"],"properties":{"trigger":{"type":"string","enum":["transaction","custom_event","internal_event","return_transaction"]},"customer":{"$ref":"#/components/schemas/SimulatedCustomer"},"referrer":{"$ref":"#/components/schemas/SimulatedCustomer"}},"type":"object"},"SimulatedCustomer":{"properties":{"id":{"description":"Unique Member identifier. Specifying an existing ID will cause the simulation to fetch the specific Member data for simulation purposes.","type":"string","format":"uuid"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"birthDate":{"type":"string"},"address":{"$ref":"#/components/schemas/CustomerAddressFormType"},"loyaltyCardNumber":{"type":"string"},"legalConsent":{"type":"boolean"},"marketingConsent":{"type":"boolean"},"dataProcessingConsent":{"type":"boolean"},"gender":{"type":"string"},"registeredDate":{"type":"string"},"firstTransactionDate":{"type":"string"},"lastTransactionDate":{"type":"string"},"levelAchievementDate":{"type":"string"},"levelId":{"type":"string","format":"uuid"},"tiers":{"type":"array","items":{"type":"string","format":"uuid"}},"numberOfPurchases":{"type":"string"},"purchaseAmount":{"type":"string"},"averagePurchaseAmount":{"type":"string"},"activePoints":{"type":"string"},"spentPoints":{"type":"string"},"earnedPoints":{"type":"string"},"lockedPoints":{"type":"string"},"blockedPoints":{"type":"string"},"expiredPoints":{"type":"string"},"labels":{"type":"array","items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"}},"segments":{"type":"array","items":{"type":"string","format":"uuid"}}},"type":"object"},"CustomerAddressFormType":{"properties":{"street":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"postal":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"country":{"description":"The country code in ISO 3166-1 alpha-2 format. This should be a two-letter uppercase string representing a valid country code. Examples:  - `US` (United States) - `PL` (Poland)","type":"string"}},"type":"object"},"SimulatedTransaction":{"required":["documentNumber","purchasedAt"],"properties":{"id":{"type":"string","format":"uuid"},"grossValue":{"deprecated":true,"oneOf":[{"type":"string"},{"type":"number"}]},"documentNumber":{"type":"string"},"linkedDocumentNumber":{"description":"Required only for `documentType = return`. The field indicates the transaction you want to return","type":"string"},"documentType":{"type":"string","enum":["sell","return"]},"purchasedAt":{"type":"string"},"purchasePlace":{"type":"string"},"shippingCity":{"type":"string","deprecated":true},"channelId":{"type":"string","format":"uuid"},"labels":{"type":"array","items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"}},"items":{"type":"array","items":{"properties":{"sku":{"type":"string"},"name":{"type":"string"},"qty":{"oneOf":[{"type":"string"},{"type":"number"}]},"grossValue":{"oneOf":[{"type":"string"},{"type":"number"}]},"category":{"type":"string"},"maker":{"type":"string"},"labels":{"type":"array","items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"}}},"type":"object"}}},"type":"object","additionalProperties":false},"SimulatedCustomEvent":{"required":["type","eventDate"],"properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"eventDate":{"type":"string"},"body":{"type":"object"}},"type":"object","additionalProperties":false},"SimulatedInternalEvent":{"required":["type","eventDate"],"properties":{"type":{"type":"string"},"eventDate":{"type":"string"},"body":{"type":"object"}},"type":"object","additionalProperties":false},"SimulateResult":{"required":["effects","evaluationWarnings"],"properties":{"effects":{"type":"array","items":{"required":["type","target","campaign"],"properties":{"type":{"type":"string","enum":["give_points","give_reward","deduct_unit","assign_member_custom_attribute","remove_member_custom_attribute","grant_badge","cancel_transaction_effects","assign_member_to_tier"],"description":"An `assign_member_to_tier` entry describes the tier the campaign would grant; the simulation never moves the member. A saved campaign carrying the effect on a campaign type and trigger that the API no longer accepts is omitted from `effects` entirely, and the response stays `200` rather than reporting an error — the simulation reports what would run, not what the stored configuration asks for.\n\nA `referral` campaign is simulated even when the request carries no `referrer`. The skip a live run applies in that case is deliberately not applied here, so the entry can describe a grant the real event would never make. `target` names the rule's setting, not a member the simulation resolved — a `referrer` entry does not mean one was found."},"campaign":{"$ref":"#/components/schemas/Campaign"},"points":{"type":"number","format":"float"},"transform":{"required":["basePoints","appliedTransforms"],"properties":{"basePoints":{"type":"number","format":"float"},"appliedTransforms":{"type":"array","items":{"required":["type","factor"],"properties":{"type":{"type":"string","enum":["tierMultiplier"]},"tierId":{"type":"string","format":"uuid"},"factor":{"type":"number","format":"float"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false},"wallet":{"type":"string"},"rewardId":{"type":"string"},"expression":{"description":"Absent for a `give_points` effect that declares its payout through `unitsRule`.","type":"string"},"badgeSystemCode":{"type":"string"},"tierSetId":{"description":"Present only for the `assign_member_to_tier` effect.","type":"string","format":"uuid"},"tierId":{"description":"Present only for the `assign_member_to_tier` effect.","type":"string","format":"uuid"},"target":{"type":"string","enum":["self","referrer"]}},"type":"object","additionalProperties":false}},"evaluationWarnings":{"type":"array","items":{"required":["campaignId","message"],"properties":{"campaignId":{"type":"string","format":"uuid"},"message":{"type":"string"}},"type":"object","additionalProperties":false}},"simulatedMember":{"required":["memberId"],"properties":{"memberId":{"type":"string","format":"uuid"},"wallets":{"type":"array","items":{"properties":{"walletId":{"type":"string","format":"uuid","nullable":true},"walletType":{"properties":{"code":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"},"active":{"type":"boolean"},"unitSingularName":{"type":"string"},"unitPluralName":{"type":"string"},"rewardSpending":{"type":"boolean"}},"type":"object","additionalProperties":false},"account":{"properties":{"activeUnits":{"type":"number","format":"float"}},"type":"object"}},"type":"object","additionalProperties":false}}},"type":"object","nullable":true,"additionalProperties":false}},"type":"object","additionalProperties":false},"Campaign":{"properties":{"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string"},"trigger":{"type":"string"},"campaignId":{"type":"string","format":"uuid"},"activity":{"properties":{"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time","nullable":true}},"type":"object"},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"displayOrder":{"type":"number"},"rules":{"type":"array","items":{"properties":{"ruleKey":{"description":"The handle of a stored rule; absent for a rule that is not stored.","type":"string"},"name":{"type":"string"},"description":{"type":"string"},"conditions":{"type":"array","items":{"properties":{"operator":{"type":"string"},"data":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]},"attribute":{"type":"string"}},"type":"object"}},"effects":{"type":"array","items":{"properties":{"effect":{"type":"string"},"pointsRule":{"description":"Absent on a `give_points` effect that declares its payout through `unitsRule`.","type":"string"},"relatedLineTarget":{"description":"The line target whose lines `unitsRule` measures. Present only on a `give_points` effect with `unitsRule` that names a line target; absent when `unitsRule` measures the whole transaction.","type":"string","minLength":3,"maxLength":32},"unitsRule":{"description":"Present only for a `give_points` effect that declares its payout this way.","allOf":[{"$ref":"#/components/schemas/UnitsRule"}]},"unitsExpirationDateRule":{"properties":{"expirationStrategy":{"type":"string"},"expression":{"type":"string"}},"type":"object"},"tierSetId":{"description":"Present only for the `assign_member_to_tier` effect.","type":"string","format":"uuid"},"tierId":{"description":"Present only for the `assign_member_to_tier` effect.","type":"string","format":"uuid"}},"type":"object"}},"lineTargets":{"type":"array","items":{"$ref":"#/components/schemas/LineTarget"}},"limits":{"description":"The rule's per-SKU caps. Absent when the rule has none.","type":"array","items":{"$ref":"#/components/schemas/CampaignRuleLimitResponse"}}},"type":"object"}},"labels":{"type":"array","items":{"properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","minLength":1}},"type":"object"}},"translations":{"type":"array","items":{"properties":{"name":{"type":"string"},"description":{"type":"string"},"id":{"type":"integer"},"locale":{"type":"string"}},"type":"object"}},"limitUsages":{"properties":{"points":{"properties":{"currentValue":{"type":"number","format":"float"},"limitValue":{"type":"number","format":"float"},"remaining":{"type":"number","format":"float"},"interval":{"properties":{"type":{"type":"string","enum":["calendarHours","calendarDays","calendarWeeks","calendarMonths","calendarYears"]},"value":{"type":"integer"}},"type":"object"}},"type":"object"}},"type":"object"},"triggerStrategy":{"$ref":"#/components/schemas/TriggerStrategy"}},"type":"object"},"UnitsRule":{"description":"How a `give_points` effect computes the units it grants.","required":["applyTo","amount"],"properties":{"applyTo":{"description":"The measure `amount` is multiplied by, read from the line target `relatedLineTarget` names, or from the whole transaction when the effect declares no `relatedLineTarget`.\n\n* `flat` — `amount` once. Booked against a line target, it pays only when the target matched at least one line, and nothing otherwise.\n* `quantity` — `amount` × the quantity bought: of the target's lines, of the units its sets consumed, or of every line of the transaction.\n* `value` — `amount` × the gross value: of the target's lines, of the lines its sets consumed, or of the whole transaction.\n* `count` — `amount` × the number of sets formed. Accepted only when `relatedLineTarget` names a line target that selects `sets`; on a `lines` target or without `relatedLineTarget` the request is rejected with `400` on `rules.N.effects.M.unitsRule.applyTo`.\n\nThe effect's `transform` scales the result afterwards.","type":"string","enum":["flat","quantity","count","value"]},"amount":{"description":"Units granted per measure unit. Must be greater than zero and at most 10 000 000; anything else is rejected with `400` on `rules.N.effects.M.unitsRule.amount`.","type":"number","exclusiveMinimum":true,"minimum":0,"maximum":10000000}},"type":"object","additionalProperties":false},"LineTarget":{"required":["code"],"properties":{"code":{"type":"string","minLength":3,"maxLength":32},"name":{"type":"string","maxLength":32},"selector":{"description":"Send lines or sets, not both. An empty selector matches every line.","properties":{"lines":{"description":"Filters are AND-ed; an empty list matches every line.","properties":{"filters":{"type":"array","items":{"required":["value","condition"],"properties":{"value":{"required":["field"],"properties":{"field":{"type":"string","enum":["sku","name","qty","grossValue","category","maker","labels","catalogSku","catalogCategory","catalogBrand","catalogAttributes"]}},"type":"object","additionalProperties":false},"condition":{"$ref":"#/components/schemas/Condition"},"dataEnteredManually":{"type":"boolean"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false},"sets":{"description":"Every part must be satisfied for one set to form.","type":"array","items":{"required":["requirements","filters"],"properties":{"requirements":{"required":["qtyPerSet"],"properties":{"qtyPerSet":{"type":"number","minimum":0.001,"maximum":100000000,"exclusiveMaximum":true}},"type":"object","additionalProperties":false},"filters":{"type":"array","minItems":1,"items":{"required":["value","condition"],"properties":{"value":{"required":["field"],"properties":{"field":{"type":"string","enum":["sku","name","qty","grossValue","category","maker","labels","catalogSku","catalogCategory","catalogBrand","catalogAttributes"]}},"type":"object","additionalProperties":false},"condition":{"$ref":"#/components/schemas/Condition"},"dataEnteredManually":{"type":"boolean"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false},"Condition":{"required":["operator","value"],"properties":{"operator":{"type":"string","enum":["eq","neq","between","not_between","starts_with","ends_with","match","not_match","gt","gte","lt","lte","is_after","is_before","in","not_in","one_of","not_one_of","in_value_group","not_in_value_group","one_of_value_group","not_one_of_value_group"]},"value":{"oneOf":[{"description":"For operators `eq`, `neq`, `starts_with`, `ends_with`, `match`, `not_match` the value can be a string. For `match` and `not_match`, the string must be a valid regular expression.","type":"string"},{"description":"For operators `eq`, `neq`, `gt`, `gte`, `lt`, `lte` , the value can be a number.","type":"number"},{"description":"For operators `eq`, `neq`, the value can be a bool.","type":"boolean"},{"title":"datetime","description":"For operators `eq`, `neq` `is_after`, `is_before`, the value can be a datetime.","type":"string","format":"datetime","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,3})?Z$"},{"title":"array","type":"array","items":{"description":"For `in`, `not_in`, `one_of`, `not_one_of` operators, the values can be in array.","oneOf":[{"type":"number"},{"type":"string"},{"title":"custom attribute","properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"}]}},{"title":"between","description":"For `between`, `not_between` operators, the value is an object with 'from' and 'to'.","required":["from","to"],"properties":{"from":{"oneOf":[{"type":"number"},{"title":"datetime","type":"string","format":"datetime"}]},"to":{"oneOf":[{"type":"number"},{"title":"datetime","type":"string","format":"datetime"}]}},"type":"object"},{"title":"group of values","required":["groupValuesIds"],"properties":{"groupValuesIds":{"description":"For `in_value_group`, `not_in_value_group` operators, the value is an object with `groupValuesIds` array.","type":"array","items":{"type":"string","format":"uuid"}}},"type":"object"},{"title":"one of group of values","description":"For `one_of_value_group`, `not_one_of_value_group` operators, the value is an object with labelKey and `groupValuesIds` array.","required":["groupValuesIds","labelKey"],"properties":{"labelKey":{"type":"string"},"groupValuesIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"type":"object"}]}},"type":"object","additionalProperties":false},"CampaignRuleLimitResponse":{"description":"A rule's per-SKU cap, as stored. What each field means is described on the request's `rules[].limits`.","required":["metric","scope","countedPer","value"],"properties":{"metric":{"type":"string","enum":["items","units"]},"scope":{"type":"string","enum":["perMember","allMembers"]},"countedPer":{"type":"string","enum":["sku","rule"]},"value":{"description":"Always a number (`5.0`, `2.35`), whichever form the request used.","type":"number"},"interval":{"description":"Absent for a limit that counts over the campaign's lifetime.","required":["type"],"properties":{"type":{"type":"string","enum":["calendarDays","calendarWeeks","calendarMonths","calendarYears"]}},"type":"object"}},"type":"object"},"TriggerStrategy":{"properties":{"type":{"type":"string","enum":["birthday","registration_anniversary","daily","weekly","monthly"]},"executionSchedule":{"description":"Required for `weekly` and `monthly` type of campaign.","properties":{"dayOfWeek":{"description":"List of days when campaign should be executed. 0 for Sunday, 6 for Saturday.","type":"array","items":{"type":"integer","enum":[0,1,2,3,4,5,6]},"nullable":true},"dayOfMonth":{"description":"List of month days when campaign should be executed. 'L' for the last day of the month.","type":"array","items":{"oneOf":[{"type":"integer","enum":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]},{"type":"string","enum":["L"]}]},"nullable":true}},"type":"object","nullable":true}},"type":"object"},"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"}},"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"}}}},"NotFound":{"description":"Not found.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/campaign/simulate":{"post":{"tags":["Campaign"],"summary":"Simulate campaigns result","description":"<label style=\"background-color: #BFE1F6;padding:5px;\">Integration</label><br><br>\nThis method returns detailed information about all Campaigns created in the system.\n","operationId":"_campaignPostSimulate","parameters":[{"$ref":"#/components/parameters/storeCode"}],"requestBody":{"description":"","content":{"application/json":{"schema":{"oneOf":[{"title":"CampaignTransaction","properties":{"simulate":{"required":["transaction"],"allOf":[{"$ref":"#/components/schemas/SimulateFormType"},{"properties":{"transaction":{"$ref":"#/components/schemas/SimulatedTransaction"}},"type":"object"}],"additionalProperties":false}},"type":"object"},{"title":"CampaignCustomEvent","required":["simulate"],"properties":{"simulate":{"required":["custom_event"],"allOf":[{"$ref":"#/components/schemas/SimulateFormType"},{"properties":{"custom_event":{"$ref":"#/components/schemas/SimulatedCustomEvent"}},"type":"object"}],"additionalProperties":false}},"type":"object","additionalProperties":false},{"title":"CampaignInternalEvent","properties":{"simulate":{"required":["internal_event"],"allOf":[{"$ref":"#/components/schemas/SimulateFormType"},{"properties":{"internal_event":{"$ref":"#/components/schemas/SimulatedInternalEvent"}},"type":"object"}],"additionalProperties":false}},"type":"object"}]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateResult"}}}},"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":{"$ref":"#/components/responses/NotFound"}},"deprecated":true}}}}
````


---

# 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/campaign/simulate-campaigns-result.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.
