Draft order metafields

13 0 4



Is there a way for the metafields of my draft order to be added automatically to the final order, when the draft order is completed?



Shopify Expert
10360 158 2010

Not with a native feature within Shopify, but you could build a tool to automate that process if that's a need. For my own interest, since the metafield would remain on the Draft why do you need to transition it to the Order?

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.

★ http://freakdesign.com.au ★
13 0 4

Thanks for replying.

I have other processes that use the metafields from the completed order, and I wanted to avoid changing those processes.

The idea to add the metafields to the draft order instead of directly to the order, has come from the need to reduce the number of calls to shopify's api later on in the process.

Thanks again  :)

Shopify Partner
16 0 3

I'm also running into this problem. 

Using the GraphQL api, the only way to create an order is to create a draft order, then complete that draft order. I want some metafields on the final order, however the metafields I create on the Draft Order don't get carried over to the Order (unlike the Custom Attributes).

This shouldn't be a problem, because like you say, the metafields are still stored on the Draft Order. However, I don't see (anywhere in the docs) a way to access the Draft Order from the final Order. There doesn't seem to be a field, or connection that I can use to get the Draft Order from which the Order was created.

Any insight on this would be greatly appreciated.