younifyd
Menu

Create a promotion (POST /promotions)

Create a promotion

POST/promotions

Use it in a workflow

  1. Add a step and choose the SCAYLE Admin connector.
  2. Pick the Create a promotion (POST /promotions) action (under Promotions).
  3. Fill in the fields below, then reference the result from later steps as {{createAPromotionPostPromotions.response.data}}.

Request

Query parameters

witharray<string>

Comma-separated list of additional properties that should be included in the response.

Request body

Enter the body as JSON in the step's Body field.

idstring

Promotion id

versionstring

Promotion version

namestringrequired

Name of the promotion

displayNameobject

Display name localisation

statusstringrequired

The status of the promotion

One ofarchivedinactiveactive

activationTypestringrequired

Promotion activation type

One ofautomaticcode

levelstringrequired

Promotion application level

One ofbasketitem

scheduleobjectrequired
fromstring (date-time)required

The beginning of the time range when the promotion is active

tostring (date-time)required

The end of the time range when the promotion is active

companyIdsarray<integer>required

The list of company ids where the promotion takes place

shopCountryIdsobjectrequired
allowListarray<integer>

The list of shop IDs where the promotion is allowed

blockListarray<integer>

The list of shop IDs where the promotion is blocked

siblingPromotionsobject
enabledbooleanrequired
allowListarray<string>

The list of promotion ids that can be applied together with this promotion

blockListarray<string>

The list of promotion ids that can not be applied together with this promotion

levelstring

The level on which promotion is applied

One ofbasket

audiencesobject
allowListarray<string>

The list of audience ids that can use this promotion

blockListarray<string>

The list of audience ids that can not use this promotion

effectobjectrequired
typestringrequired

Type of the promotion

One ofbuy_x_get_yautomatic_discountcombo_deal

additionalDataoneOfrequired

Additional data of the promotion effect, maxCountType and eligibleItemsQuantity are optional

conditionsarray<object>required

The list of conditions ('payload.*') that determines whether the promotion is applicable or not

levelstringrequired

The list of conditions ('payload.*') that determines whether the promotion is applicable or not. If `level = global`, a condition ('payload.*') that determines whether the promotion is applicable or not. If `level = item`, a conditions ('item.*') that determines whether promotion is applicable or not for a particular item.

One ofglobalitem

keystringrequired

Key of the condition. Can be used to identify which condition failed in the validate endpoint

conditionstringrequired

A Common Expression Language valid condition. Available replacements keys: `{{thisPromotionId}}` - will be replace on current promotion id, example: ``` "payload.customData.promotions.exists(i, i == '{{thisPromotionId}}')" ```

itemSetIdsarray<string>

The list of itemSet IDs that can be applied into the promotion

priorityinteger

Priority of the promotion

customDataobject

Additional data of the promotion. Can be legal text or some other info, that will be shown to customer

tiersarray<object>

The list of promotion tiers. Tiers must be sent in ascending order

idinteger

Autogenerated tier id

namestringrequired
effectobjectrequired1 fields
movintegerrequired

Minimal order value requirement for a tier. Value should be in a fractional currency (e.g. cents), if a currency has fractions

usageLimitobject
promotionobject1 fields
promotionCodesobject2 fields
json
{
  "name": "Christmas Promotion",
  "status": "active",
  "activationType": "code",
  "level": "basket",
  "schedule": {
    "from": "2023-05-10T10:00:00+00:00",
    "to": "2024-05-10T10:00:00+00:00"
  },
  "companyIds": [
    100
  ],
  "shopCountryIds": {
    "allowList": [
      1,
      2
    ],
    "blockList": [
      3,
      4
    ]
  },
  "effect": {
    "type": "buy_x_get_y",
    "additionalData": null
  },
  "conditions": [
    {
      "level": "global",
      "key": "mov_100",
      "condition": "payload.items.exists(i, 11003 in i.variant.id)"
    }
  ],
  "id": "645e0c241a93369ff53f26e0",
  "version": "645e0c241a93369ff53f26e0",
  "displayName": {
    "de_DE": "Weihnachtsaktion",
    "en_US": "Christmas promotion"
  }
}

Response

Returns 201 with an object. Read it in later steps with {{createAPromotionPostPromotions.response.data.<field>}}.

idstring

Promotion id

versionstring

Promotion version

namestring

Name of the promotion

displayNameobject

Display name localisation

statusstring

The status of the promotion

One ofarchivedinactiveactive

activationTypestring

Promotion activation type

One ofautomaticcode

levelstring

Promotion application level

One ofbasketitem

scheduleobject
fromstring (date-time)required

The beginning of the time range when the promotion is active

tostring (date-time)required

The end of the time range when the promotion is active

companyIdsarray<integer>

The list of company ids where the promotion takes place

shopCountryIdsobject
allowListarray<integer>

The list of shop IDs where the promotion is allowed

blockListarray<integer>

The list of shop IDs where the promotion is blocked

siblingPromotionsobject
enabledbooleanrequired
allowListarray<string>

The list of promotion ids that can be applied together with this promotion

blockListarray<string>

The list of promotion ids that can not be applied together with this promotion

levelstring

The level on which promotion is applied

One ofbasket

audiencesobject
allowListarray<string>

The list of audience ids that can use this promotion

blockListarray<string>

The list of audience ids that can not use this promotion

effectobject
typestringrequired

Type of the promotion

One ofbuy_x_get_yautomatic_discountcombo_deal

additionalDataoneOfrequired

Additional data of the promotion effect, maxCountType and eligibleItemsQuantity are optional

conditionsarray<object>

The list of conditions ('payload.*') that determines whether the promotion is applicable or not

levelstringrequired

The list of conditions ('payload.*') that determines whether the promotion is applicable or not. If `level = global`, a condition ('payload.*') that determines whether the promotion is applicable or not. If `level = item`, a conditions ('item.*') that determines whether promotion is applicable or not for a particular item.

One ofglobalitem

keystringrequired

Key of the condition. Can be used to identify which condition failed in the validate endpoint

conditionstringrequired

A Common Expression Language valid condition. Available replacements keys: `{{thisPromotionId}}` - will be replace on current promotion id, example: ``` "payload.customData.promotions.exists(i, i == '{{thisPromotionId}}')" ```

itemSetIdsarray<string>

The list of itemSet IDs that can be applied into the promotion

priorityinteger

Priority of the promotion

customDataobject

Additional data of the promotion. Can be legal text or some other info, that will be shown to customer

tiersarray<object>

The list of promotion tiers. Tiers must be sent in ascending order

idinteger

Autogenerated tier id

namestringrequired
effectobjectrequired1 fields
movintegerrequired

Minimal order value requirement for a tier. Value should be in a fractional currency (e.g. cents), if a currency has fractions

usageLimitobject
promotionobject1 fields
promotionCodesobject2 fields
json
{
  "name": "Christmas Promotion",
  "status": "active",
  "activationType": "code",
  "level": "basket",
  "schedule": {
    "from": "2023-05-10T10:00:00+00:00",
    "to": "2024-05-10T10:00:00+00:00"
  },
  "companyIds": [
    100
  ],
  "shopCountryIds": {
    "allowList": [
      1,
      2
    ],
    "blockList": [
      3,
      4
    ]
  },
  "effect": {
    "type": "buy_x_get_y",
    "additionalData": null
  },
  "conditions": [
    {
      "level": "global",
      "key": "mov_100",
      "condition": "payload.items.exists(i, 11003 in i.variant.id)"
    }
  ],
  "id": "645e0c241a93369ff53f26e0",
  "version": "645e0c241a93369ff53f26e0",
  "displayName": {
    "de_DE": "Weihnachtsaktion",
    "en_US": "Christmas promotion"
  }
}

Need more? See the SCAYLE Admin guide for connection setup and behaviour shared by every action.