Updating inventory using Shopify API

I am trying to update products using the Shopify API. Here is an example XML request for updating the title, weight, and inventory of a product:

<?xml version="1.0" encoding="UTF-8"?>
<product>
  <id type="integer">100159400</id>
  <title>150 Watt Mini Stereo Power Amplifier</title>
  <variants type="array">
    <variant>
      <id type="integer">233139732</id>
      <grams type="integer">700</grams>
      <inventory-quantity type="integer">222</inventory-quantity>
    </variant>
  </variants>
</product>

I get 200-OK after PUT / admin / products / 100159400.xml. The name and weight (grams) are updated very well, but not the amount of inventory. This is consistent for all other calls: I can update each field, but the amount of inventory. Ideas?

+5
source share
1 answer

This product does not include inventory tracking. In your administrator, you should see the stock level display as infinity.

, inventory_management shopify. XML- :

<?xml version="1.0" encoding="UTF-8"?>
<product>
  <id type="integer">100159400</id>
  <title>150 Watt Mini Stereo Power Amplifier</title>
  <variants type="array">
    <variant>
      <id type="integer">233139732</id>
      <grams type="integer">700</grams>
      <inventory-management>shopify</inventory-management>
      <inventory-quantity type="integer">222</inventory-quantity>
    </variant>
  </variants>
</product>
+6

All Articles