Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
Hi,
I need to add field to order entity in my shopify store using MetaField.
referring to this article :
https://help.shopify.com/en/api/reference/metafield
we can see that its easy to create meta field , but how to tell shopify that this meta field for orders ?
then I need to update order by setting this meta field value.
to be more clear :
My case is integration app, I need to add flag to order entity , The meta field name will be "IsTransfered", after posting the order to extrnal service I need to update this metafield IsTransfered=true.
Please let me know if there is other best practice .
hint : I'm using ShopifySharp library for .NET.
Thanks in advance
Solved! Go to the solution
This is an accepted solution.
The url for Orders is noted in that docs. eg:
Order | /admin/orders/#{id}/metafields.json |
What are you stuck on?
Out of interest why are you using a metafield and not a tag? Not suggesting that metafields are a bad idea, just curious.
Any help
This is an accepted solution.
The url for Orders is noted in that docs. eg:
Order | /admin/orders/#{id}/metafields.json |
What are you stuck on?
Out of interest why are you using a metafield and not a tag? Not suggesting that metafields are a bad idea, just curious.
Hi Jason,
There is no reason to use metafield instead of tag, I can use tag , do you thing that dealing with tags will be better in my case ?
Regarding to API call , should I do post request to this ?
Order | /admin/orders/#{id}/metafields.json |
we used the tags, really very clear and simple, thank you @Jason everything is fine with tags.
Hi Jason,
How to access the order metafields from the order status page with shopify liquid?
The order metafields are created but we are not able to access it on the order status page.
We are able to access for instance, order.line_items but not order.metafields.
Let me know.
can you please help me how to create a metafield in the draft order page. I need to be able to put customer Order # in that field so that the it can printed with the my order number when i am printing the invoice. Please help.
@Jason wrote:
Out of interest why are you using a metafield and not a tag?
Because the tags are accessible through the GUI while metafields are not?
If somebody deletes a tag, a sync job may run again and mess up the data.
But it seems it is not possible to create metafields on orders which are created by the api, even the docs says clearly that it should be:
https://shopify.dev/api/admin-rest/2022-01/resources/order#top
Ok, was my fault. It is possible to add a metafield to an order.