Ad

Shopify Updating Inventory 400 Bad Request

- 1 answer

I have a simple item in Shopify that I want to update with XML. Here is what I am sending to Shopify:

<product>
  <id type="integer">6620419777</id>
  <title>Test</title>
  <inventory-management>shopify</inventory-management>
  <inventory-quantity type="integer">4</inventory-quantity>
</product>

I get back "The remote server returned an error: (400) Bad Request." Any ideas?

Ad

Answer

The inventory qty belongs to the product variant. Even products that don't have variants actually have one variant, it's just not visible in the admin.

Relevant documentation: https://help.shopify.com/api/reference/product_variant

Ad
source: stackoverflow.com
Ad