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."
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025