Product

Get Single

This returns a represenation of a product.

URL : /:organizationid/:pimid/api/v0.1/product/:productid

URL Parameters:

organizationid=[string] is the ID of the chainbox.io organization.

pimid=[string] is the APP ID of the PIM application.

productid=[string] is the ID of the Product to be updated.

Method: GET

Auth required: YES

Authorization required: read

Response headers:

Last-Modified: Timestamp when the product was last modified

Response body example

{
  "name": "Bike Attitude - Kædelås",
  "channels": ['webshop'],
  "attributedata": {
    "unit": "STK",
    "group": "12345",
    "ean": "57012121212",
    "weight": 770.0,
    "height": 7.5,
    "width": 11.0,
    "length": 22.0,
    "volume": 0.0,
    "related-products": [
      "AT2217001",
      "1801121"
    ],
    "erp-name": "Bike Attitude - Kædelås",
    "erp-weight": 770.0,
    "erp-unit": "STK",
    "las": [
      "Nøgle"
    ],
    "laasemekanisme": [
      "Nøgle"
    ],
    "montering": [
      "Aftagelig"
    ],
    "brand": "Bike Attitude",
    "forsikringsgodkendt": false
  },
  "localized_attributedata": {
    "da-DK": {
      "product-stock-days": "3",
      "name": "Bike Attitude - Kædelås",
      "long-description": "<p>Med denne Bike Attitude k&aelig;del&aring;s, kan du l&aring;se din cykel fast.</p>"
    },
    "sv-SE": {
      "name": "Bike Attitude - Kättinglås",
      "long-description": "<p> Med detta Bike Attitude-kedjelås kan du låsa din cykel när du inte använder den.</p>"
    },
    "nn-NO": {
      "name": "Bike Attitude - Kjettinglås",
      "long-description": "<p>Med denne kjedelåsen fra Bike Attitude kan du låse sykkelen når du ikke bruker den.</p>"
    }
  }
}

Get Multiple

This returns a represenation of a product.

URL : /:organizationid/:pimid/api/v0.1/products

URL Parameters:

organizationid=[string] is the ID of the chainbox.io organization.

pimid=[string] is the APP ID of the PIM application.

Method: POST

Auth required: YES

Authorization required: read

Request example

[ "1000", "2000" ]

Response example

Success Response

Code: 200 OK

{
  "1000": {
    "name": "Bike Attitude - Kædelås",
    "channels": ['webshop'],
    "attributedata": {
      "unit": "STK"
    },
    "localized_attributedata": {
      "da-DK": {
        "product-stock-days": "3",
        "name": "Bike Attitude - Kædelås",
        "long-description": "<p>Med denne Bike Attitude k&aelig;del&aring;s, kan du l&aring;se din cykel fast.</p>"
      }
    }
  },
  "2000": {
    "name": "Bike Attitude - Kædelås 2",
    "channels": [],
    "attributedata": {
      "unit": "STK"
    },
    "localized_attributedata": {
      "da-DK": {
        "product-stock-days": "5",
        "name": "Bike Attitude - Kædelås 2",
        "long-description": "<p>Med denne Bike Attitude k&aelig;del&aring;s, 2 kan du l&aring;se din cykel fast.</p>"
      }
    }
  }
}

Search

This returns a list of products matching the filters given

URL : /:organizationid/:pimid/api/v0.1/productsearch

URL Parameters:

organizationid=[string] is the ID of the chainbox.io organization.

pimid=[string] is the APP ID of the PIM application.

Optional: limit=[int] max number of results pr. page

Optional: includeResources=[bool] include resource-references in result (Default: false)

Optional: includeLocalized=[bool] include localized attributes in result (Default: false)

Optional: lastoffsetid=[string] returns items with a id "greater" than this value. This can be used to page through results. A response with more items available than in the list, will return nextoffset-value to be used as lastoffsetid in next request. No default value - not supplying a value will omit this condition.

Method: POST

Auth required: YES

Authorization required: read

Body Parameters:

filter: Filter query (Not documented yet)

projection: Array of attributes to include. If not specified, all attributes are returned

excludeChannels: Array of channels to exlude. A product is excluded if at least of of the channels specified are present.

includeChannels: Array of channels to include. A product is included if at least of of the channels specified are present on the product. If not given, all products are returned.

excludeCategories: Array of categories to exlude. A product is excluded if at least of of the categories specified are present.

includeCategories: Array of categories to include. A product is included if at least of of the categories specified are present on the product. If not given, all products are returned.

localizedProjection: Array of localized-attributes to include. If not specified, all attributes are returned (can only be specified if includeLocalized parameter is true)

projectedLocales: List of locales included (can only be specified if includeLocalized parameter is true). If not specified, all locales are included.

Request example

{ 
    "filter": {
        "rules": [
        { "field": "variant-parent", "operator": "EXISTS" },
        { "field": "ean", "operator": "EQ", "value": "7319202702224" } 
        ],
        "groupingOperator": "AND"
    },
    "projection": ["variant-parent", "ean"],
    "excludedChannels": ["b2c"],
    "includedCategories": ["root_bikes"],
    "localizedProjection": ["name", "short-description","long-description"],
    "projectedLocales": ["da-DK"]
}

Success Response

Code: 200 OK

{
  "data": {
    "10006012": {
      "name": "Inhexskrue ISO4762",
      "attributedata": {
        "variant-parent": "Inhexskrue ISO4762",
        "ean": "7319202702224"
      },
      "channels": ["b2c", "b2b"],
      "categories": ["root_skruer"]
    },
    "10006020": {
      "name": "Inhexskrue ISO476",
      "attributedata": {
        "variant-parent": "Inhexskrue ISO4763",
        "ean": "7319202702224"
      },
      "channels": ["b2c"],
      "categories": ["root_skruer"]
    }
  },
  "counts": {
    "total": 6498,
    "count": 2
  },
  "nextOffset": "1031-25"
}

Patch Single

URL : /:organizationid/:pimid/api/v0.1/product/:productid

URL Parameters:

organizationid=[string] is the ID of the chainbox.io organization.

pimid=[string] is the APP ID of the PIM application.

productid=[string] is the ID of the Product to be updated.

Method: PATCH

Auth required: YES

Authorization required: write

Request headers:

If-Unmodified-Since: Content of the Last-Modified of the GET-call

X-BatchId: batchid if running a "full" import and afterwards deleting all entries without matching batchid

Only the properties in the request are modified. If properties are included but has no value, it's value will be deleted, so make sure to only include properties that are to be modified.

Only attributedata attributes can be modified.

Request example

{
        "attributedata": {
            "brand": "Bike Attitude"
        }
}

Error Responses

Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED

Condition: Referencing an invalid product. Code: 404 NOT FOUND

Condition: Update cannot be processed due to read-only, erp-mapped field etc. Code: 422 UNPROCESSABLE ENTITY

Condition: The product was modified since GET/If-Modified-Since timestamp Code: 412 PRECONDITION FAILED

Patch Multiple

URL : /:organizationid/:pimid/api/v0.1/products

URL Parameters:

organizationid=[string] is the ID of the chainbox.io organization.

pimid=[string] is the APP ID of the PIM application.

Method: PATCH

Request headers:

X-BatchId: batchid if running a "full" import and afterwards deleting all entries without matching batchid

Auth required: YES

Authorization required: write

Only the properties in the request are modified. If properties are included but has no value, it's value will be deleted, so make sure to only include properties that are to be modified.

Only attributedata attributes can be modified.

Request example

{
    "1000": {
        "attributedata": {
            "brand": "Bike Attitude"
        }
    },
    "2000": {
        "attributedata": {
            "brand": "Bike Attitude 2"
        }
    }
}

Error Responses

Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED

Condition: Referencing one or more invalid products. Code: 400 BAD REQUEST

Condition: Update cannot be processed due to read-only, erp-mapped field etc. Code: 422 UNPROCESSABLE ENTITY

Add Channel

URL : /:organizationid/:pimid/api/v0.1/product/:productid/channels

URL Parameters:

organizationid=[string] is the ID of the chainbox.io organization.

pimid=[string] is the APP ID of the PIM application.

productid=[string] is the ID of the Product to be updated.

Method: POST

Auth required: YES

Authorization required: write

Request headers:

If-Unmodified-Since: Content of the Last-Modified of the GET-call

X-BatchId: batchid if running a "full" import and afterwards deleting all entries without matching batchid

Add the requested channels to the product.

Request example

['webshop-dk','webshop-se']

Error Responses

Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED

Condition: Referencing an invalid product. Code: 404 NOT FOUND

Condition: Update cannot be processed due to read-only, erp-mapped field etc. Code: 422 UNPROCESSABLE ENTITY

Condition: The product was modified since GET/If-Modified-Since timestamp Code: 412 PRECONDITION FAILED

Condition: Product already has one of the requested channels. Code: 409 CONFLICT

Remove Channel

URL : /:organizationid/:pimid/api/v0.1/product/:productid/channels

URL Parameters:

organizationid=[string] is the ID of the chainbox.io organization.

pimid=[string] is the APP ID of the PIM application.

productid=[string] is the ID of the Product to be updated.

Method: DELETE

Auth required: YES

Authorization required: write

Request headers:

If-Unmodified-Since: Content of the Last-Modified of the GET-call

X-BatchId: batchid if running a "full" import and afterwards deleting all entries without matching batchid

Remove the channels in the request from the product.

Request example

['webshop-se']

Error Responses

Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED

Condition: Referencing an invalid product. Code: 404 NOT FOUND

Condition: Update cannot be processed due to read-only, erp-mapped field etc. Code: 422 UNPROCESSABLE ENTITY

Condition: The product was modified since GET/If-Modified-Since timestamp Code: 412 PRECONDITION FAILED

Condition: Product does not have one of the requested channels. Code: 409 CONFLICT

Add Category

URL : /:organizationid/:pimid/api/v0.1/product/:productid/categoryrelations

URL Parameters:

organizationid=[string] is the ID of the chainbox.io organization.

pimid=[string] is the APP ID of the PIM application.

productid=[string] is the ID of the Product to be updated.

Method: POST

Auth required: YES

Authorization required: write

Request headers:

If-Unmodified-Since: Content of the Last-Modified of the GET-call

X-BatchId: batchid if running a "full" import and afterwards deleting all entries without matching batchid

Add the requested categories to the product.

Request example

['root_123']

Error Responses

Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED

Condition: Referencing an invalid product. Code: 404 NOT FOUND

Condition: Update cannot be processed due to read-only, erp-mapped field etc. Code: 422 UNPROCESSABLE ENTITY

Condition: The product was modified since GET/If-Modified-Since timestamp Code: 412 PRECONDITION FAILED

Condition: Product already has one of the requested channels. Code: 409 CONFLICT

Remove Category

URL : /:organizationid/:pimid/api/v0.1/product/:productid/categoryrelations

URL Parameters:

organizationid=[string] is the ID of the chainbox.io organization.

pimid=[string] is the APP ID of the PIM application.

productid=[string] is the ID of the Product to be updated.

Method: DELETE

Auth required: YES

Authorization required: write

Request headers:

If-Unmodified-Since: Content of the Last-Modified of the GET-call

X-BatchId: batchid if running a "full" import and afterwards deleting all entries without matching batchid

Remove the categories in the request from the product.

Request example

['root_123']

Error Responses

Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED

Condition: Referencing an invalid product. Code: 404 NOT FOUND

Condition: Update cannot be processed due to read-only, erp-mapped field etc. Code: 422 UNPROCESSABLE ENTITY

Condition: The product was modified since GET/If-Modified-Since timestamp Code: 412 PRECONDITION FAILED

Condition: Product does not have one of the requested channels. Code: 409 CONFLICT

Create new product

URL : /:organizationid/:pimappid/api/v0.2/product

URL Parameters:

organizationid=[string] is the ID of the chainbox.io organization.

pimappid=[string] is the APP ID of the PIM application.

allowrecreate=[bool] Allow a product to be (re)created even if it exists already and has been "soft"-deleted. All data from existing product will be lost. (Default: false)

Method: POST

Auth required: YES

Authorization required: write

Request headers:

Content-Type: application/json

Request example

{
    "sku": "123",
    "name": "Mit product",
    "datasource": "osd-importer"
    "attributedata": {
        "testsection": "testvalue"
    },
     "localized_attributedata": { "da-DK": { "name": "FALL LINE 30,9x350" } },
}

Error Responses

Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED

Condition: The member email has a conflict with another member Code: 409 CONFLICT

Remove Product

URL : /:organizationid/:pimid/api/v0.2/deleteproducts

URL Parameters:

organizationid=[string] is the ID of the chainbox.io organization.

pimid=[string] is the APP ID of the PIM application.

Method: POST

Auth required: YES

Authorization required: write

Request headers:

If-Unmodified-Since: Content of the Last-Modified of the GET-call

Remove the products in the request

Request example

['123', '322']

Error Responses

Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED

Condition: Referencing an invalid product. Code: 404 NOT FOUND

Condition: Update cannot be processed due to read-only, erp-mapped field etc. Code: 422 UNPROCESSABLE ENTITY

Condition: The product was modified since GET/If-Modified-Since timestamp Code: 412 PRECONDITION FAILED

Last updated