younifyd
Menu

Update a promotion

Update a promotion

PUT/update-promotion/{promotionId}

Use it in a workflow

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

Request

Path parameters

promotionIdstringrequired

Promotion id

Request body

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

idstring

Promotion id

versionstring

Promotion version

namestringrequired

Name of the promotion

scheduleobjectrequired
fromstringrequired

The beginning of the time range when the promotion is active

tostringrequired

The end of the time range when the promotion is active

isActivebooleanrequired

Promotion active flag

shopIdarray<string>required

The list of shop ids where the promotion takes place

companyIdarray<string>required

The list of company ids where the promotion takes place

siblingPromotionsobject
enabledboolean
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
idstringrequired

Type of the promotion

One ofbuy_x_get_yautomatic_discountcombo_deal

additionalDataobjectrequired

Additional data of the promotion effect, max_count_type and eligible_items_quantity are optional

globalConditionsarray<object>

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

keystring

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

conditionstring
itemConditionsarray<object>

The list conditions ('item.*') that determine whether promotion is applicable or not for a particular item

keystring

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

conditionstring
prioritystring

Priority of the promotion

additionalDataobject

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 (int32)

Autogenerated tier id

namestring
effectobject1 fields
movinteger (int32)

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

json
{
  "name": "Christmas Promotion",
  "schedule": {
    "from": "2023-05-10T10:00:00+00:00",
    "to": "2024-05-10T10:00:00+00:00"
  },
  "isActive": false,
  "shopId": [
    "139",
    "554"
  ],
  "companyId": [
    "100"
  ],
  "effect": {
    "id": "buy_x_get_y",
    "additionalData": {
      "variant_ids": [
        12389244,
        23985437
      ],
      "max_count": 1,
      "max_count_type": "per_eligible_items_quantity",
      "eligible_items_quantity": 6
    }
  },
  "id": "645e0c241a93369ff53f26e0",
  "version": "645e0c241a93369ff53f26e0",
  "siblingPromotions": {
    "enabled": false,
    "allowList": [
      "645e0c241a93369ff53f26e0",
      "646235bf496f8f56171c3762"
    ],
    "blockList": [
      "64623787496f8f56171c3763"
    ],
    "level": "basket"
  },
  "audiences": {
    "allowList": [
      "645e0c241a93369ff53f26e0",
      "646235bf496f8f56171c3762"
    ],
    "blockList": [
      "64623787496f8f56171c3763"
    ]
  },
  "globalConditions": [
    {
      "key": "mov_100",
      "condition": "payload.items.exists(i, 11003 in i.variant.id)"
    }
  ],
  "itemConditions": [
    {
      "key": "mov_100",
      "condition": "item.color == 'yellow'"
    }
  ]
}

Response

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

idstring

Promotion id

versionstring

Promotion version

namestring

Name of the promotion

scheduleobject
fromstringrequired

The beginning of the time range when the promotion is active

tostringrequired

The end of the time range when the promotion is active

isActiveboolean

Promotion active flag

shopIdarray<string>

The list of shop ids where the promotion takes place

companyIdarray<string>

The list of company ids where the promotion takes place

siblingPromotionsobject
enabledboolean
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
idstringrequired

Type of the promotion

One ofbuy_x_get_yautomatic_discountcombo_deal

additionalDataobjectrequired

Additional data of the promotion effect, max_count_type and eligible_items_quantity are optional

globalConditionsarray<object>

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

keystring

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

conditionstring
itemConditionsarray<object>

The list conditions ('item.*') that determine whether promotion is applicable or not for a particular item

keystring

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

conditionstring
prioritystring

Priority of the promotion

additionalDataobject

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 (int32)

Autogenerated tier id

namestring
effectobject1 fields
movinteger (int32)

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

json
{
  "name": "Christmas Promotion",
  "schedule": {
    "from": "2023-05-10T10:00:00+00:00",
    "to": "2024-05-10T10:00:00+00:00"
  },
  "isActive": false,
  "shopId": [
    "139",
    "554"
  ],
  "companyId": [
    "100"
  ],
  "effect": {
    "id": "buy_x_get_y",
    "additionalData": {
      "variant_ids": [
        12389244,
        23985437
      ],
      "max_count": 1,
      "max_count_type": "per_eligible_items_quantity",
      "eligible_items_quantity": 6
    }
  },
  "id": "645e0c241a93369ff53f26e0",
  "version": "645e0c241a93369ff53f26e0",
  "siblingPromotions": {
    "enabled": false,
    "allowList": [
      "645e0c241a93369ff53f26e0",
      "646235bf496f8f56171c3762"
    ],
    "blockList": [
      "64623787496f8f56171c3763"
    ],
    "level": "basket"
  },
  "audiences": {
    "allowList": [
      "645e0c241a93369ff53f26e0",
      "646235bf496f8f56171c3762"
    ],
    "blockList": [
      "64623787496f8f56171c3763"
    ]
  },
  "globalConditions": [
    {
      "key": "mov_100",
      "condition": "payload.items.exists(i, 11003 in i.variant.id)"
    }
  ],
  "itemConditions": [
    {
      "key": "mov_100",
      "condition": "item.color == 'yellow'"
    }
  ]
}

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