I'd like to update the stock of a product with the Woocommerce API. I managed to do this by querying on the product ID and using the following code:
curl -X PUT \
https://www.kilikili.be/wp-json/wc/v3/products/10340 \
-H ...
-b ...
-d '{
"manage_stock": true,
"stock_quantity": "1"
}'
However, I'd like to do the same now by using the sku.
I tried this:
curl -X PUT \
'https://www.kilikili.be/wp-json/wc/v3/products?sku=test' \
-H ...
-b ...
-d '{
"manage_stock": true,
"stock_quantity": "2"
}'
However, I'm getting the following response:
{
"code": "rest_no_route",
"message": "No route was found matching the URL and the request method",
"data": {
"status": 404
}
}
Any idea on how to achieve this or if it is even possible?