Header options
Preview
Using Preview, you can skip the cache timer or see hidden items (pages, products, categories). Preview is a boolean value with a default value of false.
Preview off
previewOff-header-inputpreviewOff-inputpreviewOff-querypreviewOff-output
{
"token": "<your token>",
"shopid": "demostore"
}
{
"articleNumber": "i-am-hidden-in-price-list"
}
query HiddenProduct($articleNumber: String){
product(articleNumber: $articleNumber) {
name
campaigns{name}
badges{name}
}
}
{
"errors": [
{
"message": "",
"extensions": {
"code": "ProductNotFound",
"codes": [
"ProductNotFound"
]
}
}
],
"data": {
"product": null
}
}
Preview on
previewOn-header-inputpreviewOn-inputpreviewOn-querypreviewOn-output
{
"token": "<your token>",
"shopid": "demostore",
"preview": true
}
{
"articleNumber": "i-am-hidden-in-price-list"
}
query HiddenProduct($articleNumber: String){
product(articleNumber: $articleNumber) {
name
campaigns{name}
badges{name}
}
}
{
"data": {
"product": {
"name": "Watch Classic",
"campaigns": [],
"badges": [
{
"name": "SALE Top Left"
},
{
"name": "News"
}
]
}
}
}
Authorization
Occasionally, queries and mutations will need a token to be passed along. To obtain a token, you can use the login mutation. Here's a guide.
authorization-header-inputauthorization-queryauthorization-output
{
"token": "<your token>",
"shopid": "demostore",
"authorization":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9---"
}
query GetCustomer{
customer {
email
language {
name
}
billingAddress {
firstName
lastName
addressName
}
}
}
{
"data": {
"customer": {
"email": "Jane.Doe@norce.se",
"language": {
"name": "English"
},
"billingAddress": {
"firstName": "Jane",
"lastName": "Doe",
"addressName": "Twin Peaks"
}
}
}
}
Culture
As self-explanatory as it sounds, culture gets everything that is translated into that culture. Below an example will show how the category tree changes names depending on the culture.
Default culture
category-header-inputcategory-querycategory-output
{
"token": "<your token>",
"shopid": "demostore"
}
query GetCategoriesWithCulture {
categories {
name
}
}
{
"data": {
"categories": [
{
"name": "New arrivals"
},
{
"name": "Campaigns"
},
{
"name": "Bikes"
},
{
"name": "Accessories"
},
{
"name": "Furniture"
},
{
"name": "Brands"
}
]
}
}
Sv-SE culture
category-svSE-Culture-header-inputcategory-svSE-Culture-querycategory-svSE-Culture-output
{
"token": "<your token>",
"shopid": "demostore",
"culture": "sv-SE"
}
query GetCategoriesWithCulture {
categories {
name
}
}
{
"data": {
"categories": [
{
"name": "Nyheter"
},
{
"name": "Kampanjer"
},
{
"name": "Cyklar"
},
{
"name": "Accessoarer"
},
{
"name": "Möbler"
},
{
"name": "Märken A-Z"
}
]
}
}
Channel
A channel can determine a lot of the shop's state, like pricing, layout, and category tree. It can even be seen as an entirely different shop if so. Here is an example of how the startpage changes depending on the channel.
Default channel
startPage-header-inputstartPage-querystartPage-output
{
"token": "<your token>",
"shopid": "demostore",
}
query GetStartPageData {
startPage {
data {
id
items {
type
properties {
name
type
value {
... on StringValue {
value
}
}
}
}
}
}
}
{
"data": {
"startPage": {
"data": {
"id": "9e2343d2-77d6-44c3-a314-1b95324696ce",
"items": [
{
"type": "Hero",
"properties": [
{
"name": "header",
"type": "text",
"value": {
"value": "News! "
}
},
{
"name": "text",
"type": "text",
"value": {
"value": "New season, new styles. Products from your favorite brands in store now!"
}
},
{
"name": "buttonText",
"type": "text",
"value": {
"value": "Shop now"
}
},
{
"name": "buttonLink",
"type": "link",
"value": {
"value": "/furniture"
}
},
{
"name": "imageSrc",
"type": "image",
"value": {
"value": "https://www.demostore.se/pub_docs/files/Custom_Item_Images/apartment-decors-design-700549.jpg"
}
},
{
"name": "isAboveFold",
"type": "bool",
"value": {}
}
]
},
{
"type": "Categories",
"properties": [
{
"name": "header",
"type": "text",
"value": {
"value": "Selected Categories"
}
}
]
},
{
"type": "Campaign",
"properties": [
{
"name": "header",
"type": "text",
"value": {
"value": "Refresh your look"
}
},
{
"name": "text",
"type": "text",
"value": {
"value": "Get 2 glasses for 2000kr"
}
},
{
"name": "imageSrc",
"type": "image",
"value": {
"value": "https://www.demostore.se/pub_docs/files/Custom_Item_Images/eyewear-sunglasses-1669595.jpg"
}
},
{
"name": "buttonText",
"type": "text",
"value": {
"value": "To the campaign"
}
},
{
"name": "buttonLink",
"type": "link",
"value": {
"value": "/campaigns/get-2-glasses-for-2000kr"
}
},
{
"name": "alignment",
"type": "dropdown",
"value": {
"value": "left"
}
}
]
},
{
"type": "ProductGrid",
"properties": [
{
"name": "header",
"type": "text",
"value": {
"value": "Refresh your look"
}
},
{
"name": "product1",
"type": "product",
"value": {}
},
{
"name": "product2",
"type": "product",
"value": {}
},
{
"name": "product3",
"type": "product",
"value": {}
},
{
"name": "product4",
"type": "product",
"value": {}
}
]
},
{
"type": "HTML",
"properties": [
{
"name": "html",
"type": "html",
"value": {
"value": "<p><a href=\"/some/rurl\">aawda</a></p>"
}
}
]
}
]
}
}
}
}
Channel 3
startPage-channel3-header-inputstartPage-channel3-querystartPage-channel3-output
{
"token": "<your token>",
"shopid": "demostore",
"channelId": 3
}
query GetStartPageData
startPage {
data {
id
items {
type
properties {
name
type
value {
... on StringValue {
value
}
}
}
}
}
}
}
{
"data": {
"startPage": {
"data": {
"id": "7c8940ff-74bd-4fbb-95b8-631ad09424c3",
"items": [
{
"type": "Hero",
"properties": [
{
"name": "header",
"type": "text",
"value": {
"value": "AWESOME NYHETER!"
}
},
{
"name": "text",
"type": "text",
"value": {
"value": "Ny sesong, nye stiler. Produkter fra favorittmerkene dine i butikken nå!"
}
},
{
"name": "buttonText",
"type": "text",
"value": {
"value": "Handle nå"
}
},
{
"name": "buttonLink",
"type": "link",
"value": {
"value": "/news"
}
},
{
"name": "imageSrc",
"type": "image",
"value": {
"value": "https://www.demostore.se/pub_docs/files/Custom_Item_Images/apartment-decors-design-700549.jpg"
}
}
]
},
{
"type": "Hero",
"properties": [
{
"name": "header",
"type": "text",
"value": {
"value": "TEST"
}
},
{
"name": "text",
"type": "text",
"value": {
"value": "Ny sesong, nye stiler. Produkter fra favorittmerkene dine i butikken nå!"
}
},
{
"name": "buttonText",
"type": "text",
"value": {
"value": "Handle nå"
}
},
{
"name": "buttonLink",
"type": "link",
"value": {
"value": "/news"
}
},
{
"name": "imageSrc",
"type": "image",
"value": {
"value": "https://www.demostore.se/pub_docs/files/Custom_Item_Images/apartment-decors-design-700549.jpg"
}
}
]
},
{
"type": "Categories",
"properties": [
{
"name": "header",
"type": "text",
"value": {
"value": "Utvalgte kategorier"
}
}
]
},
{
"type": "Hero",
"properties": [
{
"name": "header",
"type": "text",
"value": {
"value": "Awesome News Again!"
}
},
{
"name": "text",
"type": "text",
"value": {
"value": "Ny sesong, nye stiler. Produkter fra favorittmerkene dine i butikken nå!"
}
},
{
"name": "buttonText",
"type": "text",
"value": {
"value": "Handle nå"
}
},
{
"name": "buttonLink",
"type": "link",
"value": {
"value": "/news"
}
},
{
"name": "imageSrc",
"type": "image",
"value": {
"value": "https://www.demostore.se/pub_docs/files/Custom_Item_Images/apartment-decors-design-700549.jpg"
}
}
]
},
{
"type": "Campaign",
"properties": [
{
"name": "header",
"type": "text",
"value": {
"value": "Oppdater utseendet ditt"
}
},
{
"name": "text",
"type": "text",
"value": {
"value": "Få 2 glass for 2000kr"
}
},
{
"name": "imageSrc",
"type": "image",
"value": {
"value": "https://www.demostore.se/pub_docs/files/Custom_Item_Images/eyewear-sunglasses-1669595.jpg"
}
},
{
"name": "buttonText",
"type": "text",
"value": {
"value": "Til kampanjen"
}
},
{
"name": "buttonLink",
"type": "link",
"value": {
"value": "/campaigns/get-2-glasses-for-2000kr"
}
},
{
"name": "alignment",
"type": "dropdown",
"value": {
"value": "right"
}
}
]
},
{
"type": "ProductGrid",
"properties": [
{
"name": "header",
"type": "text",
"value": {
"value": "Oppdater utseendet ditt"
}
},
{
"name": "product1",
"type": "product",
"value": {}
},
{
"name": "product2",
"type": "product",
"value": {}
},
{
"name": "product3",
"type": "product",
"value": {}
},
{
"name": "product4",
"type": "product",
"value": {}
}
]
}
]
}
}
}
}