Skip to main content

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 b2c

Brand ID as integer.

Response

200 Content-type: application/json

brandIdbrand objectrequiredb2b b2c

The brandId for the brand object. "14": {"name": "Brand X"} for brand ID 14.

namestringrequired

The name of the brand.

brandstringrequired

The ID of the brand.

uristringrequired

The URI of the brand.

metaKeywords metaDescription metaTitlestringrequired

Meta 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 b2c

Campaign Site URI, unique key for this campaign site.

Response

200 Content-type: application/json

campaignSiteURIcampaign site objectoptional

Campaign Site URI, unique key for this campaign site. "canada": {"name": "Canada"} for campaign site with URI canada.

namestringrequired

The name of the campaign site.

marketstringrequired

The market ID that should be set for the customer.

goTostringrequired

The URL the customer should be redirected to after the market has been set.

campaignSitestringrequired

The 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

campaignIdintoptional

Campaign ID as integer.

Response

200 Content-type: application/json

campaignIdstringrequired

The campaignId for the campaign object. "15": {"name": "Campaign X"} for campaign ID 15.

namestringrequired

The name of the campaign.

campaignstringrequired

The ID of the campaign.

marketsobjectrequired

A 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.

pricelistsobjectrequired

A 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.

productsOnSalearrayrequired

An 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 b2c

Category ID as integer

Response

200 Content-type: application/json

categoryIdintrequiredb2b b2c

The categoryId for the category object. "18": {"name": "Category X"} for category ID 18.

namestringrequired

The name of the category.

categorystringrequired

The ID of the category.

uristringrequired

The URI for this category.

completeUristringrequired

The complete URI for this category including parent categories.

metaKeywords metaDescription metaTitlestringrequired

Meta data about the category.

localizedobjectrequired

Information 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".

namestringrequired

The name of the category in the localized language.

metaKeywords metaDescription metaTitlestringrequired

Optional strings that might have a localized translation in the language object.

categoriesstringrequired

A 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 stringsrequired

A 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 b2c

Collection ID as integer.

Response

200 Content-type: application/json

collectionIdstringoptionalb2b b2c

The collectionId for the collection object. "19": {"name": "Collection X"} for collection ID 19.

namestringrequired

The name of the collection.

collectionstringrequired

The ID of the collection.

uristringrequired

The 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 b2c

Measurement chart ID as integer.

Response

200 Content-type: application/json

measurementChartIdintoptionalb2b b2c

The measurementChartId for the measurement chart object. "20": {"name": "Women Jeans"} for measurement chart ID 20.

namestringrequired

The name of the measurement chart.

rowsobjectrequired

An 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 itemobjectrequired

The columns for this row. The key values in the object are each column name corresponding with the values in columnNames.

value of each itemstringrequired

The 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].

rowNamesarrayrequired

A sorted list of the rows that should be listed in the measurement chart. Each value corresponds with the object in "rows": {}.

columnNamesarrayrequired

A 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}}.

unitstringrequired

The 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 b2c

Product 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 b2c

Product 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 b2c

Product IDs, passed as string or array of strings "products": "123" or "products": ["124", "125"]

uristringoptionalb2b b2c

Product URI "uri": "the-uri-of-the-product"

quantityintoptionalb2b b2c

Maximum number of returned products. Recommended range: between 10 and 100

offsetintoptionalb2b b2c

Offset in the filtered list from where results will be returned

silkProductstringoptionalb2b b2c

Centra product ID.

silkVariantstringoptionalb2b b2c

Centra variant ID.

categoriesstring or array of stringsoptionalb2b b2c

Filter on the category ID for the products. "categories": "123" or "categories": ["123", "124"].

skustringoptionalb2b b2c

Filter on product SKU.

marketstring or intoptionalb2b b2c

Filter on market ID.

previewbooleanoptionalb2b b2c

Return 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.