The draft order is created correctly, but when I convert it to an actual order by using the invoiceUrl only the tags and the note are carried over, the metafields are not.
Is there a way to attach meta information to a draft order that will show up in the resulting order?
The behaviour of the metafield resource not being on the related order from the completed draft order is expected. As a possible work around, utilizing a draft_orders/update web hook would allow you the opportunity to migrate the metafields you want to the connected order when the draft order completes.
I think there’s definitely value in auto creating the metafield on the resulting order, so I’ll be sure to share this with the appropriate team.
I might actually like your approach better :-). The custom attributes get moved over already and you have that working. Maybe the web hook approach and migrating metafields yourself might not prove to be overly beneficial, but I’ll leave that with you. If you have any other questions let me know.
@_JCC@Leo_Bossmann Just wanted to weigh in here and share an issue with using the custom attributes (note attributes) approach:
Note attributes are not a good candidate to store information that should not be visible to customers; some integrations send the notes to back-end systems that may result in notifications being sent to the customer that include the note attribute
We would like the ability to add a (private) metafield to a draft order and ensure it is moved over to the order automatically.
That would allow us to store the technical information related to the draft order in a proper fashion.