• Resolved orderbot

    (@orderbot)


    Hello,

    I wonder would it be possible to add inventory stock quantity by Woocmommerce REST API without additional plug-in?

    If plug-in required, may someone suggest?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Shohan Hossain Nabil – a11n

    (@sohanhossain)

    Hello @orderbot,

    I wonder would it be possible to add inventory stock quantity by Woocmommerce REST API without additional plug-in?

    Yes, it’s possible to manage stock using WooCommerce REST API. The manage_stock stock_quantity and stock_status properties are included in the API by default. and you just need to pass them as a parameter when making the /wp-json/wc/v3/products POST request. You will find all the available properties here: https://woocommerce.github.io/woocommerce-rest-api-docs/#product-properties

    Thanks!

    Thread Starter orderbot

    (@orderbot)

    Hello @sohanhossain,

    Thank you, I managed to update stock quantity with information you provided.

    Currently I done it by product update PUT method. So if data stock_quantity, let’s say 100 it’s will change total quantity to 100.

    If I would like to add additional +100 to a current quantity, which let’s say already is 50 and I want add +100 to be 150 total.

    How should I do it?

    Thanks!

    Plugin Support Shohan Hossain Nabil – a11n

    (@sohanhossain)

    Hi @orderbot!

    If I would like to add additional +100 to a current quantity, which let’s say already is 50 and I want add +100 to be 150 total.

    Unfortunately, you can’t do that. The REST API can only pass a value and replace the old value with the new one. There’s no way to increment the existing value.

    Thanks!

    Hi @orderbot

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Inventory stock quantity by REST API’ is closed to new replies.