syncTotalProductStock

Get each product's total inventory quantity across all locations.

If you don't specify "changedSince" parameter, then all the products that have stock different from 0 will be returned. Otherwise, this API call will return the total stock of products whose stock has changed after the specified time.

If you add parameter "getAmountReserved = 1", then API will return the reserved amounts as well. When product's stock is 0 but reserved amount is different from 0, then these products will also be returned. Input parameter "changedSince" takes into account the reservations as well if you have specified "getAmountReserved" parameter.

Input parameters

Parameter name Description Possible value Required
changedSince Unix timestamp. If this is specified, then only the stock amounts of these products will be returned, that have been sold or bought after the specified time. int
getAmountReserved If this is set to 1, then the reserved amounts are returned as well. int (0 or 1)

Response

Field name Type Description
productID integer ID of a product
amountInStock number Total amount in stock
amountReserved number Total amount reserved. To retrieve this field, set input parameter "getAmountReserved" = 1.

Important: even though Inventory Transfer Orders can also reserve inventory, this API call ignores Inventory Transfer Orders. An item reserved with a Sales Order has effectively been set aside for a specific customer, and will be sold soon. In contrast, an item reserved with an Inventory Transfer Order is not going away; it will soon be available again in another store. (And since you are using this API call, the actual location of an item is probably not important for you.)

Thus, the "amount reserved" returned by "syncTotalProductStock" may be different from what API getProductStock returns, or what the back office reports show.