commerce_products_get
Read existing X00004 products, variants, stock history or an explicit selection. Read the shop product guide for the required COMMERCE_V2 configuration, exact installed-store/channel scope, current delegate policy and recovery. These prerequisites apply to reads as well as writes.
Inputs and results
Require channelCode and view. All objects are strict; view has no implicit default.
| Field | Required here | Contract |
|---|---|---|
channelCode |
Yes | string; min length 1; max length 512; The exact channelCode selected through channel discovery. Do not supply a URL, channel numeric ID, account ID or credentials. |
view |
Yes | one of: products, variants, selection, stock-history (by kind) |
view.page |
No | When view.kind is products: integer; minimum 1; default 1 |
view.limit |
No | When view.kind is products: 15 or 30 or 50 or 100; default 15 |
view.saleStatus |
No | When view.kind is products: ACTIVE, DISCONTINUED |
view.visibilityStatus |
No | When view.kind is products: VISIBLE, DISABLED |
view.page |
No | When view.kind is variants: integer; minimum 1; default 1 |
view.limit |
No | When view.kind is variants: 15 or 30 or 50 or 100; default 15 |
view.target |
Yes | When view.kind is selection: product, variant |
view.ids |
Yes | When view.kind is selection: array; items: string; min length 1; max length 160; pattern ^[A-Za-z0-9_-]+$; Exact resource identifier returned by this operation, never a title, unrelated row ID or URL.; min items 1; max items 100 |
view.productVariantId |
Yes | When view.kind is stock-history: string; min length 1; max length 160; pattern ^[A-Za-z0-9_-]+$; Exact resource identifier returned by this operation, never a title, unrelated row ID or URL. |
view.page |
No | When view.kind is stock-history: integer; minimum 1; default 1 |
view.limit |
No | When view.kind is stock-history: 15 or 30 or 50 or 100; default 15 |
COMMERCE_PRODUCTS returns view plus records and pagination for a page, or target/records and revision for a selection. Paged results have coverage.completeInventory:false and nextPage; even an empty page is only the requested page. Their revision must not be invented from list content. Reads repeat and validate count/filter/identity agreement, nested store/product bindings and the variant equation availableQuantity = quantity - reservedQuantity. No mutation or task journal is created.
Use commerce_product_control_apply with the selection revision and identical selected IDs/target. For editable fields or prices use commerce_product_settings_get, whose revision belongs to that workflow. A numeric database id, productId, productVariantId and stockChangeHistoryId are distinct.
A single selection opens the product detail or variant history; multiple selections use their parent list. Page links retain supported filters and pagination. Matching observations are not an atomic inventory or a purchase-availability guarantee.
Example
{"channelCode":"selected-channel","view":{"kind":"selection","target":"product","ids":["observed-product"]}}
Replace selectors with observed business IDs. This is an input illustration, not an executed request.