product_id or variant_id

Solved
New Member
3 0 1

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
Shopify Partner
860 74 185

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