Order Metafields with Graphql Admin API

Order Metafields with Graphql Admin API

Alfonso3
Shopify Partner
1 0 1

It looks like we can't access the order metafields using the Graphql Admin API. It seems weird since we do have access to the draft order metafields. Can we add the capability of querying and mutating order metafields?

Thanks

Replies 2 (2)

BogdanM
Shopify Partner
123 3 27

Hello,

It works like this:

{
  orders(first: 10) {
    edges {
      cursor
      node {
        legacyResourceId
        name
        metafields(first: 10) {
          edges {
            node {
              namespace
              value
              key
            }
          }
        }
      }
    }
    pageInfo {
      hasNextPage
    }
  }
}

 

Bogdan | WebShopAssist
User friendly apps with top-rated support
- SKUGen the SKU generator
- DPD Integration
NoraHey
Shopify Partner
1 0 0

Hi, I'm interested in using metafields on orders as well but while orders support them and those can be retrieved via the Graphql admin api, I can't find anyway to update an order to add them in the first place via the Graphql admin api. Metafields don't exist as input properties on the OrderUpdate mutation (https://help.shopify.com/en/api/graphql-admin-api/reference/mutation/orderupdate#input-fields) and there is no MetafieldCreate mutation available either. 

 

Am I missing something?