GET Get a product inventory record.
GET /organizations/{organizationId}/inventory-lists/{inventoryListId}/product-inventory-records/{productId}
Operation ID: getProductInventoryRecord. Security: AmOAuth2 (sfcc.inventory-lists, sfcc.inventory-lists.rw).
Get a product inventory record by product ID and inventory list ID.
Only product inventory records that exist are returned. The response includes:
- Current stock levels and availability (ATS)
- Allocation information
- Pre-order and backorder handling configuration
- Custom attributes
Parameters
organizationId(path, OrganizationId, required) An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character realm identifier and a 3-character instance type identifier.Example
f_ecom_zzxy_prdinventoryListId(path, string, required) The inventory list ID
Minimum length: 1. Maximum length: 256. Example:inventory-list-001.productId(path, ProductId, required) The product IDselect(query, Select)Example: select
(**)
Responses
- 200
Product inventory record retrieved successfully.
Media type:
application/json. Schema:ProductInventoryRecord.Example: ProductInventoryRecordResponse Product inventory record retrieved successfully.
Example of a successful product inventory record retrieval
{ "productId": "P1234567890", "productName": "Sample Product", "inventoryListId": "inventory-list-001", "perpetualFlag": false, "allocation": { "amount": 100, "resetDate": "2024-01-15T10:00:00.000Z" }, "inStockDate": "2024-02-01T00:00:00.000Z", "ats": 95, "stockLevel": 95, "quantityOnOrder": 5, "inventoryTurnover": 5, "preOrderBackOrderHandling": "none", "preOrderBackOrderAllocation": 0, "c_customField": "custom value" }Example: ProductInventoryRecordPerpetual Product inventory record with perpetual stock
Example of a product inventory record set to always be in stock
{ "productId": "P9999999999", "productName": "Always Available Product", "inventoryListId": "inventory-list-001", "perpetualFlag": true, "ats": 999999, "stockLevel": 999999, "quantityOnOrder": 0, "inventoryTurnover": 0, "preOrderBackOrderHandling": "none", "preOrderBackOrderAllocation": 0 } - 401
Your access token is invalid or expired and can’t be used to identify a user.
Media type:
application/problem+json. Schema:ErrorResponse.Example: UnauthorizedExample
{ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/unauthorized", "title": "Unauthorized", "detail": "Your access token is invalid or expired and can’t be used to identify a user." } - 403
Forbidden. Your access token is valid, but you don’t have the required permissions to access the resource.
Media type:
application/problem+json. Schema:ErrorResponse.Example: ForbiddenExample
{ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/forbidden", "title": "Forbidden", "detail": "Your access token is valid, but you don’t have the required permissions to access the resource." } - 404
Not Found. The specified product inventory record or inventory list does not exist.
Media type:
application/problem+json. Schema:ErrorResponse.Example: ProductInventoryRecordNotFound Product Inventory Record Not Found
The specified product inventory record does not exist.
{ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/product-inventory-record-not-found", "title": "Product Inventory Record Not Found", "detail": "Product inventory record with product ID 'P1234567890' in inventory list 'inventory-list-001' was not found.", "productId": "P1234567890", "inventoryListId": "inventory-list-001" }Example: InventoryListNotFound Inventory List Not Found
The specified inventory list does not exist.
{ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/inventory-list-not-found", "title": "Inventory List Not Found", "detail": "Inventory list with ID 'inventory-list-001' was not found.", "inventoryListId": "inventory-list-001" }