How to create orders with bundle line items?

Hi everyone,

With my team we are trying to create orders with bundle line items using the GraphQL API.

So far we were using orderCreate mutation to create orders in shopify, however it turned out it doesn’t support creating orders with bundle line items, since it is not possible to specify components at lineItem level.
We found draftOrderCreate mutation which eventually supports creating such orders, however the structure of the request is a bit different. It is not supporting the following what orderCreate mutation does:

  • taxLines at lineItems
  • taxLines at shippingLine - for orderCreate you can specify multiple shippingLines…
  • taxesIncluded - Whether taxes are included in the order subtotal
  • transactions - The payment transactions to create for the order.
  • processedAt - The date and time when an order was processed.
  • test - Whether this is a test order.
  • Also not accepting options like inventoryBehaviour

There are further data that draftOrderCreate mutation doesn’t support but the above mentioned the ones are crucial for us.

Is there any way to create orders with bundle lines having the above mentioned data using the shopify API? If there is then can you please share the steps to achieve it?

Thank you!

1 Like

Hey @ChannelEngine_Channe

The key difference between orderCreate and draftOrderCreate is their fundamental purpose. Order create is designed for recording orders that weren’t placed on Shopify (like during migrations), while draft orders are meant for orders processed through Shopify’s system.

For creating orders with bundle line items, draft orders are your best option. As of the 2024-07 GraphQL Admin API version, draftOrderLineItemInput accepts bundleComponents. You can add bundle items to draft orders by including the bundleComponents field in your draftOrderLineItemInput.

For the tax and pricing concerns you mentioned, I recommend using the draftOrderCalculate mutation first (draftOrderCalculate - GraphQL Admin) to determine accurate totals that reflect your store’s configuration. When using draft orders, fields like taxes and pricing are calculated based on your store settings rather than being manually specified.

Hey! Just checking in to see if the above information about draft orders helped unblock you here?