A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
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.
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog