REST api not disabling inventory management

Highlighted
New Member
6 0 0

Hey, 
I am using the REST api to adit some products and I want to disable the inventory management and so add this line in my json: "inventory_management":null. However, it keeps setting "inventory_management" to "shopify" and doesn't disable it. If I make any other changes like images, title or variants, it works. 

 

Can someone help me out here.

0 Likes
Highlighted
New Member
4 0 0

Are you trying to set inventory_management on the product level or variant? I think this has to be done on each variant, not the product object itself.

0 Likes
Highlighted
New Member
6 0 0

Yes, I am putting it in the variant. I also tried to retrieve one of the products and see what they have, and copied the exact same thing, still doesn't work.

0 Likes
Highlighted
New Member
4 0 0

Would you mind posting your json? Sounds like you are doing it right, maybe somebody else can chime in. Worst case you could look at creating a fulfillment service that does nothing, and assign the variant's policy to that fulfillment's handle.

0 Likes
Highlighted
New Member
6 0 0

Sure, here is the json

{'product': 
{'id':1234567, 'title': 'Product name', 'body_html': 'Some Description', 'vendor': 'abc-brand', 'product_type': 't-shirt',
'tags': ['tag1', ' tag2', 'tag3'], 'handle': 'test', 'options': [{'name': 'Title', 'position': 1, 'value': 'Default Title'},
{'name': 'Link', 'position': 2, 'value': 'https://www.url-link.com'}, {'name': 'Sizes', 'position': 3, 'value': 'S,M'}],
'variants': [{'barcode': None, 'compare_at_price': '140.00', 'grams': '50', 'option1': 'Default Title', 'option2': 'https://www.url-link.com',
'option3': 'S,M', 'price': '140.00', 'sku': None, 'taxable': 'True', 'fulfillment_service': 'manual', 'inventory_policy': 'deny', 'position': 1,
'requires_shipping': 'True', 'inventory_quantity': 0, 'inventory_management': None}], 'images': [{'src': 'image-url.com'}, {'src': 'image-url2.com'}]}}
0 Likes