ProductInventoryRecords resource (Data API 23.2)

Summary

Http Method Resource Description
GET /inventory_lists/{inventory_list_id}/product_inventory_records Gets all product inventory records for an inventory list.
GET /inventory_lists/{inventory_list_id}/product_inventory_records/{product_id} Gets a product inventory record.
PATCH /inventory_lists/{inventory_list_id}/product_inventory_records/{product_id} Updates the product inventory record with the specified information.
DELETE /inventory_lists/{inventory_list_id}/product_inventory_records/{product_id} Deletes a product inventory record by ID.
PUT /inventory_lists/{inventory_list_id}/product_inventory_records/{product_id} Creates a product inventory record using the information provided.

Get Product Inventory Records

Gets all product inventory records for an inventory list.

Url

GET https://hostname:port/dw/data/v23_2/inventory_lists/{inventory_list_id}/product_inventory_records?start={Integer}&count={Integer}&select={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

ProductInventoryRecords

Path Parameters

Parameter Type Description Constraints
inventory_list_id String The inventory list ID minLength=1

Query Parameters

Parameter Type Description Constraints
count Integer Optional count for retrieving only a subset of the items (default is 25).  
select String The property selector.  
start Integer Optional start index for retrieving the items from a given index (default 0).  

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 InventoryListNotFoundException

inventorylistId (String)

Indicates the inventory list does not exist.

Sample

REQUEST: 
GET /s/-/dw/data/v23_2/inventory_lists/my-inventory-list/product_inventory_records HTTP/1.1
Host: example.com
Content-Type: application/json; charset=UTF-8

# in case of success: 

RESPONSE: 
HTTP/1.1 200 OK 
{
   "_v" : "23.2",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "product_inventory_records",
   "count" : 4,
   "data" : 
   [
      
      {
         "_type" : "product_inventory_record",
         "_resource_state" : "35c736afbfe0ac80f1fe26950a7263b5329c280e95ef4682c9d6bc720d02bc89",
         "product_id" : "product-id-0",
         "link" : "https://example.com/s/-/dw/data/v23_2/inventory_lists/my-inventory-list/product_inventory_records/product-id-0"
      },
      
      {
         "_type" : "product_inventory_record",
         "_resource_state" : "85d719743c2a8eff14978b809980014baf9e69b3bb4f7b80acec96fdd6723515",
         "product_id" : "product-id-1",
         "link" : "https://example.com/s/-/dw/data/v23_2/inventory_lists/my-inventory-list/product_inventory_records/product-id-1"
      }
   ],
   "start" : 0,
   "total" : 4
}

# in case of failure: 

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "InventoryListNotFoundException",
      "message" : "No inventory list with ID 'my-inventory-list' was found."
   }
}

Get Product Inventory Record

Gets a product inventory record.

Url

GET https://hostname:port/dw/data/v23_2/inventory_lists/{inventory_list_id}/product_inventory_records/{product_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

ProductInventoryRecord

Path Parameters

Parameter Type Description Constraints
inventory_list_id String The inventory list ID minLength=1
product_id String The product ID minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 ProductInventoryRecordNotFoundException

productId (String)

inventoryListId (String)

Indicates the product inventory record does not exist.
404 InventoryListNotFoundException

inventorylistId (String)

Indicates the inventory list does not exist.

Sample

REQUEST:
GET  /s/-/dw/data/v23_2/inventory_lists/my-inventory-list/product_inventory_records/my-product HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8

# in case of success:
 
RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Aug-2014 00:00:00 GMT
{
   "_v" : "23.2",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "product_inventory_record",
   "allocation": {
        "amount": 10,
        "reset_date": "2013-04-18.74:00:22.000Z",
   },
   "ats" : 10,
   "inventory_list_id" : my-inventory-list",
   "inventory_turnover" : 0,
   "link" : "https://example.com/s/-/dw/data/v23_2/my-inventory-list/product_inventory_records/my-product",
   "perpetual_flag" : false,
   "pre_order_back_order_handling" : "none",
   "product_id" : "my-product",
   "product_name" : "my product name",
   "quantity_on_order" : 0,
   "stock_level" : 10
}

# in case of failure:
 
RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "InventoryListNotFoundException",
      "message" : "No inventory list with ID 'my-inventory-list' was found."
   }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "ProductInventoryRecordNotFoundException",
      "message" : "No product inventory record with inventory list ID 'my-inventory-list' and product ID 'my-product' was found."
   }
}

Update Product Inventory Record

Updates the product inventory record with the specified information.

Url

PATCH https://hostname:port/dw/data/v23_2/inventory_lists/{inventory_list_id}/product_inventory_records/{product_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

ProductInventoryRecord

Response Document

ProductInventoryRecord

Path Parameters

Parameter Type Description Constraints
inventory_list_id String The inventory list ID minLength=1
product_id String The product ID minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 ProductInventoryRecordNotFoundException

productId (String)

inventoryListId (String)

Indicates the product inventory record does not exist.
404 InventoryListNotFoundException

inventorylistId (String)

Indicates the inventory list does not exist.

Sample

REQUEST:
PATCH  /s/-/dw/data/v23_2/inventory_lists/my-inventory-list-id/product_inventory_records/my-product-id HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
{
    "_resource_state" : "847f9c3c5867f641470b3046aeec31f07757991b792d722e10079926f7a289fb",
    "allocation": {
        "amount": 2000
    }
}

# in case of success:

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
    "_v" : "23.2",
    "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
    "_type" : "product_inventory_record",
    "allocation": {
        "amount": 2000,
        "reset_date": "2016-03-31T14:05:40.872Z",
    },
    "ats" : 2123,
    "inventory_list_id" : my-inventory-list-id",
    "inventory_turnover" : 0,
    "link" : "https://example.com/s/-/dw/data/v23_2/my-inventory-list-id/product_inventory_records/my-product-id",
    "perpetual_flag" : false,
    "pre_order_back_order_allocation" : 123,
    "pre_order_back_order_handling" : "backorder",
    "product_id" : "my-product-id",
    "product_name" : "product 1",
    "quantity_on_order" : 0,
    "stock_level" : 2000
}


# in case of failure:

RESPONSE:
HTTP/1.1 404 Requested resource not found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "ProductInventoryRecordNotFoundException",
      "message" : "No product inventory record with inventory list ID 'my-inventory-list' and product ID 'my-product-id' was found."
   }
}

HTTP/1.1 404 Requested resource not found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "InventoryListNotFoundException",
      "message" : "No inventory list with ID 'my-inventory-list' was found."
   }
}

Delete Product Inventory Record

Deletes a product inventory record by ID.

Url

DELETE https://hostname:port/dw/data/v23_2/inventory_lists/{inventory_list_id}/product_inventory_records/{product_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
inventory_list_id String The inventory list ID minLength=1
product_id String The product ID minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 ProductInventoryRecordNotFoundException

productId (String)

inventoryListId (String)

Indicates the product inventory record does not exist.
404 InventoryListNotFoundException

inventorylistId (String)

Indicates the inventory list does not exist.

Sample

REQUEST:
DELETE /s/-/dw/data/v23_2/inventory_lists/my-inventory-list-id/product_inventory_records/my-product-id HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
x-dw-resource-state: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5

# in case of success:

RESPONSE:
HTTP/1.1 204 No Content

Create Product Inventory Record

Creates a product inventory record using the information provided.

Url

PUT https://hostname:port/dw/data/v23_2/inventory_lists/{inventory_list_id}/product_inventory_records/{product_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

ProductInventoryRecord

Response Document

ProductInventoryRecord

Path Parameters

Parameter Type Description Constraints
inventory_list_id String The inventory list ID minLength=1
product_id String The product ID minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 InventoryListNotFoundException

inventorylistId (String)

Indicates the inventory list does not exist.

Sample

REQUEST:
PUT /s/-/dw/data/v23_2/inventory_lists/my-inventory-list/product_inventory_records/my-product HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
{
    "perpetual_flag": false,
    "allocation": {
        "amount": 17
    },
    "in_stock_date" : "2016-03-31T13:59:25.290Z",
    "pre_order_back_order_handling" : "backorder",
    "pre_order_back_order_allocation": 123
}

# in case of success:

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
    "_v" : "23.2",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
    "_type" : "product_inventory_record",
    "allocation": {
        "amount": 17,
        "reset_date": "2016-03-31T13:59:25.290Z"
    },
    "ats" : 140,
    "in_stock_date" : "2016-03-31T13:59:25.290Z",
    "inventory_list_id" : my-inventory-list",
    "inventory_turnover" : 0,
    "link" : "https://example.com/s/-/dw/data/v23_2/my-inventory-list/product_inventory_records/my-product",
    "perpetual_flag" : false,
    "pre_order_back_order_allocation" : 123,
    "pre_order_back_order_handling" : "backorder",
    "product_id" : "my-product",
    "product_name" : "my product name",
    "quantity_on_order" : 0,
    "stock_level" : 17
}

# in case of failure:

RESPONSE:
HTTP/1.1 404 Requested resource not found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "ProductInventoryRecordNotFoundException",
      "message" : "No product inventory record with inventory list ID 'my-inventory-list' and product ID 'my-product' was found."
   }
}

HTTP/1.1 404 Requested resource not found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "InventoryListNotFoundException",
      "message" : "No inventory list with ID 'WapiInventoryList_foo' was found."
   }
}
X OCAPI versions 15.x and 16.x will be retired on March 31, 2021. For dates and more information, see the OCAPI versioning and deprecation policy and this Knowledge Article.