{"id":13465304,"date":"2020-09-28T18:38:09","date_gmt":"2020-09-28T18:38:09","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/api-set-update-location-stock\/"},"modified":"2020-09-28T18:38:09","modified_gmt":"2020-09-28T18:38:09","slug":"api-set-update-location-stock","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/api-set-update-location-stock\/","title":{"rendered":"API: Set\/Update location stock?"},"content":{"rendered":"<p>I&#8217;m integrating the database-of-record with WC through the REST API. So far so good but that last thing on my list is setting the stock per location.<\/p>\n<p>While &#8216;locations&#8217; isn&#8217;t listed in the API docs, it does come back for any updates on products. So I&#8217;m trying to set it to an array of location names and stock quantities, but it has no effect.<\/p>\n<p>When I browse a product I&#8217;ve applied this API update to, the Stock Locations tab says &#8220;You need to add a stock location to this product.&#8221; Is there a way to do this through the API? <\/p>\n","protected":false},"template":"","class_list":["post-13465304","topic","type-topic","status-publish","hentry","topic-tag-api"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13465304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13465304\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=13465304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}