product_id or variant_id

Solved
KCuevas
New Member
4 0 2

I'm creating Orders through API with products without variants. Should I use product_id instead of variant_id in line_item's array?
Or should I use variant_id always? Even if the product doesn’t have any variant.

0 Likes
Greg_Kujawa
Shopify Partner
1016 83 237

This is an accepted solution.

Even a product with no child variants has an inherent variant_id. Use the API to pull a specific product like this, and you should see the singleton variant_id value returned. This is what you would add to the order's line item.

0 Likes