Menu
List campaigns
List campaigns
/v1/campaignsUse it in a workflow
- Add a step and choose the SCAYLE Storefront connector.
- Pick the List campaigns action (under campaigns).
- Fill in the fields below, then reference the result from later steps as
{{listCampaigns.response.data}}.
Request
Query parameters
shopIdintegerThe numeric ID of the shop to resolve the request against. Every shop in a multi-shop setup has a unique `shopId`. **Priority:** `shopId` (or the `X-Shop-Id` header) takes precedence over all other shop identification parameters. When `shopId` is present, `shopKey`, `countryCode`, and `locale` are ignored entirely. **Alternative:** If neither `shopId` nor `X-Shop-Id` is provided, you must supply all three of `shopKey`, `countryCode`, and `locale` together to identify the shop.
shopKeystringThe unique string key identifying the shop (e.g. `sa`, `de`). **Must be provided together with `countryCode` and `locale`** as a query-parameter alternative to `shopId`. All three parameters are mandatory when using this identification method — omitting any one of them results in a validation error. Ignored when `shopId` or the `X-Shop-Id` header is present.
countryCodestringThe ISO 3166-1 alpha-2 country code of the shop (e.g. `DE`, `AT`). Automatically normalised to uppercase. **Must be provided together with `shopKey` and `locale`** as a query-parameter alternative to `shopId`. All three parameters are mandatory when using this identification method — omitting any one of them results in a validation error. Ignored when `shopId` or the `X-Shop-Id` header is present.
localestringThe locale of the shop (e.g. `en_GB`, `de_DE`). Used to validate that the resolved shop's locale matches the requested locale. **Must be provided together with `shopKey` and `countryCode`** as a query-parameter alternative to `shopId`. All three parameters are mandatory when using this identification method — omitting any one of them results in a validation error. Ignored when `shopId` or the `X-Shop-Id` header is present.
pageintegerThe number of the page to retrieve. The combined value of `page * perPage` must not exceed `500000`, which is the maximum number of items that can be returned. _Note: This parameter is mutually exclusive with `offset` and `limit`._
Default 1
perPageintegerThe number of items to retrieve per page. The combined value of `page * perPage` must not exceed `500000`, which is the maximum number of items that can be returned. _Note: This parameter is mutually exclusive with `offset` and `limit`._
Default 100
offsetintegerThe offset of the first item to return. The combined value of `offset + limit` must not exceed `500000`, which is the maximum number of items that can be returned. _Note: This parameter is mutually exclusive with `page` and `perPage`._
Default 0
limitintegerThe combined value of `offset + limit` must not exceed `500000`, which is the maximum number of items that can be returned. _Note: This parameter is mutually exclusive with `page` and `perPage`._
Default 100
sortDirstringOrder the results ascending or descending.
One ofascdescDefault "asc"
sortstringSort the results by the given field.
One ofidreductionstartsAtendsAtDefault "id"
witharray<string>Include additional data in the response. The following table describes all the possible parameters that can be used: Parameter | Description --- | --- customData | Include the custom data associated with the campaign. customData:key() | Include custom data of campaign with empty object. customData:key(keyA\|...) | Include custom data of campaign with only the specified keys.
Headers
X-Shop-IdintegerThe numeric ID of the shop to resolve the request against. Every shop in a multi-shop setup has a unique shop ID. **Priority:** `X-Shop-Id` (or the `shopId` query parameter) takes precedence over all other shop identification parameters. When this header is present, `X-Shop-Key`, `X-Country-Code`, and `X-Locale` are ignored entirely. **Alternative:** If neither `X-Shop-Id` nor `shopId` is provided, you must supply all three of `X-Shop-Key`, `X-Country-Code`, and `X-Locale` together to identify the shop.
X-Shop-KeystringThe unique string key identifying the shop (e.g. `sa`, `de`). **Must be provided together with `X-Country-Code` and `X-Locale`** as a header-based alternative to `X-Shop-Id`. All three headers are mandatory when using this identification method — omitting any one of them results in a validation error. Ignored when `X-Shop-Id` or the `shopId` query parameter is present.
X-Country-CodestringThe ISO 3166-1 alpha-2 country code of the shop (e.g. `DE`, `AT`). Automatically normalised to uppercase. **Must be provided together with `X-Shop-Key` and `X-Locale`** as a header-based alternative to `X-Shop-Id`. All three headers are mandatory when using this identification method — omitting any one of them results in a validation error. Ignored when `X-Shop-Id` or the `shopId` query parameter is present.
X-LocalestringThe locale of the shop (e.g. `en_GB`, `de_DE`). Used to validate that the resolved shop's locale matches the requested locale. **Must be provided together with `X-Shop-Key` and `X-Country-Code`** as a header-based alternative to `X-Shop-Id`. All three headers are mandatory when using this identification method — omitting any one of them results in a validation error. Ignored when `X-Shop-Id` or the `shopId` query parameter is present.
Response
Returns 200 with an object. Read it in later steps with {{listCampaigns.response.data.<field>}}.
paginationoneOfentitiesarray<object>idintegerrequiredA unique numeric identifier.
keystringrequiredA globally-unique ID.
namestringrequiredThe name of the campaign.
descriptionstringrequiredAn optional description of the campaign.
reductionintegerrequiredPercentage discount applied to products that don't have a product-based discount within the campaign.
start_atstringA date string formatted as RFC 3339.
end_atstringA date string formatted as RFC 3339.
startsAtstringrequiredA date string formatted as RFC 3339.
endsAtstringrequiredA date string formatted as RFC 3339.
customDataobjectrequiredAdditional data relevant for the campaign.
headlinestringThe main title of the campaign.
sublinestringA brief description of the campaign, displayed alongside the campaign's main title.
linkstringThe link to the campaign page.
hideCountDownbooleanFlag indicating whether to display a countdown for the campaign's end.
conditionstringDetails about the campaign's terms, such as its duration or the products it applies to.
colorobject2 fieldsThe color palette that customizes the visual style of the campaign.
productobject1 fieldsAn optional set of customization options for the product badge's appearance.
{
"pagination": null,
"entities": [
{
"id": 0,
"key": "string",
"name": "string",
"description": "string",
"reduction": 0,
"startsAt": "2023-01-26T09:30:15Z",
"endsAt": "2023-01-26T09:30:15Z",
"customData": {},
"start_at": "2023-01-26T09:30:15Z",
"end_at": "2023-01-26T09:30:15Z",
"headline": "string",
"subline": "string"
}
]
}
Need more? See the SCAYLE Storefront guide for connection setup and behaviour shared by every action.