{"action":"closed","issue":{"url":"https://api.github.com/repos/woothemes/woocommerce/issues/11943","repository_url":"https://api.github.com/repos/woothemes/woocommerce","labels_url":"https://api.github.com/repos/woothemes/woocommerce/issues/11943/labels{/name}","comments_url":"https://api.github.com/repos/woothemes/woocommerce/issues/11943/comments","events_url":"https://api.github.com/repos/woothemes/woocommerce/issues/11943/events","html_url":"https://github.com/woothemes/woocommerce/issues/11943","id":177723021,"number":11943,"title":"[REST API] stock_quantity not updating on products endpoint","user":{"login":"leeuweriq","id":6400302,"avatar_url":"https://avatars.githubusercontent.com/u/6400302?v=3","gravatar_id":"","url":"https://api.github.com/users/leeuweriq","html_url":"https://github.com/leeuweriq","followers_url":"https://api.github.com/users/leeuweriq/followers","following_url":"https://api.github.com/users/leeuweriq/following{/other_user}","gists_url":"https://api.github.com/users/leeuweriq/gists{/gist_id}","starred_url":"https://api.github.com/users/leeuweriq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leeuweriq/subscriptions","organizations_url":"https://api.github.com/users/leeuweriq/orgs","repos_url":"https://api.github.com/users/leeuweriq/repos","events_url":"https://api.github.com/users/leeuweriq/events{/privacy}","received_events_url":"https://api.github.com/users/leeuweriq/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-19T07:54:52Z","updated_at":"2016-09-19T09:49:43Z","closed_at":"2016-09-19T09:49:43Z","body":"## EXPLANATION OF THE ISSUE\r\n\r\n<!-- What happens, under which versions, under what conditions, when, and what were you expecting instead. -->\r\nWhen trying to update the stock of a product (whether this is a simple or configurable product), the response is a 200 OK, but after checking the product attributes, the 'stock_quantity' field is not updated at all. I expect the stock_quantity to be updated with the quantity I provided. Running WooCommerce 2.6.2 on Wordpress latest.\r\n\r\n## STEPS TO REPRODUCE THE ISSUE\r\n\r\n- Using the Automattic/WooCommerce package as client\r\n- (Note: client works fine, all other 'put' requests I perform in my script do work).\r\n- Updating the stock as follows (in which 123 is the new stock quantity for productId 140):\r\n\r\n`$productId = 140;\r\n$params = [\r\n            'stock_quantity' => 214\r\n        ];\r\n$this->woo->put('products/' . $productId, $params);\r\n`\r\n\r\nProduct details **before** put request:\r\n`array(62) {\r\n[\"id\"] 140\r\n[\"name\"] \"Digitale coaxiale kabel\"\r\n[\"slug\"] \"digitale-coaxiale-kabel\"\r\n(...)\r\n[\"sku\"] \"coa3m\"\r\n[\"virtual\"] false\r\n[\"downloadable\"] false\r\n(...)\r\n[\"manage_stock\"] true\r\n[\"stock_quantity\"] 80`\r\n\r\nProduct details **after** put request (exactly the same, stock_quantity did not update):\r\n`array(62) {\r\n[\"id\"] 140\r\n[\"name\"] \"Digitale coaxiale kabel\"\r\n[\"slug\"] \"digitale-coaxiale-kabel\"\r\n(...)\r\n[\"sku\"] \"coa3m\"\r\n[\"virtual\"] false\r\n[\"downloadable\"] false\r\n(...)\r\n[\"manage_stock\"] true\r\n[\"stock_quantity\"] 80`\r\n\r\n\r\n## SYSTEM STATUS REPORT\r\n[systemstatusreport.txt](https://github.com/woothemes/woocommerce/files/479645/systemstatusreport.txt)\r\n\r\n\r\n<!--\r\nBEFORE POSTING YOUR ISSUE\r\n- These comments won't show up when you submit the issue.\r\n- Try to add as much detail as possible. Be specific!\r\n- GitHub issues ARE NOT FOR SUPPORT! If you have questions, use the either:\r\n  - https://wordpress.org/support/plugin/woocommerce for general support\r\n  - https://woocommerce.com/my-account/tickets/ for premium plugin support\r\n- If you're requesting a new feature, explain why you'd like it to be added.\r\n- Search this repository (top of the page) for the issue and it has not been fixed or reported already.\r\n\r\nBefore logging BUGS, ensure you:\r\n- Use the latest stable release of WooCommerce.\r\n- Disabled all plugins to ensure it's a core bug and not a plugin issue.\r\n- Switched to Twenty Twelve theme to ensure it's a core bug and not a theme issue.\r\n-->\r\n"}}
{"actor":{"display_login":"leeuweriq"}}