Context:
We have created a custom app for a Plus merchant that needs some specific additional address fields captured at checkout, and they need these values captured into order metafields. The fields are dropdowns with predefined options for address validation purposes in regards to their fulfillment platform integration.
All is good and well with that and we have achieved their requirement in this regard.
However, they also have sales reps that create draft orders from the back end of Shopify for customers, and they need those custom fields to also be available in the back end when those reps create the orders. This is already the case, in a sense, in that once the Draft order is created and becomes an “Order”, the custom fields are there by virtue of the fact that they exist as metafields in the admin.
However the issue is that the metafields do not have the predefined options as a dropdown in the back end—at least not unless we manually add preset values to the metafield definitions of course, which is however very impractical as there are so many options and the app is going to be used on something like 25 plus stores.
The question:
So that brings us to the original query: Is it possible, via the API, that when we create these order metafields, we can also create the preset options for them so that they behave us dropdowns in the admin like they do when you manually add preset options to text metafields?