> 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":{"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":{"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":{"type":"string"},"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"}}},"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"},"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"}}}}}}
````


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.openloyalty.io/api-reference/campaign/simulate-campaigns-result.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
