Search code examples
square-connect

How to get stock movements data for a period of time in Square POS via API?


I'm considering to create analytical application to use with Square POS. For the app to work I need to fetch products sale statistics, as well as current stocks and stock movements for a period of time. What objects should I use for these purposes? Do I have to use itemizations in the Payment object for sale statistcs and Items + Inventory objects for current stock? What about stock movements (inventory replenishments, write-offs etc.)?


Solution

  • Your general approach sounds reasonable. Square doesn't track reasons for inventory (stock) changes (e.g. write-offs), only the amount is tracked. You can get the current stock amounts from the inventory endpoint for the merchant's entire catalog.You can track these changes either by polling the inventory endpoint at a fixed interval, or by subscribing to webhook notifications for the INVENTORY_UPDATED webhook, which will tell you when to check the inventory list for updates.