Purpose: create one product (one size), or update it when a product with this
identifier already exists. The product group (parent) is created automatically
with the first size. Send one call per size.
Always send the complete product. Every call replaces the product information:
the following values are cleared when you leave them out: quantity,
special_price, special_price_from_date, special_price_to_date,
purchase_price, name, description, season, fit, material and, if an MSRP
is agreed with Winkelstraat, msrp and msrp_variation. A missing
condition_type is reset to new. price and color cannot be cleared: when you
leave them out of an update, they keep their current value and the response is
207, with price or color listed in skipped_attributes. To change one value
only, use
PATCH /api/rest/v1/retailer/products/{code}/attribute/{attribute_code}.
Required fields
| Field | Required | Expected value |
|---|---|---|
identifier |
always | Your SKU for this size. a-z A-Z 0-9 _ - only. |
category |
always | One category code from GET /categories/codes, as a string. |
values.manufacturer |
always | Brand code from GET /attributes/manufacturer/options. |
values.manufacturer_product_number |
always | The brand's article number. |
values.color |
new product | Colour code from GET /attributes/color/options. |
values.size |
new product | Size code from GET /attributes/size/options. |
values.price |
new product | Selling price in EUR, above 0. |
values.quantity |
new product | Stock, a whole number of 0 or higher. With 0 the product is not created (202). |
values.ean |
depends on brand | Required when the brand requires an EAN. Must be unique within your products. |
Optional fields
| Field | Expected value |
|---|---|
parent |
Your code for the product group (all sizes of one article in one colour). Generated when left out; we recommend sending it. |
enabled |
Leave it out or send true. false is rejected; use DELETE to stop selling a product. |
values.name, values.description |
Text per language (nl_NL, en_US). |
values.msrp |
Recommended retail price in EUR. Only accepted if agreed with Winkelstraat; then it is cleared when you leave it out of an update. |
values.special_price, values.special_price_from_date, values.special_price_to_date |
Sale price in EUR and the period it applies (dates as YYYY-MM-DD). |
values.season, values.condition_type, values.fit, values.material |
See GET /attributes. condition_type defaults to new. |
values.manufacturer_product_color |
The brand's colour code or name. |
values.image_default, values.image_1, … |
Public image URLs. See the Images topic. |
Possible values
Brand, colour, size, season and condition must be codes that Winkelstraat supports. See the Attribute values topic for where to find them.
Responses
201: the product was created.204: an existing product was updated.202: a new product was sent withquantity0and was not created.207: the product was saved, but some values were skipped. Usually an update; a create gives207when a value does not apply to this kind of product.409: nothing was saved; retry the same request.422: nothing was saved;messageexplains the problem.
Body
Required
-
Your SKU for this product (one size). Allowed characters
a-z A-Z 0-9 _ -. -
Your code for the product group (all sizes of one article in one colour). Allowed characters
a-z A-Z 0-9 _ -. Generated when left out. -
One category code from
GET /api/rest/v1/retailer/categories/codes -
Leave it out or send
true.falseis rejected.Default value is
true. -
Product values per attribute code. See the Attribute values topic and the required fields of the create endpoint.
curl \
--request POST 'https://content.winkelstraat.nl/api/rest/v1/retailer/products' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"identifier": "TSHIRT-001-BLACK-M",
"parent": "TSHIRT-001-BLACK",
"category": "120",
"values": {
"manufacturer": [
{
"data": "guess",
"locale": null
}
],
"manufacturer_product_number": [
{
"data": "G1234",
"locale": null
}
],
"manufacturer_product_color": [
{
"data": "jet black",
"locale": null
}
],
"name": [
{
"data": "Basic T-shirt",
"locale": "en_US"
},
{
"data": "Basic T-shirt",
"locale": "nl_NL"
}
],
"description": [
{
"data": "Cotton T-shirt with a round neck.",
"locale": "en_US"
},
{
"data": "Katoenen T-shirt met ronde hals.",
"locale": "nl_NL"
}
],
"color": [
{
"data": "black",
"locale": null
}
],
"size": [
{
"data": "m",
"locale": null
}
],
"ean": [
{
"data": "8712345000028",
"locale": null
}
],
"price": [
{
"data": [
{
"amount": "29.95",
"currency": "EUR"
}
],
"locale": null
}
],
"quantity": [
{
"data": 10,
"locale": null
}
],
"image_default": [
{
"data": "https://cdn.example.com/products/tshirt-001-black-front.jpg",
"locale": null
}
],
"image_1": [
{
"data": "https://cdn.example.com/products/tshirt-001-black-back.jpg",
"locale": null
}
]
}
}'
{
"identifier": "TSHIRT-001-BLACK-M",
"parent": "TSHIRT-001-BLACK",
"category": "120",
"values": {
"manufacturer": [
{
"data": "guess",
"locale": null
}
],
"manufacturer_product_number": [
{
"data": "G1234",
"locale": null
}
],
"manufacturer_product_color": [
{
"data": "jet black",
"locale": null
}
],
"name": [
{
"data": "Basic T-shirt",
"locale": "en_US"
},
{
"data": "Basic T-shirt",
"locale": "nl_NL"
}
],
"description": [
{
"data": "Cotton T-shirt with a round neck.",
"locale": "en_US"
},
{
"data": "Katoenen T-shirt met ronde hals.",
"locale": "nl_NL"
}
],
"color": [
{
"data": "black",
"locale": null
}
],
"size": [
{
"data": "m",
"locale": null
}
],
"ean": [
{
"data": "8712345000028",
"locale": null
}
],
"price": [
{
"data": [
{
"amount": "29.95",
"currency": "EUR"
}
],
"locale": null
}
],
"quantity": [
{
"data": 10,
"locale": null
}
],
"image_default": [
{
"data": "https://cdn.example.com/products/tshirt-001-black-front.jpg",
"locale": null
}
],
"image_1": [
{
"data": "https://cdn.example.com/products/tshirt-001-black-back.jpg",
"locale": null
}
]
}
}
{
"code": 207,
"message": "Product updated with skipped attributes",
"skipped_attributes": [
{
"attribute": "color",
"value": "darkblue",
"reason": "The color value darkblue is not supported/disabled"
},
{
"attribute": "size",
"value": "xxxs",
"reason": "The size with value 'xxxs' is not supported/disabled"
}
]
}
{
"code": 42,
"message": "string",
"skipped_attributes": [
{
"attribute": "string",
"reason": "string"
}
]
}
{
"code": 401,
"message": "The access token provided is invalid."
}
{
"code": 42,
"message": "string"
}
{
"code": 403,
"message": "Access forbidden. You are not allowed to list products."
}
{
"code": 42,
"message": "string"
}
{
"code": 409,
"message": "Could not lock \"wsnl123-TSHIRT-001-BLACK\"; the write was not applied and can be retried"
}
{
"code": 42,
"message": "string"
}
{
"code": 415,
"message": "\"xxx\" in \"Content-Type\" header is not valid. Only \"application/json\" is allowed."
}
{
"code": 42,
"message": "string"
}
{
"code": 422,
"message": "The color value darkblue is not supported/disabled"
}
{
"code": 42,
"message": "string"
}