I am trying to update a Shopify user using this flutter package. When I update the phone number, I am getting this error
customerUserErrors during customerUpdate: [{__typename: CustomerUserError, code: INVALID, field: [customer, phone], message: Enter a valid phone number}]
This is the phone number format that I am using to update it
+91 9878400227
This is my update function for the flutter code
try {
ShopifyCustomer shopifyCustomer =
ShopifyCustomer.instance;
final phone =
"${currentUser.countryCode} ${currentUser.phone}";
log(phone);
await shopifyCustomer.customerUpdate(
customerAccessToken: currentUser.shopifyAccessToken,
firstName: currentUser.name,
phoneNumber: phone,
email: currentUser.email,
password: currentUser.password,
lastName: currentUser.shopifyUser?.lastName,
acceptsMarketing: true,
);
ShopifyAuth shopifyAuth = ShopifyAuth.instance;
ShopifyUser? user =
await shopifyAuth.currentUser(forceRefresh: true);
currentUser.shopifyUser = user;
} catch (e) {
log("Error updating shopify user:\n$e");
}
Is there anything that I am doing wrong. Do let me know.
Best Regards