Why getting product Id and variant Id null in Line item, Even i am passing in payload creating order

https://shopify.dev/api/admin-rest/2023-01/resources/order#post-orders

Create An Order API

https://your-development-store.myshopify.com/admin/api/2023-01/orders.json

Passing Payload with product_id and variant_id as shown in screenshot 1

But in response getting null in product_id and variant_id in lines_items in screenshot 2

Hi @HspZapbuild

The REST admin API will allow an app to create an order with custom line items. If you are providing product and variant ID values for products/ variants that do not exist on the shop, then it is expected behaviour for the product and variant IDs to be null in the response.

If you create the product variant first, then you can also create orders by simply including the variant ID and quantity, like the fifth example in our documentation on creating orders.