API reference
Last updatedGet brands#
Endpoints:
GET *base*/brands
GET *base*/brands/*brandId
Fetches a specific brand referenced by its ID, or the full list of brands..
If the brandId parameter is specified, one brand is fetched, otherwise all brands in the catalog are fetched.
Parameters#
brandIdintoptionalBrand ID as integer.
Response#
200 Content-type: application/json
brandIdbrand objectrequiredThe brandId for the brand object.
"14": {"name": "Brand X"} for brand ID 14.
namestringoptionalThe name of the brand.
brandstringoptionalThe ID of the brand.
uristringoptionalThe URI of the brand.
metaKeywords metaDescription metaTitlestringoptionalMeta data about the brand.
Response example#
1
2
3
4
5
6
7
8
9
10
11
12
13
HTTP/1.1 200 OK
Content-type: application/json
{
"1" : {
"name" : "Brand Name",
"brand" : "1",
"uri" : "brandname",
"metaKeywords" : "",
"metaDescription" : "",
"metaTitle" : ""
}
}
Error example#
1
2
3
4
5
6
7
8
HTTP/1.1 404 Not Found
Content-type: application/json
{
"errors" : {
"brand" : "not found"
}
}
Get campaign sites#
GET *base*/campaign-sites
GET *base*/campaign-sites/*campaignSiteURI*
Fetches a specific campaign site referenced by its name, or the full campaign sites list.
If the campaignSiteURI parameter is specified, one campaign site is fetched, otherwise all campaign sites are fetched.
Parameters#
campaignSiteURIstringoptionalCampaign Site URI, unique key for this campaign site.
Response#
200 Content-type: application/json
campaignSiteURIcampaign site objectoptionalCampaign Site URI, unique key for this campaign site.
"canada": {"name": "Canada"} for campaign site with URI canada.
namestringoptionalThe name of the campaign site.
marketstringoptionalThe market ID that should be set for the customer.
goTostringoptionalThe URL the customer should be redirected to after the market has been set.
campaignSitestringoptionalThe URI for this campaign site.
Response example#
1
2
3
4
5
6
7
8
9
10
11
HTTP/1.1 200 OK
Content-type: application/json
{
"canada" : {
"market" : "16",
"name" : "canada",
"goTo" : "",
"campaignSite" : "canada"
}
}
Error example#
1
2
3
4
5
6
7
8
HTTP/1.1 404 Not Found
Content-type: application/json
{
"errors" : {
"campaignSite" : "not found"
}
}
Get campaigns#
GET *base*/campaigns
GET *base*/campaigns/*campaignId*
Fetches a specific campaign referenced by its ID, or the full campaigns list.
If the campaignId parameter is specified, one campaign is fetched, otherwise all campaigns are fetched.
Parameters#
campaignIdintoptionalCampaign ID as integer.
Response#
200 Content-type: application/json
campaignIdstringrequiredThe campaignId for the campaign object.
"15": {"name": "Campaign X"} for campaign ID 15.
namestringoptionalThe name of the campaign.
campaignstringoptionalThe ID of the campaign.
marketsobjectoptionalA list of markets enabled for this campaign. The key values in the list are the market IDs.
"markets": {"16": {...}} means an object for market ID 16.
pricelistsobjectoptionalA list of pricelists in the market activated in this campaign. The key values in the list are the pricelist IDs.
"pricelists": {"17": {...}} means an object for pricelist ID 17.
productsOnSalearrayoptionalAn array with productIds currently in the campaign.
"20": {"productsOnSale": ["123", "124"]} means the products with ID 123 and 124 is in a campaign for pricelist ID 20.
Response example#
Fetching a list of campaigns:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
HTTP/1.1 200 OK
Content-type: application/json
{
"5": {
"name" : "Outlet",
"campaign" : "5",
"markets" : {
"16" : {
"pricelists" : {
"47" : {
"productsOnSale" : [
"2194",
"2172",
"1639",
]
}
}
}
}
}
}
Fetching a specific campaign using campaignId:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
HTTP/1.1 200 OK
Content-type: application/json
{
"name" : "Outlet",
"campaign" : "5",
"markets" : {
"16" : {
"pricelists" : {
"47" : {
"productsOnSale" : [
"2194",
"2172",
"1639",
]
}
}
}
}
}
Error example#
1
2
3
4
5
6
7
8
HTTP/1.1 404 Not Found
Content-type: application/json
{
"errors" : {
"campaign" : "not found"
}
}
Get categories#
GET *base*/categories
GET *base*/categories/*categoryId*
Fetches a specific category referenced by its ID, or the full list of categories.
If the category-id parameter is specified, one category is fetched, otherwise all categories in the catalog are fetched.
Note that each returned category may contain nested subcategories in the "categories" attribute.
Parameters#
categoryIdintoptionalCategory ID as integer
Response#
200 Content-type: application/json
categoryIdintrequiredThe categoryId for the category object.
"18": {"name": "Category X"} for category ID 18.
namestringoptionalThe name of the category.
categorystringoptionalThe ID of the category.
uristringoptionalThe URI for this category.
completeUristringoptionalThe complete URI for this category including parent categories.
metaKeywords metaDescription metaTitlestringoptionalMeta data about the category.
localizedobjectoptionalInformation about localized versions of the category information. The key values in the list are the localization URIs, such as en, fr, sv etc.
"localized": {"sv": {"name": "Byxor"}} the Swedish category name is "Byxor".
namestringoptionalThe name of the category in the localized language.
metaKeywords metaDescription metaTitlestringoptionalOptional strings that might have a localized translation in the language object.
categoriesstringoptionalA list of nested category objects. The keys in the object is the categoryId of the nested category.
The objects in the list has the same parameters as the parent category.
productsarray of stringsoptionalA list of productId for products in this category.
Response example#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
HTTP/1.1 200 OK
Content-type: application/json
{
"117": {
"metaTitle" : "",
"name" : "Category Name",
"metaDescription" : "",
"sortString" : "s-1",
"localized" : {
"sv" : {
"name" : "Swedish Category Name",
"metaTitle" : "Swedish Meta Title"
},
},
"completeUri" : "category-name",
"metaKeywords" : "",
"category" : "117",
"categories" : {
"... <nested categories> ..."
},
"products" : [
"665",
"2165",
"2177",
],
"sortOrder" : "-1",
"uri" : "category-name"
}
}
Fetching a specific category using categoryId:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
HTTP/1.1 200 OK
Content-type: application/json
{
"metaTitle" : "",
"name" : "Category Name",
"metaDescription" : "",
"sortString" : "s-1",
"localized" : {
"sv" : {
"name" : "Swedish Category Name",
"metaTitle" : "Swedish Meta Title"
},
},
"completeUri" : "category-name",
"metaKeywords" : "",
"category" : "117",
"categories" : {
"... <nested categories> ..."
},
"products" : [
"665",
"2165",
"2177",
],
"sortOrder" : "-1",
"uri" : "category-name"
}
Error example#
1
2
3
4
5
6
7
8
HTTP/1.1 404 Not Found
Content-type: application/json
{
"errors" : {
"category" : "not found"
}
}
Get collections#
GET *base*/collections
GET *base*/collections/*collectionId*
Fetches a specific collection referenced by its ID, or the full list of collections.
If the collection-id parameter is specified, one collection is fetched, otherwise all collections in the catalog are fetched.
Parameters#
collectionIdintoptionalCollection ID as integer.
Response#
200 Content-type: application/json
collectionIdstringoptionalThe collectionId for the collection object.
"19": {"name": "Collection X"} for collection ID 19.
namestringoptionalThe name of the collection.
collectionstringoptionalThe ID of the collection.
uristringoptionalThe URI for this collection.
Response example#
1
2
3
4
5
6
7
8
9
10
HTTP/1.1 200 OK
Content-type: application/json
{
"20": {
"name" : "AW15",
"collection" : "20",
"uri" : "aw15"
}
}
Fetching a specific collection using collectionId:
1
2
3
4
5
6
7
8
HTTP/1.1 200 OK
Content-type: application/json
{
"name" : "AW15",
"collection" : "20",
"uri" : "aw15"
}
Error example#
1
2
3
4
5
6
7
8
HTTP/1.1 404 Not Found
Content-type: application/json
{
"errors" : {
"collection" : "not found"
}
}
Get measurement charts#
GET *base*/measurement-charts
GET *base*/measurement-charts/*measurementChartId*
Fetches a specific measurement chart referenced by its ID, or the full list of measurement charts.
If the measurement-chart-id parameter is specified, one measurement chart is fetched, otherwise all measurement charts in the catalog are fetched.
Parameters#
measurementChartIdintoptionalMeasurement chart ID as integer.
Response#
200 Content-type: application/json
measurementChartIdintoptionalThe measurementChartId for the measurement chart object.
"20": {"name": "Women Jeans"} for measurement chart ID 20.
namestringoptionalThe name of the measurement chart.
rowsobjectoptionalAn object with all values for the table. This could be used as a lookup table to insert the proper values into a measurement chart. The columnNames and rowNames should be used to generate the measurement chart since they are sorted properly. The key values in the object are each row name corresponding with the values in rowNames.
"rows": {"Length": {...}} means one row in the measurement chart will have the title Length. The value of each item is another object with the columns.
value of each itemobjectoptionalThe columns for this row. The key values in the object are each column name corresponding with the values in columnNames.
value of each itemstringoptionalThe value that should be in the specific combination of rowNames[i] + columnNames[i]. This is a lookup table to use when generating the measurement chart.
You should do a lookup like this: columnValue = rows[rowName][columnName].
rowNamesarrayoptionalA sorted list of the rows that should be listed in the measurement chart. Each value corresponds with the object in "rows": {}.
columnNamesarrayoptionalA sorted list of the columns that should be listed in the measurement chart. Each value corresponds with the object in each row from "rows": {"RowHeader": {"Column 1": 12}}.
unitstringoptionalThe unit which the measurement chart is calculated in. For example cm.
Response example#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
HTTP/1.1 200 OK
Content-type: application/json
{
"2": {
"name" : "Test",
"rows" : {
"Length" : {
"L" : "30",
"M" : "27",
"S" : "23"
}
},
"columnNames" : [
"S",
"M",
"L"
],
"unit" : "cm",
"rowNames" : [
"Length"
],
"measurementChart" : "2"
}
}
Fetching a specific collection using collectionId:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
HTTP/1.1 200 OK
Content-type: application/json
{
"name" : "Test",
"rows" : {
"Length" : {
"L" : "30",
"M" : "27",
"S" : "23"
}
},
"columnNames" : [
"S",
"M",
"L"
],
"unit" : "cm",
"rowNames" : [
"Length"
],
"measurementChart" : "2"
}
Error example#
1
2
3
4
5
6
7
8
HTTP/1.1 404 Not Found
Content-type: application/json
{
"errors" : {
"measurementChart" : "not found"
}
}
Get product IDs#
GET *base*/product-ids
Fetches a list of all product IDs. This is a quicker API operation than fetching all products so it can be useful when e.g. comparing a list of products cached in the frontend to those in Centra.
Response#
200 Content-type: application/json
arrayrequiredProduct IDs for all active products in the store.
Response example#
1
2
3
4
HTTP/1.1 200 OK
Content-type: application/json
["123", "124", "125"]
Get products#
GET *base*/products
GET *base*/products/*productId*
Fetches a specific product referenced by its ID, or the full product list.
If the productId parameter is specified, one product is fetched, otherwise all products in the catalog are fetched.
Parameters#
productIdintoptionalProduct ID. This is an internal ID for a product variant in Centra. It's not visible in the Centra admin panel; only through the API. The "Product ID" shown in the General Attributes for a product in Centra's admin is returned as the silkProduct field in the API response.
Response#
200 Content-type: application/json
The object returned will have the productId for each product as the key. The product object is explained under Product data model.
Response example#
1
2
3
4
5
6
7
HTTP/1.1 200 OK
Content-type: application/json
{
"1": {"product-object"},
"2": {"product-object"},
}
Error example#
1
2
3
4
5
6
7
8
HTTP/1.1 404 Not Found
Content-type: application/json
{
"errors" : {
"product" : "not found"
}
}
Get filtered products#
POST *base*/products/filter
Fetches a list of products based on the provided filter parameters. The GET calls below filter the product list on the parameter given in the URI. If you want to filter on several fields at once, you should use POST to /products/filter.
1
.. _shop-api-filter-products-parameters:
Parameters#
One, or many (for POST), of the following parameters can be specified:
productsstring or arrayoptionalProduct IDs, passed as string or array of strings
"products": "123" or "products": ["124", "125"]
uristringoptionalProduct URI
"uri": "the-uri-of-the-product"
quantityintoptionalMaximum number of returned products. Recommended range: between 10 and 100
offsetintoptionalOffset in the filtered list from where results will be returned
silkProductstringoptionalCentra product ID.
silkVariantstringoptionalCentra variant ID.
categoriesstring or array of stringsoptionalFilter on the category ID for the products.
"categories": "123" or "categories": ["123", "124"].
skustringoptionalFilter on product SKU.
marketstring or intoptionalFilter on market ID.
previewbooleanoptionalReturn products not being activated yet.
"preview": truereturn products for preview"preview": falseonly return live products
Request example#
1
2
3
4
5
6
7
8
POST <base>/products/filter HTTP/1.1
Content-type: application/json
{
"market": 123,
"products": ["514", "515"],
"categories": 1
}
Response#
200 Content-type: application/json
The object returned will have the productId for each product as the key. The product object is explained under Product data model.
Response example#
1
2
3
4
5
6
7
HTTP/1.1 200 OK
Content-type: application/json
{
"1": {"product-object"},
"2": {"product-object"},
}
Error example#
1
2
3
4
5
6
7
8
HTTP/1.1 404 Not Found
Content-type: application/json
{
"errors" : {
"categories" : "not found: 1"
}
}
Filter on categories#
GET *base*/products/categories/*categories*
Parameters explained under Multi parameter filtering parameters.
Filter on internal IDs#
GET *base*/products/silk-product/*silkProduct*
GET *base*/products/silk-variant/*silkVariant*
Parameters explained under Multi parameter filtering parameters.
Filter on SKU or URI#
GET *base*/products/sku/*sku*
GET *base*/products/uri/*uri*
Parameters explained under Multi parameter filtering parameters.