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."
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025