question

bcooper avatar image
bcooper asked kelvin answered

stockCount in item endpoint discrepancy with item_stocks endpoint

When I compare the value of the stockCount attribute from the GET items endpoint with the corresponding item's quantity or stockCount on the GET item_stocks endpoint there is a discrepancy.

The total number of items returned is even different by ~60 items.

I want the info from the GET items endpoint and I want the stockCount as well. Can I not trust this attribute on item? Must I join this with another GET to the itemstocks endpoint on itemid.

I appreciate any help.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

kelvin avatar image
kelvin answered

use expand=itemStock and get the count from ItemStock.quantity. Don't trust stockCount attribute.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community