Skip to main content
Skip to main content

Store Scope

The store_id field that scopes a product to one client store, the rules it imposes on the product and its prices, and the item change request object returned when a write to such a product is diverted for client review.

Tip

Looking for hands-on instructions? See Store-Scoped Products and Change Requests for the full flow with examples.

Overview​

A product carries an optional store_id. When it is set, the product is store-scoped: it is visible only in that client store, and the store's client reviews every change to it. When it is null the product is global, which is the default and the behaviour every other page in this reference describes.

The store_id field​

PropertyValue
TypeInteger, the id of a client store
RequiredNo. Omit it, or send null, for a global product.
Accepted onPOST /api/suppliers/products only. In the supplier portal it is the Store scope field on the Details step of Add product.
ConstraintsMust be a store you are connected to. It is prohibited on PUT /api/suppliers/products/{product_identifier}, so a product's scope cannot change after creation.
ImportsNot accepted. A store_id in a CSV, JSONL or batch row fails that row.
VariantsVariants have no store_id of their own; they inherit the scope of their product.

Effects on the product​

AreaRule
PricesEvery price on the product or its variants must carry the product's store_id. A price for another store, or with no store_id, is rejected with The prices.N.store_id field must be the store the product is scoped to. This applies to prices embedded in the product payload and to price lists created through POST /api/suppliers/price-lists.
WritesPOST (variants), PUT and DELETE on the product and variant endpoints are diverted into an item change request and answer 202 Accepted. See Diverted responses.
Sub-resourcesWrite verbs on the URL, code, property, stock, option, translation and category attach/detach endpoints are refused with 422.
Imports and batchesRows that create or touch a store-scoped product are reported as row errors.
RestoreRefused with 422.
Mass deleteStore-scoped products are excluded.
Duplicate mergeThe automatic merge of products sharing an identifier never merges a store-scoped product or merges into one.

On responses​

EndpointFieldMeaning
GET /api/suppliers/productsstore_idThe scoping store, or null.
GET /api/suppliers/productsunder_reviewtrue while the product or one of its variants has an open change request.
GET /api/suppliers/productsquery store_scoped1 returns only store-scoped products, 0 only global products. Omit for both.

Diverted responses​

A write to a store-scoped item answers 202 Accepted with:

FieldDescription
change_request_pendingAlways true.
change_requestThe item change request that was recorded.
messageA human-readable explanation.

The write accepts one extra input, reason: a string of up to 2000 characters shown to the client with the request. It is optional for create and update, and required for delete, which otherwise fails with a validation error on reason.

A write that cannot be recorded, because the item already has an approved request awaiting apply, or because a variant write conflicts with a pending product-level request, fails with 422 and an error on item.

The item change request object​

Returned by the diverted responses and by the endpoints below.

MethodEndpointPermission
GET/api/suppliers/item-change-requestsitem-change-requests-list-as-supplier
GET/api/suppliers/item-change-requests/{uuid}item-change-requests-show-as-supplier
POST/api/suppliers/item-change-requests/{uuid}/cancelitem-change-requests-cancel-as-supplier

List parameters​

ParameterTypeDescription
statusstringOne of the statuses.
commandstringcreate, update or delete.
item_typestringproduct or product_variant.
store_idintegerOnly requests raised in this store.
submitted_after, submitted_beforedateBound the submission date.
page, per_pageintegerPagination, 10 per page by default.

Fields​

FieldTypeDescription
uuidstringThe request's reference.
item_typestringproduct or product_variant.
item_idinteger or nullThe live item. null while a create is pending.
product_idinteger or nullThe product, or the parent product of a variant. null while a product create is pending.
store_idintegerThe store the request was raised in.
supplier_idintegerYour supplier id.
commandstringcreate, update or delete.
command_labelstringA display label for command.
statusstringSee Statuses.
status_labelstringA display label for status.
item_labelstringThe item type and identifier, for example Product KIT-ACME-001. Resolved from the stored payloads, so it is filled in after deletion.
reasonstring or nullThe reason you gave.
resolution_notestring or nullThe client's note, recorded when they approved or rejected.
superseded_by_idinteger or nullThe newer request that replaced this one.
submitted_atdatetimeWhen you submitted it.
resolved_atdatetime or nullWhen it was approved, rejected, superseded or cancelled.
applied_atdatetime or nullWhen an approved request was applied.
proposed_changesobject or nullYour payload as submitted. null for a delete. Single request only.
before_snapshotobject or nullThe item as it was when you submitted, in the same shape as a submission payload. null for a create. Single request only.
changeslistThe field-level differences, each { "field", "old", "new" }. Nested collections are matched by their natural key, for example a code by type and version, a price by store_id, country and currency, a variant by variant_identifier. Empty for a delete. Single request only.
storeobjectThe store, when loaded.
itemobjectThe live item, when loaded and still existing.

Statuses​

StatusOpen?Meaning
pendingYesAwaiting the client's decision. Can be cancelled or superseded.
approvedYesApproved, but the apply failed and can be retried by the client. Blocks new submissions for the item until the client retries or rejects it, or you cancel it.
appliedNoApproved and applied to the live item.
rejectedNoRejected by the client.
supersededNoReplaced by a newer submission of yours.
cancelledNoWithdrawn by you.

An item has at most one open request at a time. The transitions are pending to approved, rejected, superseded or cancelled, and approved to applied, rejected or cancelled. The closed statuses are final.

Cancel​

POST /api/suppliers/item-change-requests/{uuid}/cancel moves a pending or approved request to cancelled and returns it. A closed request fails with 422. The live item is untouched.