Skip to main content
Solved

How to check for inventory change using REST API

  • Feb 21, 2022 6:35 AM UTC
  • 4 replies
  • 744 views
  • Translate All

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"

    }

}

View original

4 replies

deebhane
Semi-Pro I
Forum|alt.badge.img+1
  • Semi-Pro I
  • Feb 21, 2022 6:51 AM UTC

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.

 

 

Translate

  • Author
  • Freshman I
  • Feb 21, 2022 7:26 AM UTC

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

Translate

jinin
Pro I
Forum|alt.badge.img+12
  • Pro I
  • Answer
  • Feb 21, 2022 12:08 PM UTC

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"

    }

}

Translate

  • Author
  • Freshman I
  • Feb 21, 2022 1:51 PM UTC

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

Translate