# How to update customer metafields?

**URL:** <https://community.shopify.dev/t/how-to-update-customer-metafields/15080>\
**Category:** GraphQL Admin API Troubleshooting\
**Tags:** general-gql-troubles\
**Created:** [May 11, 2025, 4:55pm UTC](https://community.shopify.dev/t/how-to-update-customer-metafields/15080 "2025-05-11T16:55:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavlo\_Boyko](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pavlo\_Boyko](https://community.shopify.dev/u/Pavlo_Boyko)\
**Post date:** [May 11, 2025, 4:55pm UTC](https://community.shopify.dev/t/how-to-update-customer-metafields/15080/1 "2025-05-11T16:55:17Z")

</div>

I have an urgent issue.  
I have built a backend-only app and I was going to update customer metafield using graphql admin api.  
But I cannot update.  
Could you please help me?

---

<div class="post-metadata">

**Author:** ![Alan\_G](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/alan_g/32/5321_2.png) [@Alan\_G](https://community.shopify.dev/u/Alan_G)\
**Post date:** [May 12, 2025, 2:54pm UTC](https://community.shopify.dev/t/how-to-update-customer-metafields/15080/2 "2025-05-12T14:54:04Z")

</div>

Hey @Pavlo_Boyko 👋 - you should be able to update customer metafield using the [customerUpdate mutation here](https://shopify.dev/docs/api/admin-graphql/latest/mutations/customerUpdate), like this:

```auto
mutation updateCustomerMetafields($input: CustomerInput!) {
  customerUpdate(input: $input) {
    customer {
      id
      metafields(first: 3) {
        edges {
          node {
            id
            namespace
            key
            value
          }
        }
      }
    }
    userErrors {
      message
      field
    }
  }
}

```

input:

```auto
{
  "input": {
    "metafields": [
      {
        "id": "gid://shopify/Metafield/1069230189",
        "value": "new-input"
      }
    ],
    "id": "gid://shopify/Customer/1018520244"
  }
}

```

If you’re still encountering any issues though, could you share the specific error messages you’re seeing or an X-Request-ID from the API response headers we send out for an example response where you’re seeing the issue? Happy to do some digging into this if needed!

---

<div class="post-metadata">

**Author:** ![kyle\_liu](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/kyle_liu/32/14392_2.png) [@kyle\_liu](https://community.shopify.dev/u/kyle_liu)\
**Post date:** [May 14, 2025, 8:18am UTC](https://community.shopify.dev/t/how-to-update-customer-metafields/15080/3 "2025-05-14T08:18:46Z")

</div>

Hi @Pavlo_Boyko

Can you share your response information?
