Not yet seeing the "cost" on my store when I use the below format, with 12345 being inventory_item_id ... any ideas? myshop.com/admin/inventory_items/12345.json
Ah, thanks for confirming that... maybe/hopefully this is by design, to protect costs of shop owners. :)
So, just to confirm I have this right... this should work? On my dev store I'm still having no luck after iterating through $cost ...
$inv_request = $shop->api()->rest('GET', '/admin/inventory_items/12345.json');
$cost = $inv_request->body->inventory_item->cost;
For those implementing product cost in their apps we have just released a guide to supporting the new feature: https://help.shopify.com/en/api/guides/supporting-product-cost
Also, regarding the webhook issue Clement raised, we have just pushed an update which resolves this issue and also exposes the cost property to admin authenticated requests in the browser. Thanks for your patience while this was resolved.
I noticed when merchants update the cost per item field with CSV product import, the inventory_items/update webhook is not triggered. Is this by design? If it is, what do you recommend apps should do to detect changes in costs?
Hi Zapfor Solutions, thanks for the heads up on this, we're investigating the issue and will report back as soon as it's solved.
I'd like to check if you have got any update regarding bulk import costs does not fire inventory_items/update webhooks?
We have deprecated our own cost field in favor of this new built-in field.
However, some merchants have reported to us that the field doesn't allow $0 cost.
It might seem strange at first but there are some valid scenarios that warrant a $0 cost, such as items on consignment or free items.
Is it possible to change the field to allow for this?
It's worth noting that it is possible set a product price at $0 so it only makes sense to allow for the cost to be $0 as well.