API reference

Last updated

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#

brandIdintoptional

Brand ID as integer.

Response#

200 Content-type: application/json

brandIdbrand objectrequired

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

namestringoptional

The name of the brand.

brandstringoptional

The ID of the brand.

uristringoptional

The URI of the brand.

metaKeywords metaDescription metaTitlestringoptional

Meta 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" } }

Shop API - Get Campaign Sites#

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#

campaignSiteURIstringoptional

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.

namestringoptional

The name of the campaign site.

marketstringoptional

The market ID that should be set for the customer.

goTostringoptional

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

campaignSitestringoptional

The 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" } }

title: Shop API - Get Campaigns altTitle: Get Campaigns excerpt: Fetching a single or multiple campaigns. taxonomy: category: docs#

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.

namestringoptional

The name of the campaign.

campaignstringoptional

The ID of the campaign.

marketsobjectoptional

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.

pricelistsobjectoptional

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.

productsOnSalearrayoptional

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:

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" } }

title: Shop API - Get Categories altTitle: Get Categories excerpt: Fetching a single or multiple categories. taxonomy: category: docs#

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#

categoryIdintoptional

Category ID as integer

Response#

200 Content-type: application/json

categoryIdintrequired

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

namestringoptional

The name of the category.

categorystringoptional

The ID of the category.

uristringoptional

The URI for this category.

completeUristringoptional

The complete URI for this category including parent categories.

metaKeywords metaDescription metaTitlestringoptional

Meta data about the category.

localizedobjectoptional

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

namestringoptional

The name of the category in the localized language.

metaKeywords metaDescription metaTitlestringoptional

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

categoriesstringoptional

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 stringsoptional

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

title: Shop API - Get Collections altTitle: Get Collections excerpt: Fetching a single or multiple collections. taxonomy: category: docs#

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#

collectionIdintoptional

Collection ID as integer.

Response#

200 Content-type: application/json

collectionIdstringoptional

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

namestringoptional

The name of the collection.

collectionstringoptional

The ID of the collection.

uristringoptional

The 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" } }

title: Shop API - Get Measurement Charts altTitle: Get Measurement Charts excerpt: Fetching a single or multiple collections. taxonomy: category: docs#

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#

measurementChartIdintoptional

Measurement chart ID as integer.

Response#

200 Content-type: application/json

measurementChartIdintoptional

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

namestringoptional

The name of the measurement chart.

rowsobjectoptional

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 itemobjectoptional

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

value of each itemstringoptional

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

rowNamesarrayoptional

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

columnNamesarrayoptional

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

unitstringoptional

The 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" } }

title: Shop API - Get Products IDs altTitle: Get Products IDs excerpt: Fetching a list of products ids. taxonomy: category: docs#

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

arrayrequired

Product 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"]

title: Shop API - Get Products altTitle: Get Products excerpt: Fetching a single or multiple products. taxonomy: category: docs#

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#

productIdintoptional

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

title: Shop API - Get Filtered Products altTitle: Get Filtered Products excerpt: Fetching a list products based on filters. taxonomy: category: docs#

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.

<!-- ```eval_rst .. _shop-api-filter-products-parameters: ``` -->

Parameters#

One, or many (for POST), of the following parameters can be specified:

productsstring or arrayoptional

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

uristringoptional

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

quantityintoptional

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

offsetintoptional

Offset in the filtered list from where results will be returned

silkProductstringoptional

Centra product ID.

silkVariantstringoptional

Centra variant ID.

categoriesstring or array of stringsoptional

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

skustringoptional

Filter on product SKU.

marketstring or intoptional

Filter on market ID.

previewbooleanoptional

Return products not being activated yet.

  • "preview": true return products for preview
  • "preview": false only 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.