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."
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024