All things Shopify and commerce
Hi Shopify Community,
I’m encountering an issue with the Shopify customerAddressUpdate mutation and need your assistance. I receive a 400 error with the message "Invariant Failed" when attempting to update or create an address using the Shopify API.
Here’s a summary of the problem:
Details:
GraphQL Mutation Query:
mutation customerAddressUpdate(
$address: CustomerAddressInput!
$addressId: ID!
$defaultAddress: Boolean
) {
customerAddressUpdate(
address: $address
addressId: $addressId
defaultAddress: $defaultAddress
) {
customerAddress {
id
firstName
lastName
address1
city
province
country
zip
}
userErrors {
code
field
message
}
}
}
Example Payload:
{
"address": {
"firstName": "xtz",
"lastName": "adfsa",
"company": "compose tech",
"address1": "55 Garden Place",
"address2": "Willoughby",
"city": "Willoughby",
"province": "New South Wales",
"country": "AU",
"zip": "2068",
"phone": ""
},
"addressId": "your-address-id",
"defaultAddress": false
}
Headers Used in Postman:
Steps Taken:
Questions:
I appreciate any guidance or suggestions you can offer. Thank you!
Best regards,
Shilpe Saxena
customerAddressUpdate (shopify.dev)
I noticed that your parameters are not correct.
Hi @Kyle_liu ,
The solution did not resolve the issue. Even after adjusting the query to match the expected fields, I am still encountering the same error message: "Expected customer address to be updated."
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025