We have few products in our store which do not have variants. Shopify seems to assign a “default variant” for such products. We are trying to update the quantity of the inventory using the REST API as follows
update_inventory_req = requests.post( "https://%s.myshopify.com/admin/api/%s/inventory_levels/adjust.json" % (SHOP_NAME, API_VERSION), auth=(API_KEY,PASSWORD), json=json.dumps(payload), headers={'Content-Type': 'application/json'}
Where payload is
payload = {"inventory_item_id":14094647492653, "location_id":29563841,"available":1}
However, we are getting the status code as follows:
(Pdb) update_inventory_req
FYI: The above approach works for products which have variants.
Is there anything special to be done for products with no variants?