For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 product key, or has a product that is not a numeric identifier (for example "abc"), the request is rejected with 406 Not Acceptable and error code product_priority_700_1.

  • If an element fails field validation — for example a negative priority or a numeric product that does not exist — the request is rejected with 400 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 priority keeps the existing record's priority, or creates the record with priority 0.

  • When the same product appears more than once, the last element wins.

  • An empty array is accepted and changes nothing.

On success the response is an empty object.

post
/product_priority/bulk_upsert/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Bodyobject[]

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.

productintegerRequired

The identifier of an existing product.

priorityinteger · max: 2147483647Optional

The ranking weight. When omitted, an existing record keeps its priority and a new record gets 0.

Responses
200

The records were created or updated successfully. The response body is an empty object.

application/json
objectOptional
post/product_priority/bulk_upsert/
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?