younifyd
Menu

Get promotions for given filters

Get promotions for given filters

GET/promotions

Use it in a workflow

  1. Add a step and choose the SCAYLE Admin connector.
  2. Pick the Get promotions for given filters action (under Promotions).
  3. Fill in the fields below, then reference the result from later steps as {{getPromotionsForGivenFilters.response.data}}.

Request

Query parameters

filters[id]array<string>

Comma-separated list of IDs of entities that should be used for filtering.

filters[name]string

Entity name value.

filters[companyId]array<integer>

Comma-separated list of company IDs that should be used for filtering.

filters[activeAt]string (date-time)

When provided, only promotions that are active during the specified time will be returned.

filters[shopCountryId]array<integer>

Comma-separated list of shop country IDS that should be used for filtering.

filters[status]array<string>

Comma-separated list of statuses to filter for.

filters[effect]string

Filter for a specific effect of promotions.

One ofbuy_x_get_yautomatic_discountcombo_deal

filters[audienceId]array<string>

Comma-separated list of audience IDs (strings) that should be used for filtering

filters[activationType]string

Filter for a specific activation type

One ofautomaticcode

filters[promotionCodes]array<string>

Comma-separated list of promotion codes that should be used for filtering

filters[itemSetIds]array<string>

Comma-separated list of item set ids that should be used for filtering

witharray<string>

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

limitinteger

Maximum number of entities in the result. When fetching entities with children, the limit always applies to the amount of parent entities (max. 1000).

Default 100

cursorstring

Valid cursor used for pagination.

Response

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

entitiesarray<object>
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

scheduleobjectrequired2 fields
companyIdsarray<integer>required

The list of company ids where the promotion takes place

shopCountryIdsobjectrequired2 fields
siblingPromotionsobject4 fields
audiencesobject2 fields
effectobjectrequired2 fields
conditionsarray<object>required3 fields

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

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>4 fields

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

usageLimitobject2 fields
cursorobject
nextstring

The cursor pointing to the next page. If null there is no next page available.

json
{
  "entities": [
    {
      "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"
      }
    }
  ],
  "cursor": {
    "next": "MQ=="
  }
}

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