Skip to main content
Solved

How to check for inventory change using REST API

  • February 21, 2022
  • 4 replies
  • 655 views

I am working on an automated Integration that picks up the products based on the last date modified and updates those products in an e-Commerce platform. but whenever the inventory is updated, it's not affecting the last date modified of the products and I am not seeing those products in my response.

URL :  https://<host_url>//Entity/<endpoint_name>/<endpoint_version>/StockItem?$filter=LastModified ge datetimeoffset'2022-01-19T05:17:43'
This the API and parameters I am using in order to fetch recently updated products (date will change based on the integration run time)
if a Qty of a product is updated (Qty added to a product, shipment completed with a product in order) it's not affecting this last date modified.

Is there a way to find the Inventory change of a product, any separate endpoint just to determine a change?

Thanks,

Best answer by jinin

Hi @RanjithKumar ,

Stock item entity only updates the details available on the stock item screen. The Quantity will maintain on the warehouse level. The Qty updates are available on the InSiteStatus table. 

To get the qty updates through the endpoint, we need to create a GI with InventoryItem and InSiteStatus table. And also create a Custom endpoint to get the updates.

I’ve created a sample package with GI and endpoint. Please review.

You can adjust the GI and the filter based on your requirement.

Endpoint url: …./entity/InventoryUpdate/20.200.001/GetInventoryUpdates?$expand=GetInventoryUpdatesDetails
Method: PUT
Input:

{   

    "FromDate": {

        "value": "2021-01-01"

    },

    "ToDate": {

        "value": "2022-12-29"

    }

}

4 replies

deebhane
Semi-Pro I
Forum|alt.badge.img+1
  • Semi-Pro I
  • February 21, 2022

hi @RanjithKumar ,

 

As Sales order, shipment and receipts updates of the product will not updated the inventory last modified date. 

We need to create a GI that looks for INTran and Inventory Item last modified date and get records to GI based on datetime modified on any of these table.

This GI screen has to be exposed to GI.

we can also add date filters on the GI if required.

 

 


  • Author
  • Freshman I
  • February 21, 2022

Hi @deebhane Thanks for response, I will check on this!!


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • Answer
  • February 21, 2022

Hi @RanjithKumar ,

Stock item entity only updates the details available on the stock item screen. The Quantity will maintain on the warehouse level. The Qty updates are available on the InSiteStatus table. 

To get the qty updates through the endpoint, we need to create a GI with InventoryItem and InSiteStatus table. And also create a Custom endpoint to get the updates.

I’ve created a sample package with GI and endpoint. Please review.

You can adjust the GI and the filter based on your requirement.

Endpoint url: …./entity/InventoryUpdate/20.200.001/GetInventoryUpdates?$expand=GetInventoryUpdatesDetails
Method: PUT
Input:

{   

    "FromDate": {

        "value": "2021-01-01"

    },

    "ToDate": {

        "value": "2022-12-29"

    }

}


  • Author
  • Freshman I
  • February 21, 2022

Hi @jinin Thank you for your insight, much appreciated. I will try to implement this in my system.