Purpose: change a single value of an existing product, for example its stock or price, without sending the whole product. Other values are left unchanged.
Required fields
The body contains values with exactly one attribute: the attribute from the URL.
Attributes that can be changed
quantity, price, special_price, special_price_from_date,
special_price_to_date, purchase_price, condition_type, name, description,
color, season, fit, material and, if agreed with Winkelstraat, msrp and
msrp_variation.
name, description, color, season, fit, material and msrp belong to the
product group: changing them changes them for every size.
Example: set the stock to 15
PATCH /api/rest/v1/retailer/products/TSHIRT-001-BLACK-M/attribute/quantity
{ "values": { "quantity": [ { "data": 15, "locale": null } ] } }
Example: change the price
{ "values": { "price": [ { "data": [ { "amount": "24.95", "currency": "EUR" } ], "locale": null } ] } }
Path parameters
-
The product's
identifier(your SKU) -
Code of the attribute to change, e.g.
quantityorprice
PATCH
/api/rest/v1/retailer/products/{code}/attribute/{attribute_code}
curl \
--request PATCH 'https://content.winkelstraat.nl/api/rest/v1/retailer/products/{code}/attribute/{attribute_code}' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"values": {
"quantity": [
{
"data": 15,
"locale": null
}
]
}
}'
Request examples
{
"values": {
"quantity": [
{
"data": 15,
"locale": null
}
]
}
}
Response examples (401)
{
"code": 401,
"message": "The access token provided is invalid."
}
Response examples (401)
{
"code": 42,
"message": "string"
}
Response examples (403)
{
"code": 403,
"message": "Access forbidden. You are not allowed to list products."
}
Response examples (403)
{
"code": 42,
"message": "string"
}
Response examples (404)
{
"code": 404,
"message": "Product with identifier \"TSHIRT-001-BLACK-M\" not found"
}
Response examples (404)
{
"code": 42,
"message": "string"
}
Response examples (415)
{
"code": 415,
"message": "\"xxx\" in \"Content-Type\" header is not valid. Only \"application/json\" is allowed."
}
Response examples (415)
{
"code": 42,
"message": "string"
}
Response examples (422)
{
"code": 422,
"message": "Cannot update values for attribute 'ean'"
}
Response examples (422)
{
"code": 42,
"message": "string"
}