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#
brandId
intoptionalBrand ID as integer.
Response#
200
Content-type: application/json
brandId
brand objectrequiredThe brandId for the brand object.
"14": {"name": "Brand X"}
for brand ID 14.
name
stringoptionalThe name of the brand.
brand
stringoptionalThe ID of the brand.
uri
stringoptionalThe URI of the brand.
metaKeywords metaDescription metaTitle
stringoptionalMeta 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#
campaignSiteURI
stringoptionalCampaign Site URI, unique key for this campaign site.
Response#
200
Content-type: application/json
campaignSiteURI
campaign site objectoptionalCampaign Site URI, unique key for this campaign site.
"canada": {"name": "Canada"}
for campaign site with URI canada
.
name
stringoptionalThe name of the campaign site.
market
stringoptionalThe market ID that should be set for the customer.
goTo
stringoptionalThe URL the customer should be redirected to after the market has been set.
campaignSite
stringoptionalThe 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#
campaignId
intoptionalCampaign ID as integer.
Response#
200
Content-type: application/json
campaignId
stringrequiredThe campaignId
for the campaign object.
"15": {"name": "Campaign X"}
for campaign ID 15.
name
stringoptionalThe name of the campaign.
campaign
stringoptionalThe ID of the campaign.
markets
objectoptionalA 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.
pricelists
objectoptionalA 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.
productsOnSale
arrayoptionalAn 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#
categoryId
intoptionalCategory ID as integer
Response#
200
Content-type: application/json
categoryId
intrequiredThe categoryId
for the category object.
"18": {"name": "Category X"}
for category ID 18.
name
stringoptionalThe name of the category.
category
stringoptionalThe ID of the category.
uri
stringoptionalThe URI for this category.
completeUri
stringoptionalThe complete URI for this category including parent categories.
metaKeywords metaDescription metaTitle
stringoptionalMeta data about the category.
localized
objectoptionalInformation 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".
name
stringoptionalThe name of the category in the localized language.
metaKeywords metaDescription metaTitle
stringoptionalOptional strings that might have a localized translation in the language object.
categories
stringoptionalA 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.
products
array 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#
collectionId
intoptionalCollection ID as integer.
Response#
200
Content-type: application/json
collectionId
stringoptionalThe collectionId
for the collection object.
"19": {"name": "Collection X"}
for collection ID 19.
name
stringoptionalThe name of the collection.
collection
stringoptionalThe ID of the collection.
uri
stringoptionalThe 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#
measurementChartId
intoptionalMeasurement chart ID as integer.
Response#
200
Content-type: application/json
measurementChartId
intoptionalThe measurementChartId
for the measurement chart object.
"20": {"name": "Women Jeans"}
for measurement chart ID 20.
name
stringoptionalThe name of the measurement chart.
rows
objectoptionalAn 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 item
objectoptionalThe columns for this row. The key values in the object are each column name corresponding with the values in columnNames
.
value of each item
stringoptionalThe 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]
.
rowNames
arrayoptionalA sorted list of the rows that should be listed in the measurement chart. Each value corresponds with the object in "rows": {}
.
columnNames
arrayoptionalA 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}}
.
unit
stringoptionalThe 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#
productId
intoptionalProduct 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:
products
string or arrayoptionalProduct IDs, passed as string or array of strings
"products": "123"
or "products": ["124", "125"]
uri
stringoptionalProduct URI
"uri": "the-uri-of-the-product"
quantity
intoptionalMaximum number of returned products. Recommended range: between 10 and 100
offset
intoptionalOffset in the filtered list from where results will be returned
silkProduct
stringoptionalCentra product ID.
silkVariant
stringoptionalCentra variant ID.
categories
string or array of stringsoptionalFilter on the category ID for the products.
"categories": "123"
or "categories": ["123", "124"]
.
sku
stringoptionalFilter on product SKU.
market
string or intoptionalFilter on market ID.
preview
booleanoptionalReturn 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.