The various collection resources (e.g. /YOURACCOUNTNAME/api/order/) support filtering using a query parameter. The filter is placed in the query parameter as Base64 encoded JSON. The JSON is a single object with a single key corresponding to the key in the result object that should be filtered. The value is the query object is an array with two elements corresponding to the lower and upper bounds of the range to filter. If either bound is null, then the range to filter is unbounded on that side. The range is closed on both ends (the result includes elements that match either the lower or upper bound). To filter by a single value, set the range to have that value as both the lower and upper bound.
To filter by lastUpdatedDate:
- The required JSON is {"lastUpdatedDate":["2015-
11-19T20:09:57Z",null]}. - Base 64 encoding that is
eyJsYXN0VXBkYXRlZERhdGUiOlsiMjAxNS0xMS0xOVQyMDowOTo1N1oiLG51bGxdfQ - The full URL to query for products changed since the lastUpdateDate:
https://app.finaleinventory.com/YOURACCOUNTNAME/api/ product/?filter= eyJsYXN0VXBkYXRlZERhdGUiOlsiMj AxNS0xMS0xOVQyMDowOTo1N1oiLG51 bGxdfQ
To filter for committed sales orders:
- The required JSON is {orderTypeId:['SALES_ORDER','SALES_ORDER'],statusId:['ORDER_LOCKED','ORDER_LOCKED']}
- Base 64 encoding that is iseyJvcmRlclR5cGVJZCI6WyJTQUxFU19PUkRFUiIsIlNBTEVTX09SREVSIl0sInN0YXR1c0lkIjpbIk9SREVSX0xPQ0tFRCIsIk9SREVSX0xPQ0tFRCJdfQ==
- The full URL to query for orders is:
https://app.finaleinventory.com/YOURACCOUNTNAME/api/order/?filter=eyJvcmRlclR5cGVJZCI6WyJTQUxFU19PUkRFUiIsIlNBTEVTX09SREVSIl0sInN0YXR1c0lkIjpbIk9SREVSX0xPQ0tFRCIsIk9SREVSX0xPQ0tFRCJdfQ==
Similar filters can be applied to any value that is a scalar type at the top level of the object (for example, the order orderId, the order origin location, the customer name, or the facility name). Therefore you can't filter on products in an order/shipment, or user defined fields.
The system is optimized for filtering by lastUpdatedDate. If you are encountering performance problems requesting large collections, then you should cache your collections and only fetch updates using the lastUpdatedDate filter. Typically the system performs well for collections with up to 10,000 entries, but if you have more then you should consider adding caching in your code.
Comments
0 comments
Article is closed for comments.