How to Save Additional Data to Metafields When Placing an Order in Shopify?

Hi everyone,

I need to store additional data in order metafields at the time of order creation. Specifically, I want to save custom attributes such as extra pricing details, special instructions, or any other metadata. I’m looking for the best approach to achieve this: Using Shopify Functions or Checkout UI Extensions – Is there a way to modify order metafields dynamically before the order is placed? Via Shopify Webhooks – Can I listen for the orders/create webhook and update metafields immediately after order creation? With Shopify Admin API – Is there a way to programmatically add metafield data when an order is created? If anyone has implemented a similar solution or has best practices to share, I’d really appreciate your insights!

Thanks in advance! :blush:

Yes you can implement this using Shopify GraphQL
https://shopify.dev/docs/api/admin-graphql/2025-01/mutations/orderUpdate?example=Create+a+new+metafield+and+update+another+on+an+existing+order

isn’t this just for updating an existing order? i don’t think you can edit order metafields from checkout. you need to store it in note attributes and then use shopify flow or functions to move that info into a metafield.