Bulk create or update product priorities
Creates or updates many product-priority records in a single request. The body is a JSON array of priority objects; for each element, the record of the given product is updated if it exists and created otherwise.
The body must be a JSON array of objects.
If an element is not an object, has no
productkey, or has aproductthat is not a numeric identifier (for example"abc"), the request is rejected with406 Not Acceptableand error codeproduct_priority_700_1.If an element fails field validation — for example a negative
priorityor a numericproductthat does not exist — the request is rejected with400 Bad Request. Elements are validated in order and the response describes only the first failing element, without its position in the array.The request is all-or-nothing: when any element is rejected, no record is created or changed.
An element without
prioritykeeps the existing record's priority, or creates the record with priority0.When the same
productappears more than once, the last element wins.An empty array is accepted and changes nothing.
On success the response is an empty object.
Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.
A JSON array of priority objects for the bulk upsert endpoint. For each element, the record of the given product is updated if it exists and created otherwise. Every element must carry a product.
The identifier of an existing product.
The ranking weight. When omitted, an existing record keeps its priority and a new record gets 0.
The records were created or updated successfully. The response body is an empty object.
The request contains invalid or missing data — for example a missing product, a product that does not exist or already has a priority record, or a priority that is negative, too large, or null. The response names the field the complaint belongs to.
Authentication credentials were not provided or are invalid.
The authenticated user does not have administrator privileges.
The request is well-formed but violates a business rule of the priority service — the product of an existing record was changed, or a bulk upsert element was not an object, had no product, or had a non-numeric product.
POST /api/v1/remote/1/product_priority/bulk_upsert/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 64
[
{
"product": 3391,
"priority": 150
},
{
"product": 3392,
"priority": 90
}
]{}Last updated
Was this helpful?

