Product Priority
Administrative endpoints for product priority — a non-negative ranking weight attached to a product. Storefront listings and search use it to rank products: on the default sort option, products that tie on the primary sort criterion are ordered by priority, highest first.
There is at most one priority record per product (product is a one-to-one reference). A product without a record counts as priority 0.
How Priority Affects Ranking
A listing entry can contain more than one product — for example a variant shown together with its sibling variants. The entry is ranked by the highest priority among the products it contains. A product is contained in the entry only while it has stock and an image; when PRODUCT_STOCK_OUT_VISIBILITY_ENABLED is on, out-of-stock products are contained as well.
Simple product without variants
The product's own record.
Variant listed together with its sibling variants (siblings share the listed variant's values for the attribute set's variant-listable attributes, e.g. colour)
The highest record among the listed variant and those siblings.
Variant whose attribute set has no variant-listable attribute
The variant's own record. When LIST_SIMPLE_INSTEAD_OF_META is on, the highest record among all variants of the same configurable product.
Configurable (meta) product
The highest record among its variants. The meta product's own record has no effect.
Grouped product
The grouped product's own record. The records of its member products have no effect.
Core Capabilities
1. Listing & Filtering
Retrieve a paginated list of product-priority records.
Filter by record identifier (
id) or by product identifier (product).Order results with the
sortparameter.
2. Full CRUD
Create a priority record for a product.
Retrieve a single record.
Fully or partially update a record.
Delete a record; the product then counts as priority
0.
3. Bulk Upsert
Create or update many records in one request through
POST /product_priority/bulk_upsert/.
Product Priority Fields
pk
integer
The unique identifier of the record. Read-only.
product
integer
The identifier of the product this priority belongs to. Required. One record per product; the product cannot be changed on update.
priority
integer
The ranking weight, from 0 to 2147483647. Higher values rank the product higher. Defaults to 0 when omitted on create. null is not accepted.
Filtering & Ordering
id
Exact
Filter by the record's own identifier.
product
Exact
Keep only the record of the given product identifier.
A non-numeric value, or a product that does not exist, is rejected with a 400 validation error. Any other query parameter — including priority — is ignored.
Results are returned ordered by id ascending by default. sort accepts pk, product, and priority, each optionally prefixed with - for descending order. Any other value is silently ignored and the default ordering applies.
Validation Rules
productmust reference an existing product that does not yet have a priority record. Creating a second record for the same product fails with a400validation error — use update or bulk upsert instead.prioritymust be an integer between0and2147483647.The
productof an existing record cannot be changed. Sending a differentproductonPUTorPATCHis rejected with406 Not Acceptableand error codeproduct_priority_700_1.
Search Index Synchronization
Priority changes do not update the storefront immediately. They are picked up by the next incremental search-index update, which re-indexes the listing entry of every product whose priority record changed.
Important: A scheduled background job recalculates product scores from recent order data roughly every 5–7 hours and synchronizes them into the product-priority records. For every product that has a computed score, the stored priority is overwritten with the score-based value; priority records of products without a computed score are deleted. Values written through these endpoints are therefore not permanent — they are replaced on the job's next run.
Deletion Behavior
DELETE /product_priority/{id}/ permanently removes the priority record; the product itself is untouched. As a side effect, deleting a record refreshes the product's modified_date when that timestamp is older than 60 seconds, so the next incremental search-index update picks up the removal and the product counts as priority 0 from then on.
Dynamic Settings & Environment Variables
No dynamic settings (dj_dynamic_settings) and no environment variables affect these endpoints. Listing, creation, update, bulk upsert, and deletion behave identically regardless of how the platform is configured. PRODUCT_STOCK_OUT_VISIBILITY_ENABLED and LIST_SIMPLE_INSTEAD_OF_META affect only which products a listing entry contains, and therefore the priority used for ranking (see How Priority Affects Ranking).
Last updated
Was this helpful?

