Anchor to section titled 'undefined'

customerDefaultAddressUpdate
mutation

Requires unauthenticated_write_customers access scope.

Updates the default address of an existing customer.


Anchor to addressId
addressId
required

ID of the address to set as the new default for the customer.

Anchor to customerAccessToken
customerAccessToken
required

The access token used to identify the customer.


Was this section helpful?

The updated customer object.

The list of errors that occurred from executing the mutation.

The list of errors that occurred from executing the mutation. Use customerUserErrors instead.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation customerDefaultAddressUpdate($addressId: ID!, $customerAccessToken: String!) {
  customerDefaultAddressUpdate(addressId: $addressId, customerAccessToken: $customerAccessToken) {
    customer {
      # Customer fields
    }
    customerUserErrors {
      # CustomerUserError fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "addressId": "gid://shopify/<objectName>/10079785100",
  "customerAccessToken": "<your-customerAccessToken>"
}