API Reference
Get 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
brandIdintoptionalb2b b2cBrand ID as integer.
Response
200 Content-type: application/json
brandIdbrand objectrequiredb2b b2cThe brandId for the brand object.
"14": {"name": "Brand X"} for brand ID 14.
namestringrequiredThe name of the brand.
brandstringrequiredThe ID of the brand.
uristringrequiredThe URI of the brand.
metaKeywords metaDescription metaTitlestringrequiredMeta data about the brand.
Response example
HTTP/1.1 200 OK
Content-type: application/json
{
"1" : {
"name" : "Brand Name",
"brand" : "1",
"uri" : "brandname",
"metaKeywords" : "",
"metaDescription" : "",
"metaTitle" : ""
}
}
Error example
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
campaignSiteURIstringoptionalb2b b2cCampaign 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.
namestringrequiredThe name of the campaign site.
marketstringrequiredThe market ID that should be set for the customer.
goTostringrequiredThe URL the customer should be redirected to after the market has been set.
campaignSitestringrequiredThe URI for this campaign site.
Response example
HTTP/1.1 200 OK
Content-type: application/json
{
"canada" : {
"market" : "16",
"name" : "canada",
"goTo" : "",
"campaignSite" : "canada"
}
}
Error example
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.
namestringrequiredThe name of the campaign.
campaignstringrequiredThe ID of the campaign.
marketsobjectrequiredA 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.
pricelistsobjectrequiredA 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.
productsOnSalearrayrequiredAn 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:
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:
HTTP/1.1 200 OK
Content-type: application/json
{
"name" : "Outlet",
"campaign" : "5",
"markets" : {
"16" : {
"pricelists" : {
"47" : {
"productsOnSale" : [
"2194",
"2172",
"1639",
]
}
}
}
}
}
Error example
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
categoryIdintoptionalb2b b2cCategory ID as integer
Response
200 Content-type: application/json
categoryIdintrequiredb2b b2cThe categoryId for the category object.
"18": {"name": "Category X"} for category ID 18.
namestringrequiredThe name of the category.
categorystringrequiredThe ID of the category.
uristringrequiredThe URI for this category.
completeUristringrequiredThe complete URI for this category including parent categories.
metaKeywords metaDescription metaTitlestringrequiredMeta data about the category.
localizedobjectrequiredInformation 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".
namestringrequiredThe name of the category in the localized language.
metaKeywords metaDescription metaTitlestringrequiredOptional strings that might have a localized translation in the language object.
categoriesstringrequiredA 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 stringsrequiredA list of productId for products in this category.
Response example
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:
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
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
collectionIdintoptionalb2b b2cCollection ID as integer.
Response
200 Content-type: application/json
collectionIdstringoptionalb2b b2cThe collectionId for the collection object.
"19": {"name": "Collection X"} for collection ID 19.
namestringrequiredThe name of the collection.
collectionstringrequiredThe ID of the collection.
uristringrequiredThe URI for this collection.
Response example
HTTP/1.1 200 OK
Content-type: application/json
{
"20": {
"name" : "AW15",
"collection" : "20",
"uri" : "aw15"
}
}
Fetching a specific collection using collectionId:
HTTP/1.1 200 OK
Content-type: application/json
{
"name" : "AW15",
"collection" : "20",
"uri" : "aw15"
}
Error example
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
measurementChartIdintoptionalb2b b2cMeasurement chart ID as integer.
Response
200 Content-type: application/json
measurementChartIdintoptionalb2b b2cThe measurementChartId for the measurement chart object.
"20": {"name": "Women Jeans"} for measurement chart ID 20.
namestringrequiredThe name of the measurement chart.
rowsobjectrequiredAn 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 itemobjectrequiredThe columns for this row. The key values in the object are each column name
corresponding with the values in columnNames.
value of each itemstringrequiredThe 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].
rowNamesarrayrequiredA sorted list of the rows that should be listed in the measurement chart. Each
value corresponds with the object in "rows": {}.
columnNamesarrayrequiredA 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}}.
unitstringrequiredThe unit which the measurement chart is calculated in. For example cm.
Response example
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:
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
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
arrayrequiredb2b b2cProduct IDs for all active products in the store.
Response example
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
productIdintoptionalb2b b2cProduct 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.
Response example
HTTP/1.1 200 OK
Content-type: application/json
{
"1": {"product-object"},
"2": {"product-object"},
}
Error example
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.
.. _shop-api-filter-products-parameters:
Parameters
One, or many (for POST), of the following parameters can be specified:
productsstring or arrayoptionalb2b b2cProduct IDs, passed as string or array of strings "products": "123" or
"products": ["124", "125"]
uristringoptionalb2b b2cProduct URI "uri": "the-uri-of-the-product"
quantityintoptionalb2b b2cMaximum number of returned products. Recommended range: between 10 and 100
offsetintoptionalb2b b2cOffset in the filtered list from where results will be returned
silkProductstringoptionalb2b b2cCentra product ID.
silkVariantstringoptionalb2b b2cCentra variant ID.
categoriesstring or array of stringsoptionalb2b b2cFilter on the category ID for the products. "categories": "123" or
"categories": ["123", "124"].
skustringoptionalb2b b2cFilter on product SKU.
marketstring or intoptionalb2b b2cFilter on market ID.
previewbooleanoptionalb2b b2cReturn products not being activated yet. * "preview": true return products
for preview * "preview": false only return live products
Request example
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.
Response example
HTTP/1.1 200 OK
Content-type: application/json
{
"1": {"product-object"},
"2": {"product-object"},
}
Error example
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.