# Campaign

Campaign

## Search for campaigns

> Search for campaigns

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Campaign","description":"Campaign"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"requestBodies":{"CampaignSearchRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignSearchRequestSchema"}}}}},"schemas":{"CampaignSearchRequestSchema":{"title":"CampaignSearchRequestSchema","type":"object","properties":{"query":{"type":"string"},"campaignCode":{"type":"string"},"discountType":{"$ref":"#/components/schemas/CampaignDiscountTypeENUM"},"displayName":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/CampaignTypeENUM"},"validFrom":{"type":"string","format":"date-time"},"validTo":{"type":"string","format":"date-time"}}},"CampaignDiscountTypeENUM":{"title":"CampaignDiscountTypeENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CHEAPEST_PRODUCT | Cheapest product will be discounted|\n| QUALIFIED_PRODUCT | All qualified products will be discounted|\n| ORDER_DISCOUNT | An order discount will be added to the order|","enum":["CHEAPEST_PRODUCT","QUALIFIED_PRODUCT","ORDER_DISCOUNT"],"type":"string"},"CampaignTypeENUM":{"title":"CampaignTypeENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CAMPAIGN | Normal campaign with rules set|\n| PRICELIST | A campaign that includes a pricelist. No rules applies|","enum":["CAMPAIGN","PRICELIST"],"type":"string"},"CampaignResponseSchema":{"title":"CampaignResponseSchema","type":"object","required":["name","status","displayName","validFrom","validTo","type","discountType","selection","quantityThreshold","amountThreshold","discountAmount","discountPercent","maxUsage","priority","pricelist","stores","campaignUid","campaignCode","preventCombinations"],"properties":{"name":{"type":"string"},"status":{"$ref":"#/components/schemas/CampaignStatusENUM"},"displayName":{"type":"string"},"validFrom":{"type":"string","format":"date-time"},"validTo":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/CampaignTypeENUM"},"discountType":{"$ref":"#/components/schemas/CampaignDiscountTypeENUM"},"selection":{"$ref":"#/components/schemas/CampaignSelectionResponseSchema"},"quantityThreshold":{"type":"integer"},"amountThreshold":{"type":"integer"},"discountAmount":{"type":"integer"},"discountPercent":{"type":"integer"},"maxUsage":{"type":"integer"},"priority":{"type":"integer"},"pricelist":{"$ref":"#/components/schemas/CampaignPricelistSchema"},"stores":{"type":"array","items":{"$ref":"#/components/schemas/CampaignStoreSchema"}},"campaignUid":{"$ref":"#/components/schemas/UID"},"campaignCode":{"type":"string"},"preventCombinations":{"type":"boolean"}}},"CampaignStatusENUM":{"title":"CampaignStatusENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Campaign is in a modeling state. Can be modified|\n| ACTIVE | Campaign is active, and is considered when making sales operations. Campaign can not be modified|\n| CLOSED | Campaign is closed.|","enum":["NEW","ACTIVE","CLOSED"],"type":"string"},"CampaignSelectionResponseSchema":{"title":"CampaignSelectionResponseSchema","type":"object","description":"Ths section contains all selections done on a campaign","required":["include","exclude"],"properties":{"include":{"$ref":"#/components/schemas/CampaignProductSelectionResponseSchema"},"exclude":{"$ref":"#/components/schemas/CampaignProductSelectionResponseSchema"}}},"CampaignProductSelectionResponseSchema":{"title":"CampaignSelectionResponseSchema","type":"object","description":"Ths section contains all selections done on a campaign","required":["productGroups:","brands","categories","products"],"properties":{"productGroups:":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductGroupSchema"}},"brands":{"type":"array","items":{"$ref":"#/components/schemas/CampaignBrandSchema"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/CampaignCategorySchema"}},"products":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductSchema"}}}},"CampaignProductGroupSchema":{"title":"CampaignProductGroupSchema","type":"object","required":["productGroupUid","name"],"properties":{"productGroupUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all product groups included in a campaign"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CampaignBrandSchema":{"title":"CampaignBrandSchema","type":"object","required":["brandUid","name"],"properties":{"brandUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all brands included in a campaign"},"CampaignCategorySchema":{"title":"CampaignCategorySchema","type":"object","description":"This section contains all brands included in a campaign","required":["categoryUid","name"],"properties":{"categoryUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}}},"CampaignProductSchema":{"title":"CampaignProductSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}},"description":"This section contains all individual products included or excluded in a campaign"},"CampaignPricelistSchema":{"title":"CampaignPricelistSchema","type":"object","required":["pricelistUid","name"],"properties":{"pricelistUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains the pricelist included in a campaign"},"CampaignStoreSchema":{"title":"CampaignStoreSchema","type":"object","required":["storeUid","name"],"properties":{"storeUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all stores included in a campaign"},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"},"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"}},"responses":{"CampaignListResponse":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","required":["items","paging"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CampaignResponseSchema"}},"paging":{"$ref":"#/components/schemas/Paging"}}}}}}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"}}},"paths":{"/tenants/{tenantUid}/campaigns/search":{"post":{"summary":"Search for campaigns","description":"Search for campaigns","tags":["Campaign"],"requestBody":{"$ref":"#/components/requestBodies/CampaignSearchRequest"},"responses":{"200":{"$ref":"#/components/responses/CampaignListResponse"}},"operationId":"search-campaigns","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}]}}}}
```

## Get list of campaigns

> Get list of campaigns

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Campaign","description":"Campaign"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"CampaignListResponse":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","required":["items","paging"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CampaignResponseSchema"}},"paging":{"$ref":"#/components/schemas/Paging"}}}}}}},"schemas":{"CampaignResponseSchema":{"title":"CampaignResponseSchema","type":"object","required":["name","status","displayName","validFrom","validTo","type","discountType","selection","quantityThreshold","amountThreshold","discountAmount","discountPercent","maxUsage","priority","pricelist","stores","campaignUid","campaignCode","preventCombinations"],"properties":{"name":{"type":"string"},"status":{"$ref":"#/components/schemas/CampaignStatusENUM"},"displayName":{"type":"string"},"validFrom":{"type":"string","format":"date-time"},"validTo":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/CampaignTypeENUM"},"discountType":{"$ref":"#/components/schemas/CampaignDiscountTypeENUM"},"selection":{"$ref":"#/components/schemas/CampaignSelectionResponseSchema"},"quantityThreshold":{"type":"integer"},"amountThreshold":{"type":"integer"},"discountAmount":{"type":"integer"},"discountPercent":{"type":"integer"},"maxUsage":{"type":"integer"},"priority":{"type":"integer"},"pricelist":{"$ref":"#/components/schemas/CampaignPricelistSchema"},"stores":{"type":"array","items":{"$ref":"#/components/schemas/CampaignStoreSchema"}},"campaignUid":{"$ref":"#/components/schemas/UID"},"campaignCode":{"type":"string"},"preventCombinations":{"type":"boolean"}}},"CampaignStatusENUM":{"title":"CampaignStatusENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Campaign is in a modeling state. Can be modified|\n| ACTIVE | Campaign is active, and is considered when making sales operations. Campaign can not be modified|\n| CLOSED | Campaign is closed.|","enum":["NEW","ACTIVE","CLOSED"],"type":"string"},"CampaignTypeENUM":{"title":"CampaignTypeENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CAMPAIGN | Normal campaign with rules set|\n| PRICELIST | A campaign that includes a pricelist. No rules applies|","enum":["CAMPAIGN","PRICELIST"],"type":"string"},"CampaignDiscountTypeENUM":{"title":"CampaignDiscountTypeENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CHEAPEST_PRODUCT | Cheapest product will be discounted|\n| QUALIFIED_PRODUCT | All qualified products will be discounted|\n| ORDER_DISCOUNT | An order discount will be added to the order|","enum":["CHEAPEST_PRODUCT","QUALIFIED_PRODUCT","ORDER_DISCOUNT"],"type":"string"},"CampaignSelectionResponseSchema":{"title":"CampaignSelectionResponseSchema","type":"object","description":"Ths section contains all selections done on a campaign","required":["include","exclude"],"properties":{"include":{"$ref":"#/components/schemas/CampaignProductSelectionResponseSchema"},"exclude":{"$ref":"#/components/schemas/CampaignProductSelectionResponseSchema"}}},"CampaignProductSelectionResponseSchema":{"title":"CampaignSelectionResponseSchema","type":"object","description":"Ths section contains all selections done on a campaign","required":["productGroups:","brands","categories","products"],"properties":{"productGroups:":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductGroupSchema"}},"brands":{"type":"array","items":{"$ref":"#/components/schemas/CampaignBrandSchema"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/CampaignCategorySchema"}},"products":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductSchema"}}}},"CampaignProductGroupSchema":{"title":"CampaignProductGroupSchema","type":"object","required":["productGroupUid","name"],"properties":{"productGroupUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all product groups included in a campaign"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CampaignBrandSchema":{"title":"CampaignBrandSchema","type":"object","required":["brandUid","name"],"properties":{"brandUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all brands included in a campaign"},"CampaignCategorySchema":{"title":"CampaignCategorySchema","type":"object","description":"This section contains all brands included in a campaign","required":["categoryUid","name"],"properties":{"categoryUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}}},"CampaignProductSchema":{"title":"CampaignProductSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}},"description":"This section contains all individual products included or excluded in a campaign"},"CampaignPricelistSchema":{"title":"CampaignPricelistSchema","type":"object","required":["pricelistUid","name"],"properties":{"pricelistUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains the pricelist included in a campaign"},"CampaignStoreSchema":{"title":"CampaignStoreSchema","type":"object","required":["storeUid","name"],"properties":{"storeUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all stores included in a campaign"},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"},"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"},"campaignNameQuery":{"description":"Reference to a name","in":"query","name":"name","required":false,"schema":{"type":"string"}},"campaignDisplayNameQuery":{"description":"Reference to a display name","in":"query","name":"displayName","required":false,"schema":{"type":"string"}},"campaignCodeQuery":{"description":"Reference to a campaign code","in":"query","name":"campaignCode","required":false,"schema":{"type":"string"}},"campaignValidFromQuery":{"description":"Reference to a valid from","in":"query","name":"validFrom","required":false,"schema":{"type":"string","format":"date-time"}},"campaignValidToQuery":{"description":"Reference to a valid to","in":"query","name":"validTo","required":false,"schema":{"type":"string","format":"date-time"}},"campaignTypeQuery":{"description":"Reference to a type","in":"query","name":"type","required":false,"schema":{"$ref":"#/components/schemas/CampaignTypeENUM"}},"campaignDiscountTypeQuery":{"description":"Reference to a discount type","in":"query","name":"discountType","required":false,"schema":{"$ref":"#/components/schemas/CampaignDiscountTypeENUM"}}}},"paths":{"/tenants/{tenantUid}/campaigns":{"get":{"summary":"Get list of campaigns","description":"Get list of campaigns","tags":["Campaign"],"responses":{"200":{"$ref":"#/components/responses/CampaignListResponse"}},"operationId":"list-campaigns","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"},{"$ref":"#/components/parameters/campaignNameQuery"},{"$ref":"#/components/parameters/campaignDisplayNameQuery"},{"$ref":"#/components/parameters/campaignCodeQuery"},{"$ref":"#/components/parameters/campaignValidFromQuery"},{"$ref":"#/components/parameters/campaignValidToQuery"},{"$ref":"#/components/parameters/campaignTypeQuery"},{"$ref":"#/components/parameters/campaignDiscountTypeQuery"}]}}}}
```

## Create new campaign

> Create new campaign

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Campaign","description":"Campaign"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"CampaignResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponseSchema"}}}}},"schemas":{"CampaignResponseSchema":{"title":"CampaignResponseSchema","type":"object","required":["name","status","displayName","validFrom","validTo","type","discountType","selection","quantityThreshold","amountThreshold","discountAmount","discountPercent","maxUsage","priority","pricelist","stores","campaignUid","campaignCode","preventCombinations"],"properties":{"name":{"type":"string"},"status":{"$ref":"#/components/schemas/CampaignStatusENUM"},"displayName":{"type":"string"},"validFrom":{"type":"string","format":"date-time"},"validTo":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/CampaignTypeENUM"},"discountType":{"$ref":"#/components/schemas/CampaignDiscountTypeENUM"},"selection":{"$ref":"#/components/schemas/CampaignSelectionResponseSchema"},"quantityThreshold":{"type":"integer"},"amountThreshold":{"type":"integer"},"discountAmount":{"type":"integer"},"discountPercent":{"type":"integer"},"maxUsage":{"type":"integer"},"priority":{"type":"integer"},"pricelist":{"$ref":"#/components/schemas/CampaignPricelistSchema"},"stores":{"type":"array","items":{"$ref":"#/components/schemas/CampaignStoreSchema"}},"campaignUid":{"$ref":"#/components/schemas/UID"},"campaignCode":{"type":"string"},"preventCombinations":{"type":"boolean"}}},"CampaignStatusENUM":{"title":"CampaignStatusENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Campaign is in a modeling state. Can be modified|\n| ACTIVE | Campaign is active, and is considered when making sales operations. Campaign can not be modified|\n| CLOSED | Campaign is closed.|","enum":["NEW","ACTIVE","CLOSED"],"type":"string"},"CampaignTypeENUM":{"title":"CampaignTypeENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CAMPAIGN | Normal campaign with rules set|\n| PRICELIST | A campaign that includes a pricelist. No rules applies|","enum":["CAMPAIGN","PRICELIST"],"type":"string"},"CampaignDiscountTypeENUM":{"title":"CampaignDiscountTypeENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CHEAPEST_PRODUCT | Cheapest product will be discounted|\n| QUALIFIED_PRODUCT | All qualified products will be discounted|\n| ORDER_DISCOUNT | An order discount will be added to the order|","enum":["CHEAPEST_PRODUCT","QUALIFIED_PRODUCT","ORDER_DISCOUNT"],"type":"string"},"CampaignSelectionResponseSchema":{"title":"CampaignSelectionResponseSchema","type":"object","description":"Ths section contains all selections done on a campaign","required":["include","exclude"],"properties":{"include":{"$ref":"#/components/schemas/CampaignProductSelectionResponseSchema"},"exclude":{"$ref":"#/components/schemas/CampaignProductSelectionResponseSchema"}}},"CampaignProductSelectionResponseSchema":{"title":"CampaignSelectionResponseSchema","type":"object","description":"Ths section contains all selections done on a campaign","required":["productGroups:","brands","categories","products"],"properties":{"productGroups:":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductGroupSchema"}},"brands":{"type":"array","items":{"$ref":"#/components/schemas/CampaignBrandSchema"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/CampaignCategorySchema"}},"products":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductSchema"}}}},"CampaignProductGroupSchema":{"title":"CampaignProductGroupSchema","type":"object","required":["productGroupUid","name"],"properties":{"productGroupUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all product groups included in a campaign"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CampaignBrandSchema":{"title":"CampaignBrandSchema","type":"object","required":["brandUid","name"],"properties":{"brandUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all brands included in a campaign"},"CampaignCategorySchema":{"title":"CampaignCategorySchema","type":"object","description":"This section contains all brands included in a campaign","required":["categoryUid","name"],"properties":{"categoryUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}}},"CampaignProductSchema":{"title":"CampaignProductSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}},"description":"This section contains all individual products included or excluded in a campaign"},"CampaignPricelistSchema":{"title":"CampaignPricelistSchema","type":"object","required":["pricelistUid","name"],"properties":{"pricelistUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains the pricelist included in a campaign"},"CampaignStoreSchema":{"title":"CampaignStoreSchema","type":"object","required":["storeUid","name"],"properties":{"storeUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all stores included in a campaign"},"CampaignCreateRequestSchema":{"title":"CampaignCreateRequestSchema","type":"object","required":["name","displayName","validFrom","validTo","type","storeUids"],"properties":{"name":{"type":"string"},"displayName":{"type":"string"},"validFrom":{"type":"string","format":"date-time"},"validTo":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/CampaignTypeENUM"},"discountType":{"$ref":"#/components/schemas/CampaignDiscountTypeENUM"},"storeUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"quantityThreshold":{"type":"integer","description":"A quantity that qualifies for the campaign to apply.\n\nIf both quantity and amount are set, both criteria must be met."},"amountThreshold":{"type":"integer","description":"An amount that qualifies for the campaign to apply.\n\nIf both quantity and amount are set, both criteria must be met."},"discountAmount":{"type":"integer","description":"Discount amount given when the criteria are met."},"discountPercent":{"type":"integer","description":"Discount percent given when the criteria are met."},"maxUsage":{"type":"integer","description":"The max number of times the campaign can be applied to the order"},"pricelistUid":{"$ref":"#/components/schemas/UID"},"priority":{"type":"integer","description":"Priority for the campaign if more than one campaign applies.\nLower number = higher priority."},"campaignUid":{"$ref":"#/components/schemas/UID"},"campaignCode":{"type":"string","description":"If campaignCode is set, it means that this campaign has to be manually actived on an order via PUT on the order"},"preventCombinations":{"type":"boolean","description":"Flag to indicate that this campaign should not be combined with other campaigns.\nIf any orderlines matches this campaign and priority is set to 1, no other campaigns will be considered."}}}},"requestBodies":{"CampaignCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCreateRequestSchema"}}}}}},"paths":{"/tenants/{tenantUid}/campaigns":{"post":{"summary":"Create new campaign","description":"Create new campaign","tags":["Campaign"],"responses":{"201":{"$ref":"#/components/responses/CampaignResponse"}},"operationId":"create-campaign","requestBody":{"$ref":"#/components/requestBodies/CampaignCreateRequest"}}}}}
```

## Get details for a campaign

> Get details for a campaign

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Campaign","description":"Campaign"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"CampaignResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponseSchema"}}}}},"schemas":{"CampaignResponseSchema":{"title":"CampaignResponseSchema","type":"object","required":["name","status","displayName","validFrom","validTo","type","discountType","selection","quantityThreshold","amountThreshold","discountAmount","discountPercent","maxUsage","priority","pricelist","stores","campaignUid","campaignCode","preventCombinations"],"properties":{"name":{"type":"string"},"status":{"$ref":"#/components/schemas/CampaignStatusENUM"},"displayName":{"type":"string"},"validFrom":{"type":"string","format":"date-time"},"validTo":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/CampaignTypeENUM"},"discountType":{"$ref":"#/components/schemas/CampaignDiscountTypeENUM"},"selection":{"$ref":"#/components/schemas/CampaignSelectionResponseSchema"},"quantityThreshold":{"type":"integer"},"amountThreshold":{"type":"integer"},"discountAmount":{"type":"integer"},"discountPercent":{"type":"integer"},"maxUsage":{"type":"integer"},"priority":{"type":"integer"},"pricelist":{"$ref":"#/components/schemas/CampaignPricelistSchema"},"stores":{"type":"array","items":{"$ref":"#/components/schemas/CampaignStoreSchema"}},"campaignUid":{"$ref":"#/components/schemas/UID"},"campaignCode":{"type":"string"},"preventCombinations":{"type":"boolean"}}},"CampaignStatusENUM":{"title":"CampaignStatusENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Campaign is in a modeling state. Can be modified|\n| ACTIVE | Campaign is active, and is considered when making sales operations. Campaign can not be modified|\n| CLOSED | Campaign is closed.|","enum":["NEW","ACTIVE","CLOSED"],"type":"string"},"CampaignTypeENUM":{"title":"CampaignTypeENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CAMPAIGN | Normal campaign with rules set|\n| PRICELIST | A campaign that includes a pricelist. No rules applies|","enum":["CAMPAIGN","PRICELIST"],"type":"string"},"CampaignDiscountTypeENUM":{"title":"CampaignDiscountTypeENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CHEAPEST_PRODUCT | Cheapest product will be discounted|\n| QUALIFIED_PRODUCT | All qualified products will be discounted|\n| ORDER_DISCOUNT | An order discount will be added to the order|","enum":["CHEAPEST_PRODUCT","QUALIFIED_PRODUCT","ORDER_DISCOUNT"],"type":"string"},"CampaignSelectionResponseSchema":{"title":"CampaignSelectionResponseSchema","type":"object","description":"Ths section contains all selections done on a campaign","required":["include","exclude"],"properties":{"include":{"$ref":"#/components/schemas/CampaignProductSelectionResponseSchema"},"exclude":{"$ref":"#/components/schemas/CampaignProductSelectionResponseSchema"}}},"CampaignProductSelectionResponseSchema":{"title":"CampaignSelectionResponseSchema","type":"object","description":"Ths section contains all selections done on a campaign","required":["productGroups:","brands","categories","products"],"properties":{"productGroups:":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductGroupSchema"}},"brands":{"type":"array","items":{"$ref":"#/components/schemas/CampaignBrandSchema"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/CampaignCategorySchema"}},"products":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductSchema"}}}},"CampaignProductGroupSchema":{"title":"CampaignProductGroupSchema","type":"object","required":["productGroupUid","name"],"properties":{"productGroupUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all product groups included in a campaign"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CampaignBrandSchema":{"title":"CampaignBrandSchema","type":"object","required":["brandUid","name"],"properties":{"brandUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all brands included in a campaign"},"CampaignCategorySchema":{"title":"CampaignCategorySchema","type":"object","description":"This section contains all brands included in a campaign","required":["categoryUid","name"],"properties":{"categoryUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}}},"CampaignProductSchema":{"title":"CampaignProductSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}},"description":"This section contains all individual products included or excluded in a campaign"},"CampaignPricelistSchema":{"title":"CampaignPricelistSchema","type":"object","required":["pricelistUid","name"],"properties":{"pricelistUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains the pricelist included in a campaign"},"CampaignStoreSchema":{"title":"CampaignStoreSchema","type":"object","required":["storeUid","name"],"properties":{"storeUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all stores included in a campaign"}}},"paths":{"/tenants/{tenantUid}/campaigns/{campaignUid}":{"get":{"summary":"Get details for a campaign","description":"Get details for a campaign","tags":["Campaign"],"responses":{"200":{"$ref":"#/components/responses/CampaignResponse"}},"operationId":"get-campaign-details","parameters":[]}}}}
```

## Update an existing campaign

> Update an existing campaign

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Campaign","description":"Campaign"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"CampaignResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponseSchema"}}}}},"schemas":{"CampaignResponseSchema":{"title":"CampaignResponseSchema","type":"object","required":["name","status","displayName","validFrom","validTo","type","discountType","selection","quantityThreshold","amountThreshold","discountAmount","discountPercent","maxUsage","priority","pricelist","stores","campaignUid","campaignCode","preventCombinations"],"properties":{"name":{"type":"string"},"status":{"$ref":"#/components/schemas/CampaignStatusENUM"},"displayName":{"type":"string"},"validFrom":{"type":"string","format":"date-time"},"validTo":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/CampaignTypeENUM"},"discountType":{"$ref":"#/components/schemas/CampaignDiscountTypeENUM"},"selection":{"$ref":"#/components/schemas/CampaignSelectionResponseSchema"},"quantityThreshold":{"type":"integer"},"amountThreshold":{"type":"integer"},"discountAmount":{"type":"integer"},"discountPercent":{"type":"integer"},"maxUsage":{"type":"integer"},"priority":{"type":"integer"},"pricelist":{"$ref":"#/components/schemas/CampaignPricelistSchema"},"stores":{"type":"array","items":{"$ref":"#/components/schemas/CampaignStoreSchema"}},"campaignUid":{"$ref":"#/components/schemas/UID"},"campaignCode":{"type":"string"},"preventCombinations":{"type":"boolean"}}},"CampaignStatusENUM":{"title":"CampaignStatusENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Campaign is in a modeling state. Can be modified|\n| ACTIVE | Campaign is active, and is considered when making sales operations. Campaign can not be modified|\n| CLOSED | Campaign is closed.|","enum":["NEW","ACTIVE","CLOSED"],"type":"string"},"CampaignTypeENUM":{"title":"CampaignTypeENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CAMPAIGN | Normal campaign with rules set|\n| PRICELIST | A campaign that includes a pricelist. No rules applies|","enum":["CAMPAIGN","PRICELIST"],"type":"string"},"CampaignDiscountTypeENUM":{"title":"CampaignDiscountTypeENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CHEAPEST_PRODUCT | Cheapest product will be discounted|\n| QUALIFIED_PRODUCT | All qualified products will be discounted|\n| ORDER_DISCOUNT | An order discount will be added to the order|","enum":["CHEAPEST_PRODUCT","QUALIFIED_PRODUCT","ORDER_DISCOUNT"],"type":"string"},"CampaignSelectionResponseSchema":{"title":"CampaignSelectionResponseSchema","type":"object","description":"Ths section contains all selections done on a campaign","required":["include","exclude"],"properties":{"include":{"$ref":"#/components/schemas/CampaignProductSelectionResponseSchema"},"exclude":{"$ref":"#/components/schemas/CampaignProductSelectionResponseSchema"}}},"CampaignProductSelectionResponseSchema":{"title":"CampaignSelectionResponseSchema","type":"object","description":"Ths section contains all selections done on a campaign","required":["productGroups:","brands","categories","products"],"properties":{"productGroups:":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductGroupSchema"}},"brands":{"type":"array","items":{"$ref":"#/components/schemas/CampaignBrandSchema"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/CampaignCategorySchema"}},"products":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductSchema"}}}},"CampaignProductGroupSchema":{"title":"CampaignProductGroupSchema","type":"object","required":["productGroupUid","name"],"properties":{"productGroupUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all product groups included in a campaign"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CampaignBrandSchema":{"title":"CampaignBrandSchema","type":"object","required":["brandUid","name"],"properties":{"brandUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all brands included in a campaign"},"CampaignCategorySchema":{"title":"CampaignCategorySchema","type":"object","description":"This section contains all brands included in a campaign","required":["categoryUid","name"],"properties":{"categoryUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}}},"CampaignProductSchema":{"title":"CampaignProductSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}},"description":"This section contains all individual products included or excluded in a campaign"},"CampaignPricelistSchema":{"title":"CampaignPricelistSchema","type":"object","required":["pricelistUid","name"],"properties":{"pricelistUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains the pricelist included in a campaign"},"CampaignStoreSchema":{"title":"CampaignStoreSchema","type":"object","required":["storeUid","name"],"properties":{"storeUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all stores included in a campaign"},"CampaignUpdateRequestSchema":{"title":"CampaignUpdateRequestSchema","type":"object","description":"This request updates an existing campaign.\n\nIMPORTANT! The request must include all storeUids the campaign is valid for.","properties":{"name":{"type":"string"},"displayName":{"type":"string"},"status":{"$ref":"#/components/schemas/CampaignStatusENUM"},"validFrom":{"type":"string","format":"date-time"},"validTo":{"type":"string","format":"date-time"},"storeUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"quantityThreshold":{"type":"integer"},"amountThreshold":{"type":"integer"},"discountAmount":{"type":"integer"},"discountPercent":{"type":"integer"},"maxUsage":{"type":"integer"},"priority":{"type":"integer"},"pricelistUid":{"$ref":"#/components/schemas/OptionalUID"},"campaignCode":{"type":"string"},"discountType":{"$ref":"#/components/schemas/CampaignDiscountTypeENUM"},"preventCombinations":{"type":"boolean"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"}},"requestBodies":{"CampaignUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignUpdateRequestSchema"}}}}}},"paths":{"/tenants/{tenantUid}/campaigns/{campaignUid}":{"put":{"summary":"Update an existing campaign","description":"Update an existing campaign","tags":["Campaign"],"responses":{"200":{"$ref":"#/components/responses/CampaignResponse"}},"operationId":"update-campaign","requestBody":{"$ref":"#/components/requestBodies/CampaignUpdateRequest"}}}}}
```

## Delete an existing campaign

> Delete an existing campaign

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Campaign","description":"Campaign"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}}},"paths":{"/tenants/{tenantUid}/campaigns/{campaignUid}":{"delete":{"summary":"Delete an existing campaign","description":"Delete an existing campaign","tags":["Campaign"],"responses":{"204":{"description":"No Content"}},"operationId":"delete-campaign"}}}}
```

## Set selections on a campaign

> Set selections on a campaign

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Campaign","description":"Campaign"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"CampaignResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponseSchema"}}}}},"schemas":{"CampaignResponseSchema":{"title":"CampaignResponseSchema","type":"object","required":["name","status","displayName","validFrom","validTo","type","discountType","selection","quantityThreshold","amountThreshold","discountAmount","discountPercent","maxUsage","priority","pricelist","stores","campaignUid","campaignCode","preventCombinations"],"properties":{"name":{"type":"string"},"status":{"$ref":"#/components/schemas/CampaignStatusENUM"},"displayName":{"type":"string"},"validFrom":{"type":"string","format":"date-time"},"validTo":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/CampaignTypeENUM"},"discountType":{"$ref":"#/components/schemas/CampaignDiscountTypeENUM"},"selection":{"$ref":"#/components/schemas/CampaignSelectionResponseSchema"},"quantityThreshold":{"type":"integer"},"amountThreshold":{"type":"integer"},"discountAmount":{"type":"integer"},"discountPercent":{"type":"integer"},"maxUsage":{"type":"integer"},"priority":{"type":"integer"},"pricelist":{"$ref":"#/components/schemas/CampaignPricelistSchema"},"stores":{"type":"array","items":{"$ref":"#/components/schemas/CampaignStoreSchema"}},"campaignUid":{"$ref":"#/components/schemas/UID"},"campaignCode":{"type":"string"},"preventCombinations":{"type":"boolean"}}},"CampaignStatusENUM":{"title":"CampaignStatusENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Campaign is in a modeling state. Can be modified|\n| ACTIVE | Campaign is active, and is considered when making sales operations. Campaign can not be modified|\n| CLOSED | Campaign is closed.|","enum":["NEW","ACTIVE","CLOSED"],"type":"string"},"CampaignTypeENUM":{"title":"CampaignTypeENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CAMPAIGN | Normal campaign with rules set|\n| PRICELIST | A campaign that includes a pricelist. No rules applies|","enum":["CAMPAIGN","PRICELIST"],"type":"string"},"CampaignDiscountTypeENUM":{"title":"CampaignDiscountTypeENUM","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| CHEAPEST_PRODUCT | Cheapest product will be discounted|\n| QUALIFIED_PRODUCT | All qualified products will be discounted|\n| ORDER_DISCOUNT | An order discount will be added to the order|","enum":["CHEAPEST_PRODUCT","QUALIFIED_PRODUCT","ORDER_DISCOUNT"],"type":"string"},"CampaignSelectionResponseSchema":{"title":"CampaignSelectionResponseSchema","type":"object","description":"Ths section contains all selections done on a campaign","required":["include","exclude"],"properties":{"include":{"$ref":"#/components/schemas/CampaignProductSelectionResponseSchema"},"exclude":{"$ref":"#/components/schemas/CampaignProductSelectionResponseSchema"}}},"CampaignProductSelectionResponseSchema":{"title":"CampaignSelectionResponseSchema","type":"object","description":"Ths section contains all selections done on a campaign","required":["productGroups:","brands","categories","products"],"properties":{"productGroups:":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductGroupSchema"}},"brands":{"type":"array","items":{"$ref":"#/components/schemas/CampaignBrandSchema"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/CampaignCategorySchema"}},"products":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductSchema"}}}},"CampaignProductGroupSchema":{"title":"CampaignProductGroupSchema","type":"object","required":["productGroupUid","name"],"properties":{"productGroupUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all product groups included in a campaign"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CampaignBrandSchema":{"title":"CampaignBrandSchema","type":"object","required":["brandUid","name"],"properties":{"brandUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all brands included in a campaign"},"CampaignCategorySchema":{"title":"CampaignCategorySchema","type":"object","description":"This section contains all brands included in a campaign","required":["categoryUid","name"],"properties":{"categoryUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}}},"CampaignProductSchema":{"title":"CampaignProductSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}},"description":"This section contains all individual products included or excluded in a campaign"},"CampaignPricelistSchema":{"title":"CampaignPricelistSchema","type":"object","required":["pricelistUid","name"],"properties":{"pricelistUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains the pricelist included in a campaign"},"CampaignStoreSchema":{"title":"CampaignStoreSchema","type":"object","required":["storeUid","name"],"properties":{"storeUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}},"description":"This section contains all stores included in a campaign"},"CampaignSelectionRequestSchema":{"title":"CampaignSelectionRequestSchema","type":"object","description":"This request has 3 sections:\n\ncreate: A selection to create in the campaign\ndelete: A selection to delete from campaign.","properties":{"create":{"$ref":"#/components/schemas/CampaignProductSelectionRequestSchema"},"delete":{"$ref":"#/components/schemas/CampaignProductSelectionRequestSchema"}}},"CampaignProductSelectionRequestSchema":{"title":"CampaignProductSelectionRequestSchema","type":"object","description":"This request contains a selection of product groups, brands and exact productUids to include or exclude in a campaign.\n","properties":{"include":{"$ref":"#/components/schemas/CampaignProductSelectionSchema"},"exclude":{"$ref":"#/components/schemas/CampaignProductSelectionSchema"}}},"CampaignProductSelectionSchema":{"title":"CampaignProductSelectionSchema","type":"object","description":"This section contains all selections done on a campaign","properties":{"productGroupUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"brandUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"categoryUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"productUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}}}}},"requestBodies":{"CampaignSelectionRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignSelectionRequestSchema"}}}}}},"paths":{"/tenants/{tenantUid}/campaigns/{campaignUid}/selections":{"post":{"summary":"Set selections on a campaign","description":"Set selections on a campaign","tags":["Campaign"],"responses":{"200":{"$ref":"#/components/responses/CampaignResponse"}},"operationId":"set-campaign-selections","requestBody":{"$ref":"#/components/requestBodies/CampaignSelectionRequest"}}}}}
```

## List products for a campaign

> List products for a campaign

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Campaign","description":"Campaign"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Accesstoken recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"CampaignProductListResponse":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","required":["items","paging"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProductSchema"}},"paging":{"$ref":"#/components/schemas/Paging"}}}}}}},"schemas":{"CampaignProductSchema":{"title":"CampaignProductSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}},"description":"This section contains all individual products included or excluded in a campaign"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"},"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"},"ProductOnCampaignType":{"title":"ProductOnCampaignType","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| INCLUDE | Query for included products in campaign|\n| EXCLUDE | Query for excluded products in campaign|","enum":["INCLUDE","EXCLUDE"],"type":"string"}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"},"campaignProductOnCampaignTypeQuery":{"description":"Reference to a type of products on a campaign","in":"query","name":"selection","required":false,"schema":{"$ref":"#/components/schemas/ProductOnCampaignType"}}}},"paths":{"/tenants/{tenantUid}/campaigns/{campaignUid}/products":{"get":{"summary":"List products for a campaign","description":"List products for a campaign","tags":["Campaign"],"responses":{"200":{"$ref":"#/components/responses/CampaignProductListResponse"}},"operationId":"list-campaign-products","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"},{"$ref":"#/components/parameters/campaignProductOnCampaignTypeQuery"}]}}}}
```


---

# Agent Instructions: 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:

```
GET https://docs.flowretail.com/docs/developers/api-documentation/campaign.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
