ShopifySharp icon indicating copy to clipboard operation
ShopifySharp copied to clipboard

api doesnt hae any way to set Inventory Item and cost per variant

Open amrender opened this issue 3 years ago • 3 comments

ProductVariant object is missing InventoryItem property, so no way to set cost for variant. InventoryService only have Update,Get and List functions.

amrender avatar Jun 19 '22 18:06 amrender

If I add new InventoryItem object, it does add the inventory but still doesn't set the cost for the product variant.

amrender avatar Jun 19 '22 18:06 amrender

Also any idea how to get ProductMetaFields and ProductVariantMetaFields?

amrender avatar Jun 19 '22 18:06 amrender

Hi, the InventoryLevel and InventoryItem can be a little confusing. Here is an image from the Shopify API documentation, explaining the relationship

inventory

ProductVariant object is missing InventoryItem property, so no way to set cost for variant. InventoryService only have Update,Get and List functions.

You have to use the inventory_item_id from the product variant, to update the cost. Example: https://shopify.dev/api/examples/product-inventory

If I add new InventoryItem object, it does add the inventory but still doesn't set the cost for the product variant.

You need to use the InventoryLevel to set the available quantity,

Fashionepaul avatar Jul 04 '22 10:07 Fashionepaul