Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
Hi,
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?
Thanks,
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?
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 🙂
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.
I believe this article would be a solution for the problem.
https://help.shopify.com/en/manual/custom-data/copy-to-order