question

hj02 avatar image
hj02 asked Jacob Abrams answered

Posting items with stock?

Trying to post a new item with a given stock, does not seem to be going to Clover correctly, even though I am not getting any errors. Here is the json: {"name":"TestPost001","price":100,"cost":50,"code":"A","stockCount":10}

Instead of "stockCount" I have also tried "quantity" and "itemStock" -- someone clarify the difference here? I only got a 400 error when I tried itemStock.

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

Jacob Abrams avatar image
Jacob Abrams answered

If you want to change stock you need to make a separate POST for that. The API reference at https://www.clover.com/api_docs#!/inv... describes the POST /v3/merchants/{mId}/item_stocks/{itemId} endpoint. We used a separate endpoint to POST stock because stock can change quickly as a busy merchant is creating orders all day, if your code were to GET an item, change its price or name for example and then POST it back it may reset stock value accidentally.

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