Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
Hi - can anyone provide a sample JSON message that I can use to update the 'tracked' and 'country_code_of_origin' fields on the InventoryItem for a ProductVariant?
I'm currently sending this:
{
"inventory_item": {
"id": 29617460805709, //inventory item ID from variant
"tracked": False,
"country_code_of_origin": "US",
}
}
I'm PUT'ing that to https://username:password@store-name.myshopify.com/admin/inventory_items/#29617460805709.json (with the username, password, and store name filled in).
But I'm getting HTML back for some reason. Am I able to update these fields in this way, or do I have to do something else? There don't seem to be any examples of this in the documentation. Thanks!
bump
Hi Anthony,
I just figured it out myself. I'm using python API but here's the snippet of my code
shopify.InventoryItem(dict(id=InventoryItemID, tracked=True)).save()
Im using the "inventory_management" field in the variants to "track" the stock on product creation.
"variants": [
{
"sku": "lgfs231214906l",
"option1": "l",
"price": "119.00",
"inventory_management": "shopify"
},
country_code_of_origin does not work and is being updated later using a put on the InventoryItem.
User | RANK |
---|---|
6 | |
5 | |
3 | |
3 | |
3 |