# customerUpdate - admin-graphql - MUTATION
Version: 2025-01

## Description
Update a customer's attributes. As of API version 2022-10, apps using protected customer data must meet the protected customer data [requirements](https://shopify.dev/apps/store/data-protection/protected-customer-data).

### Access Scopes
`write_customers` access scope.


## Arguments
* [input](/docs/api/admin-graphql/2025-01/input-objects/CustomerInput): CustomerInput! - Provides updated fields for the customer. To set marketing consent, use the `customerEmailMarketingConsentUpdate` or `customerSmsMarketingConsentUpdate` mutations instead.


## Returns
* [customer](/docs/api/admin-graphql/2025-01/objects/Customer): Customer The updated customer.
* [userErrors](/docs/api/admin-graphql/2025-01/objects/UserError): UserError! The list of errors that occurred from executing the mutation.


## Examples
### Create a new metafield and update another on an existing customer
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation updateCustomerMetafields($input: CustomerInput!) { customerUpdate(input: $input) { customer { id metafields(first: 3) { edges { node { id namespace key value } } } } userErrors { message field } } }\",\n \"variables\": {\n    \"input\": {\n      \"metafields\": [\n        {\n          \"namespace\": \"my_field\",\n          \"key\": \"nickname\",\n          \"type\": \"single_line_text_field\",\n          \"value\": \"rob\"\n        },\n        {\n          \"id\": \"gid://shopify/Metafield/1069230189\",\n          \"value\": \"they/them\"\n        }\n      ],\n      \"id\": \"gid://shopify/Customer/1018520244\"\n    }\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation updateCustomerMetafields($input: CustomerInput!) {\n      customerUpdate(input: $input) {\n        customer {\n          id\n          metafields(first: 3) {\n            edges {\n              node {\n                id\n                namespace\n                key\n                value\n              }\n            }\n          }\n        }\n        userErrors {\n          message\n          field\n        }\n      }\n    }`,\n    \"variables\": {\n      \"input\": {\n        \"metafields\": [\n          {\n            \"namespace\": \"my_field\",\n            \"key\": \"nickname\",\n            \"type\": \"single_line_text_field\",\n            \"value\": \"rob\"\n          },\n          {\n            \"id\": \"gid://shopify/Metafield/1069230189\",\n            \"value\": \"they/them\"\n          }\n        ],\n        \"id\": \"gid://shopify/Customer/1018520244\"\n      }\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation updateCustomerMetafields($input: CustomerInput!) {\n    customerUpdate(input: $input) {\n      customer {\n        id\n        metafields(first: 3) {\n          edges {\n            node {\n              id\n              namespace\n              key\n              value\n            }\n          }\n        }\n      }\n      userErrors {\n        message\n        field\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"input\": {\n    \"metafields\": [{\"namespace\"=>\"my_field\", \"key\"=>\"nickname\", \"type\"=>\"single_line_text_field\", \"value\"=>\"rob\"}, {\"id\"=>\"gid://shopify/Metafield/1069230189\", \"value\"=>\"they/them\"}],\n    \"id\": \"gid://shopify/Customer/1018520244\"\n  }\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation updateCustomerMetafields($input: CustomerInput!) {\n    customerUpdate(input: $input) {\n      customer {\n        id\n        metafields(first: 3) {\n          edges {\n            node {\n              id\n              namespace\n              key\n              value\n            }\n          }\n        }\n      }\n      userErrors {\n        message\n        field\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"input\": {\n        \"metafields\": [\n          {\n            \"namespace\": \"my_field\",\n            \"key\": \"nickname\",\n            \"type\": \"single_line_text_field\",\n            \"value\": \"rob\"\n          },\n          {\n            \"id\": \"gid://shopify/Metafield/1069230189\",\n            \"value\": \"they/them\"\n          }\n        ],\n        \"id\": \"gid://shopify/Customer/1018520244\"\n      }\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation updateCustomerMetafields($input: CustomerInput!) {\n  customerUpdate(input: $input) {\n    customer {\n      id\n      metafields(first: 3) {\n        edges {\n          node {\n            id\n            namespace\n            key\n            value\n          }\n        }\n      }\n    }\n    userErrors {\n      message\n      field\n    }\n  }\n}"
#### Graphql Input
{
  "input": {
    "metafields": [
      {
        "namespace": "my_field",
        "key": "nickname",
        "type": "single_line_text_field",
        "value": "rob"
      },
      {
        "id": "gid://shopify/Metafield/1069230189",
        "value": "they/them"
      }
    ],
    "id": "gid://shopify/Customer/1018520244"
  }
}
#### Graphql Response
{
  "data": {
    "customerUpdate": {
      "customer": {
        "id": "gid://shopify/Customer/1018520244",
        "metafields": {
          "edges": [
            {
              "node": {
                "id": "gid://shopify/Metafield/1069230189",
                "namespace": "my_field",
                "key": "pronouns",
                "value": "they/them"
              }
            },
            {
              "node": {
                "id": "gid://shopify/Metafield/1069230190",
                "namespace": "my_field",
                "key": "nickname",
                "value": "rob"
              }
            }
          ]
        }
      },
      "userErrors": []
    }
  }
}

### Creates a new address for a customer
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation CustomerAddressCreate($customerId: ID!, $addresses: [MailingAddressInput!]) { customerUpdate(input: {id: $customerId, addresses: $addresses}) { customer { id addressesV2(first: 10) { edges { node { id address1 city } } } } userErrors { field message } } }\",\n \"variables\": {\n    \"customerId\": \"gid://shopify/Customer/1018520244\",\n    \"addresses\": [\n      {\n        \"address1\": \"123 New Address\",\n        \"city\": \"New City\"\n      }\n    ]\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation CustomerAddressCreate($customerId: ID!, $addresses: [MailingAddressInput!]) {\n      customerUpdate(input: {id: $customerId, addresses: $addresses}) {\n        customer {\n          id\n          addressesV2(first: 10) {\n            edges {\n              node {\n                id\n                address1\n                city\n              }\n            }\n          }\n        }\n        userErrors {\n          field\n          message\n        }\n      }\n    }`,\n    \"variables\": {\n      \"customerId\": \"gid://shopify/Customer/1018520244\",\n      \"addresses\": [\n        {\n          \"address1\": \"123 New Address\",\n          \"city\": \"New City\"\n        }\n      ]\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation CustomerAddressCreate($customerId: ID!, $addresses: [MailingAddressInput!]) {\n    customerUpdate(input: {id: $customerId, addresses: $addresses}) {\n      customer {\n        id\n        addressesV2(first: 10) {\n          edges {\n            node {\n              id\n              address1\n              city\n            }\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"customerId\": \"gid://shopify/Customer/1018520244\",\n  \"addresses\": [{\"address1\"=>\"123 New Address\", \"city\"=>\"New City\"}]\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation CustomerAddressCreate($customerId: ID!, $addresses: [MailingAddressInput!]) {\n    customerUpdate(input: {id: $customerId, addresses: $addresses}) {\n      customer {\n        id\n        addressesV2(first: 10) {\n          edges {\n            node {\n              id\n              address1\n              city\n            }\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"customerId\": \"gid://shopify/Customer/1018520244\",\n      \"addresses\": [\n        {\n          \"address1\": \"123 New Address\",\n          \"city\": \"New City\"\n        }\n      ]\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation CustomerAddressCreate($customerId: ID!, $addresses: [MailingAddressInput!]) {\n  customerUpdate(input: {id: $customerId, addresses: $addresses}) {\n    customer {\n      id\n      addressesV2(first: 10) {\n        edges {\n          node {\n            id\n            address1\n            city\n          }\n        }\n      }\n    }\n    userErrors {\n      field\n      message\n    }\n  }\n}"
#### Graphql Input
{
  "customerId": "gid://shopify/Customer/1018520244",
  "addresses": [
    {
      "address1": "123 New Address",
      "city": "New City"
    }
  ]
}
#### Graphql Response
{
  "data": {
    "customerUpdate": {
      "customer": {
        "id": "gid://shopify/Customer/1018520244",
        "addressesV2": {
          "edges": [
            {
              "node": {
                "id": "gid://shopify/MailingAddress/1053318591?model_name=CustomerAddress",
                "address1": "123 New Address",
                "city": "New City"
              }
            }
          ]
        }
      },
      "userErrors": []
    }
  }
}

### Performs bulk operations for multiple customer addresses
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation CustomerAddressSet($customerId: ID!, $addresses: [MailingAddressInput!]) { customerUpdate(input: {id: $customerId, addresses: $addresses}) { customer { id addressesV2(first: 10) { edges { node { id address1 city } } } } userErrors { field message } } }\",\n \"variables\": {\n    \"customerId\": \"gid://shopify/Customer/1018520244\",\n    \"addresses\": [\n      {\n        \"address1\": \"123 Main St\",\n        \"city\": \"Metropolis\"\n      },\n      {\n        \"address1\": \"456 Elm St\",\n        \"city\": \"Gotham\"\n      }\n    ]\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation CustomerAddressSet($customerId: ID!, $addresses: [MailingAddressInput!]) {\n      customerUpdate(input: {id: $customerId, addresses: $addresses}) {\n        customer {\n          id\n          addressesV2(first: 10) {\n            edges {\n              node {\n                id\n                address1\n                city\n              }\n            }\n          }\n        }\n        userErrors {\n          field\n          message\n        }\n      }\n    }`,\n    \"variables\": {\n      \"customerId\": \"gid://shopify/Customer/1018520244\",\n      \"addresses\": [\n        {\n          \"address1\": \"123 Main St\",\n          \"city\": \"Metropolis\"\n        },\n        {\n          \"address1\": \"456 Elm St\",\n          \"city\": \"Gotham\"\n        }\n      ]\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation CustomerAddressSet($customerId: ID!, $addresses: [MailingAddressInput!]) {\n    customerUpdate(input: {id: $customerId, addresses: $addresses}) {\n      customer {\n        id\n        addressesV2(first: 10) {\n          edges {\n            node {\n              id\n              address1\n              city\n            }\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"customerId\": \"gid://shopify/Customer/1018520244\",\n  \"addresses\": [{\"address1\"=>\"123 Main St\", \"city\"=>\"Metropolis\"}, {\"address1\"=>\"456 Elm St\", \"city\"=>\"Gotham\"}]\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation CustomerAddressSet($customerId: ID!, $addresses: [MailingAddressInput!]) {\n    customerUpdate(input: {id: $customerId, addresses: $addresses}) {\n      customer {\n        id\n        addressesV2(first: 10) {\n          edges {\n            node {\n              id\n              address1\n              city\n            }\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"customerId\": \"gid://shopify/Customer/1018520244\",\n      \"addresses\": [\n        {\n          \"address1\": \"123 Main St\",\n          \"city\": \"Metropolis\"\n        },\n        {\n          \"address1\": \"456 Elm St\",\n          \"city\": \"Gotham\"\n        }\n      ]\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation CustomerAddressSet($customerId: ID!, $addresses: [MailingAddressInput!]) {\n  customerUpdate(input: {id: $customerId, addresses: $addresses}) {\n    customer {\n      id\n      addressesV2(first: 10) {\n        edges {\n          node {\n            id\n            address1\n            city\n          }\n        }\n      }\n    }\n    userErrors {\n      field\n      message\n    }\n  }\n}"
#### Graphql Input
{
  "customerId": "gid://shopify/Customer/1018520244",
  "addresses": [
    {
      "address1": "123 Main St",
      "city": "Metropolis"
    },
    {
      "address1": "456 Elm St",
      "city": "Gotham"
    }
  ]
}
#### Graphql Response
{
  "data": {
    "customerUpdate": {
      "customer": {
        "id": "gid://shopify/Customer/1018520244",
        "addressesV2": {
          "edges": [
            {
              "node": {
                "id": "gid://shopify/MailingAddress/1053318585?model_name=CustomerAddress",
                "address1": "123 Main St",
                "city": "Metropolis"
              }
            },
            {
              "node": {
                "id": "gid://shopify/MailingAddress/1053318586?model_name=CustomerAddress",
                "address1": "456 Elm St",
                "city": "Gotham"
              }
            }
          ]
        }
      },
      "userErrors": []
    }
  }
}

### Update a customer with an ID that doesn't exist
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation customerUpdate($input: CustomerInput!) { customerUpdate(input: $input) { userErrors { field message } customer { id firstName } } }\",\n \"variables\": {\n    \"input\": {\n      \"id\": \"gid://shopify/Customer/1\",\n      \"firstName\": \"Tobi\"\n    }\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation customerUpdate($input: CustomerInput!) {\n      customerUpdate(input: $input) {\n        userErrors {\n          field\n          message\n        }\n        customer {\n          id\n          firstName\n        }\n      }\n    }`,\n    \"variables\": {\n      \"input\": {\n        \"id\": \"gid://shopify/Customer/1\",\n        \"firstName\": \"Tobi\"\n      }\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation customerUpdate($input: CustomerInput!) {\n    customerUpdate(input: $input) {\n      userErrors {\n        field\n        message\n      }\n      customer {\n        id\n        firstName\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"input\": {\n    \"id\": \"gid://shopify/Customer/1\",\n    \"firstName\": \"Tobi\"\n  }\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation customerUpdate($input: CustomerInput!) {\n    customerUpdate(input: $input) {\n      userErrors {\n        field\n        message\n      }\n      customer {\n        id\n        firstName\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"input\": {\n        \"id\": \"gid://shopify/Customer/1\",\n        \"firstName\": \"Tobi\"\n      }\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation customerUpdate($input: CustomerInput!) {\n  customerUpdate(input: $input) {\n    userErrors {\n      field\n      message\n    }\n    customer {\n      id\n      firstName\n    }\n  }\n}"
#### Graphql Input
{
  "input": {
    "id": "gid://shopify/Customer/1",
    "firstName": "Tobi"
  }
}
#### Graphql Response
{
  "data": {
    "customerUpdate": {
      "userErrors": [
        {
          "field": [
            "id"
          ],
          "message": "Customer does not exist"
        }
      ],
      "customer": null
    }
  }
}

### Updates a customer's first and last name
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation customerUpdate($input: CustomerInput!) { customerUpdate(input: $input) { userErrors { field message } customer { id firstName lastName } } }\",\n \"variables\": {\n    \"input\": {\n      \"id\": \"gid://shopify/Customer/1018520244\",\n      \"firstName\": \"Tobi\",\n      \"lastName\": \"Lutke\"\n    }\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation customerUpdate($input: CustomerInput!) {\n      customerUpdate(input: $input) {\n        userErrors {\n          field\n          message\n        }\n        customer {\n          id\n          firstName\n          lastName\n        }\n      }\n    }`,\n    \"variables\": {\n      \"input\": {\n        \"id\": \"gid://shopify/Customer/1018520244\",\n        \"firstName\": \"Tobi\",\n        \"lastName\": \"Lutke\"\n      }\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation customerUpdate($input: CustomerInput!) {\n    customerUpdate(input: $input) {\n      userErrors {\n        field\n        message\n      }\n      customer {\n        id\n        firstName\n        lastName\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"input\": {\n    \"id\": \"gid://shopify/Customer/1018520244\",\n    \"firstName\": \"Tobi\",\n    \"lastName\": \"Lutke\"\n  }\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation customerUpdate($input: CustomerInput!) {\n    customerUpdate(input: $input) {\n      userErrors {\n        field\n        message\n      }\n      customer {\n        id\n        firstName\n        lastName\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"input\": {\n        \"id\": \"gid://shopify/Customer/1018520244\",\n        \"firstName\": \"Tobi\",\n        \"lastName\": \"Lutke\"\n      }\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation customerUpdate($input: CustomerInput!) {\n  customerUpdate(input: $input) {\n    userErrors {\n      field\n      message\n    }\n    customer {\n      id\n      firstName\n      lastName\n    }\n  }\n}"
#### Graphql Input
{
  "input": {
    "id": "gid://shopify/Customer/1018520244",
    "firstName": "Tobi",
    "lastName": "Lutke"
  }
}
#### Graphql Response
{
  "data": {
    "customerUpdate": {
      "userErrors": [],
      "customer": {
        "id": "gid://shopify/Customer/1018520244",
        "firstName": "Tobi",
        "lastName": "Lutke"
      }
    }
  }
}

### Updates an existing customer address
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation CustomerAddressUpdate($customerId: ID!, $addresses: [MailingAddressInput!]) { customerUpdate(input: {id: $customerId, addresses: $addresses}) { customer { id addressesV2(first: 10) { edges { node { id address1 city } } } } userErrors { field message } } }\",\n \"variables\": {\n    \"customerId\": \"gid://shopify/Customer/1018520244\",\n    \"addresses\": [\n      {\n        \"address1\": \"123 New Street\",\n        \"city\": \"New City\"\n      }\n    ]\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation CustomerAddressUpdate($customerId: ID!, $addresses: [MailingAddressInput!]) {\n      customerUpdate(input: {id: $customerId, addresses: $addresses}) {\n        customer {\n          id\n          addressesV2(first: 10) {\n            edges {\n              node {\n                id\n                address1\n                city\n              }\n            }\n          }\n        }\n        userErrors {\n          field\n          message\n        }\n      }\n    }`,\n    \"variables\": {\n      \"customerId\": \"gid://shopify/Customer/1018520244\",\n      \"addresses\": [\n        {\n          \"address1\": \"123 New Street\",\n          \"city\": \"New City\"\n        }\n      ]\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation CustomerAddressUpdate($customerId: ID!, $addresses: [MailingAddressInput!]) {\n    customerUpdate(input: {id: $customerId, addresses: $addresses}) {\n      customer {\n        id\n        addressesV2(first: 10) {\n          edges {\n            node {\n              id\n              address1\n              city\n            }\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"customerId\": \"gid://shopify/Customer/1018520244\",\n  \"addresses\": [{\"address1\"=>\"123 New Street\", \"city\"=>\"New City\"}]\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation CustomerAddressUpdate($customerId: ID!, $addresses: [MailingAddressInput!]) {\n    customerUpdate(input: {id: $customerId, addresses: $addresses}) {\n      customer {\n        id\n        addressesV2(first: 10) {\n          edges {\n            node {\n              id\n              address1\n              city\n            }\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"customerId\": \"gid://shopify/Customer/1018520244\",\n      \"addresses\": [\n        {\n          \"address1\": \"123 New Street\",\n          \"city\": \"New City\"\n        }\n      ]\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation CustomerAddressUpdate($customerId: ID!, $addresses: [MailingAddressInput!]) {\n  customerUpdate(input: {id: $customerId, addresses: $addresses}) {\n    customer {\n      id\n      addressesV2(first: 10) {\n        edges {\n          node {\n            id\n            address1\n            city\n          }\n        }\n      }\n    }\n    userErrors {\n      field\n      message\n    }\n  }\n}"
#### Graphql Input
{
  "customerId": "gid://shopify/Customer/1018520244",
  "addresses": [
    {
      "address1": "123 New Street",
      "city": "New City"
    }
  ]
}
#### Graphql Response
{
  "data": {
    "customerUpdate": {
      "customer": {
        "id": "gid://shopify/Customer/1018520244",
        "addressesV2": {
          "edges": [
            {
              "node": {
                "id": "gid://shopify/MailingAddress/1053318595?model_name=CustomerAddress",
                "address1": "123 New Street",
                "city": "New City"
              }
            }
          ]
        }
      },
      "userErrors": []
    }
  }
}