User Tools

Site Tools


webapi:examples:inventory_changes

This is an old revision of the document!


Get Parts that have changed

Use of the Inventory/InventoryChanges end point provides additional filtering and will have fast performance depending on your inventory mix. Filters such as the eCommerceExport and PageNumber can allow pagination of the data being returned to reduce payload sizes. This will save a developer time of not having to parse full records of inventory to then filter and decide what has changed.

You must be using version 6.2.2.535 or 6.2.7.415 of the WebAPI to have this end point. Check the WebAPI version using TServerMethodsWebAPI\Connect.

A change in an inventory record could be any change, editing an inventory record in any way will trigger the changed state flag to be set. That includes Quantity, Price, Description or any other field in the inventory record. This can return many inventory items to further parse and filter.

In a sample data set with 53,000 inventory items. Choosing to filter by the e-commerce export returned 5,055 records in 1 min 30 seconds.

Sample call requesting the first 1000 inventory filtered by ecommerce and last update data. http://127.0.0.1:8080/Windward/WebAPI/Inventory/InventoryChanges?EffectiveDate=2019-01-01&eCommerceExport=Y&PageSize=1000

Sample Inventory Pseudocode

  • Get list of Inventory/InventoryChanges filtered by what is listed for ecommerce export and last updated date
  • For each inventory returned
    • If additional field information is required /Inventory/{InventoryId}
    • If image required TServerMethodsWebAPI/PartImages_Fetch
    • Update inventory of online shopping cart

This is a sample Inventory/InventoryChanges JSON result that meets filtered criteria. These results have been formatted with hard returns to make it easier to read.

{"Inventory":[{"InventoryId":1,"InStock - Dept[1]":0,"InStock - Dept[2]":0,"InStock - Dept[3]":0,
"StartSaleDate - Dept[1]":"M\/d\/yyyy","EndSaleDate - Dept[1]":"M\/d\/yyyy",
"StartSaleDate - Dept[2]":"M\/d\/yyyy","EndSaleDate - Dept[2]":"M\/d\/yyyy",
"StartSaleDate - Dept[3]":"M\/d\/yyyy","EndSaleDate - Dept[3]":"M\/d\/yyyy",
"Prices":[{"Regular List":0,"Sale List":0}]},
{"InventoryId":2,"InStock - Dept[1]":50,"InStock - Dept[2]":0,"InStock - Dept[3]":0,
"StartSaleDate - Dept[1]":"M\/d\/yyyy","EndSaleDate - Dept[1]":"M\/d\/yyyy",
"StartSaleDate - Dept[2]":"M\/d\/yyyy","EndSaleDate - Dept[2]":"M\/d\/yyyy",
"StartSaleDate - Dept[3]":"M\/d\/yyyy","EndSaleDate - Dept[3]":"M\/d\/yyyy",
"Prices":[{"Regular List":6,"Sale List":3}]},
{"InventoryId":3,"InStock - Dept[1]":50,"InStock - Dept[2]":0,"InStock - Dept[3]":0,
"StartSaleDate - Dept[1]":"M\/d\/yyyy","EndSaleDate - Dept[1]":"M\/d\/yyyy",
"StartSaleDate - Dept[2]":"M\/d\/yyyy","EndSaleDate - Dept[2]":"M\/d\/yyyy",
"StartSaleDate - Dept[3]":"M\/d\/yyyy","EndSaleDate - Dept[3]":"M\/d\/yyyy",
"Prices":[{"Regular List":1.05,"Sale List":0.52}]}],
"APIResponse":{"IsSuccess":true,"Response":"","ElapsedTime":"00h:00m:00s:137ms","RecordCount":"3"}}

Get_Part_Changes

This endpoint is not recommended to use for any large amounts of data as it is known to have speed performance issues and is not efficient.

The TServerMethodsWebAPI/Get_Part_Changes returns the list of Part Unique numbers that have changed since the Effective Date. It translates inside the API using an XML DOM which has a memory and performance impact. If you are using this end point, we strongly recommend updating to use Inventory/InventoryChanges.

Back to WebAPI Samples

webapi/examples/inventory_changes.1581365498.txt.gz · Last modified: 2020/02/10 12:11 (4 years ago) by kevin