• I want to be able to decrease the stock count of product which I sell both on woocommerce and in my physical store. I have a Barcode scanner and all product are labeled with the Barcode representing the sku. The sku consists of the parent id + variation id. For example, 7339-36 where 36 is a shoe size variation.

    I saw in the api docs that I can update the stock using a PUT request. The problem is is that I’d have to fetch the current stock first, then subtract and update the new stock.

    I was wondering if it’s possible to just input ‘-1’ so the stock is decreased by 1.

    To be clear, I’m using a wireless Barcode scanner and was planning to send the scanned input to a raspberry pi who would then issue a script or a simple curl request doing what I want.

    What I basically need is a simple oneliner that decreases stock count based on sku.

  • The topic ‘[Q] How to decrease stock of variation using API?’ is closed to new replies.