A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
There are many topics regarding Cost Per item for a Product.
The documentation is missing the part where you can include the "Cost" property in a variant and will update the "Cost Per Item".
name: <some name>
cost: Unit_Cost ?? 0
Is this omitted intentionally or it's a subject for change in the future?Clearly, we can make use of the "inventory_items" PUT method to update the Cost but will take twice the time to make the update.
What are your thoughts ShopifyTeam?
I suspect this will likely be a job for the GraphQL API.
A representative (non working) example may be something like this where you include the inventoryItem property within the variants array when creating the product:
title:"Example Product Variant 1",
As I said - it's a non working example, but theoretically it's possible to create the product with those cost prices in one call using GraphQL.
Thanks, @SB_90, but I think you misunderstood my question.
The problem is the documentation is missing the "Cost" field, but it's working. The payload I provided is valid and it's updating the cost as I want to.
I'm grateful that is working, everything is fine, but I'm curious if this is subject to change in the future so I'll not be surprised if my solution is not working anymore.