User Tools

Site Tools


webapi:examples:inventory_changes

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 100 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=100

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"}}

TServerMethodsWebAPI\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. If you are using this endpoint for thousands of inventory records, we recommend using the Inventory/InventoryChanges endpoint.

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 known memory and performance impact.

TServerMethodsWebAPI\Get_Parts

This endpoint returns pricing data that can cause confusion in developers around sale pricing.

  • If your dataset has the department features enabled, we allow different sale dates to be defined in each department. This method returns the value of a single department only.

It is recommended that you use Inventory/Inventory/{InventoryID} to obtain information including sales dates for all departments in the JSON payload.

TServerMethodsWebAPI\Get_Part_Prices

When requesting pricing with a date that is outside a sales date set, the endpoint will return IsOnSale as false with the sales price set to the regular sales price.

It is recommended that you use Inventory/Inventory/{InventoryID} to obtain inventory information.

Back to WebAPI Samples

webapi/examples/inventory_changes.txt · Last modified: 2020/02/20 13:57 (4 years ago) by kevin