For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create new campaign

Create new campaign

Required permissions: CAMPAIGN

post
/tenants/{tenantUid}/campaigns
Authorizations
AuthorizationstringRequired

Access token recevied after user login with a deviceToken

Path parameters
tenantUidstringRequired

Reference to a tenant.

Pattern: ^[A-Za-z0-9-_]+
Body
namestringRequired
displayNamestringRequired
validFromstring · date-timeRequired
validTostring · date-timeRequired
typestring · enumRequired
ENUMDescription
CAMPAIGNNormal campaign with rules set
PRICELISTA campaign that includes a pricelist. No rules applies
Possible values:
discountTypestring · enumOptional
ENUMDescription
CHEAPEST_PRODUCTCheapest product will be discounted
QUALIFIED_PRODUCTAll qualified products will be discounted
ORDER_DISCOUNTAn order discount will be added to the order
Possible values:
storeUidsstring[]Required
quantityThresholdintegerOptional

A quantity that qualifies for the campaign to apply.

If both quantity and amount are set, both criteria must be met.

amountThresholdintegerOptional

An amount that qualifies for the campaign to apply.

If both quantity and amount are set, both criteria must be met.

discountAmountintegerOptional

Discount amount given when the criteria are met.

discountPercentintegerOptional

Discount percent given when the criteria are met.

maxUsageintegerOptional

The max number of times the campaign can be applied to the order

pricelistUidstringOptionalPattern: ^[A-Za-z0-9-_]+
priorityintegerOptional

Priority for the campaign if more than one campaign applies. Lower number = higher priority.

campaignUidstringOptionalPattern: ^[A-Za-z0-9-_]+
campaignCodestringOptional

If campaignCode is set, it means that this campaign has to be manually actived on an order via PUT on the order

preventCombinationsbooleanOptional

Flag to indicate that this campaign should not be combined with other campaigns. If any orderlines matches this campaign and priority is set to 1, no other campaigns will be considered.

customerGroupUidstringOptionalPattern: ^[A-Za-z0-9-_]+
Responses
201

Example response

application/json
namestringRequired
statusstring · enumRequired
ENUMDescription
NEWCampaign is in a modeling state. Can be modified
ACTIVECampaign is active, and is considered when making sales operations. Campaign can not be modified
CLOSEDCampaign is closed.
Possible values:
displayNamestringRequired
validFromstring · date-timeRequired
validTostring · date-timeRequired
typestring · enumRequired
ENUMDescription
CAMPAIGNNormal campaign with rules set
PRICELISTA campaign that includes a pricelist. No rules applies
Possible values:
discountTypestring · enumRequired
ENUMDescription
CHEAPEST_PRODUCTCheapest product will be discounted
QUALIFIED_PRODUCTAll qualified products will be discounted
ORDER_DISCOUNTAn order discount will be added to the order
Possible values:
quantityThresholdintegerRequired
amountThresholdintegerRequired
discountAmountintegerRequired
discountPercentintegerRequired
maxUsageintegerRequired
priorityintegerRequired
campaignUidstringRequiredPattern: ^[A-Za-z0-9-_]+
campaignCodestringRequired
preventCombinationsbooleanRequired
post/tenants/{tenantUid}/campaigns
POST /v2/tenants/{tenantUid}/campaigns HTTP/1.1
Host: api.flowretail.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 410

{
  "name": "text",
  "displayName": "text",
  "validFrom": "2026-01-01T00:00:00.000Z",
  "validTo": "2026-01-01T00:00:00.000Z",
  "type": "CAMPAIGN",
  "discountType": "CHEAPEST_PRODUCT",
  "storeUids": [
    "text"
  ],
  "quantityThreshold": 1,
  "amountThreshold": 1,
  "discountAmount": 1,
  "discountPercent": 1,
  "maxUsage": 1,
  "pricelistUid": "text",
  "priority": 1,
  "campaignUid": "text",
  "campaignCode": "text",
  "preventCombinations": true,
  "customerGroupUid": "text"
}
201

Example response

{
  "name": "text",
  "status": "NEW",
  "displayName": "text",
  "validFrom": "2026-01-01T00:00:00.000Z",
  "validTo": "2026-01-01T00:00:00.000Z",
  "type": "CAMPAIGN",
  "discountType": "CHEAPEST_PRODUCT",
  "selection": {
    "include": {
      "productGroups:": [
        {
          "productGroupUid": "text",
          "name": "text"
        }
      ],
      "brands": [
        {
          "brandUid": "text",
          "name": "text"
        }
      ],
      "categories": [
        {
          "categoryUid": "text",
          "name": "text"
        }
      ],
      "products": [
        {
          "productUid": "text",
          "name": "text",
          "sku": "text"
        }
      ]
    },
    "exclude": {
      "productGroups:": [
        {
          "productGroupUid": "text",
          "name": "text"
        }
      ],
      "brands": [
        {
          "brandUid": "text",
          "name": "text"
        }
      ],
      "categories": [
        {
          "categoryUid": "text",
          "name": "text"
        }
      ],
      "products": [
        {
          "productUid": "text",
          "name": "text",
          "sku": "text"
        }
      ]
    }
  },
  "quantityThreshold": 1,
  "amountThreshold": 1,
  "discountAmount": 1,
  "discountPercent": 1,
  "maxUsage": 1,
  "priority": 1,
  "pricelist": {
    "pricelistUid": "text",
    "name": "text"
  },
  "stores": [
    {
      "storeUid": "text",
      "name": "text"
    }
  ],
  "campaignUid": "text",
  "campaignCode": "text",
  "preventCombinations": true,
  "customerGroup": {
    "customerGroupUid": "text",
    "name": "text"
  }
}

Last updated

Was this helpful?