I’m getting the following error from the Loyalty API when creating an account from the following payload. The docs say the number must be in the E.164 format. For example, “+14155551111”.
The phone number “+19281735585” passes every regex E.164 test I’ve run, so I don’t understand why the API is returning this error.
I’ve scrambled the IDs and last 4 of the phone number for privacy, but I’m receiving this error both in my code and in the Square API Explorer.
{
"errors": [
{
"code": "INVALID_PHONE_NUMBER",
"detail": "Loyalty phone number +19281734485 is not formatted correctly or uses an unsupported country code",
"field": "phone",
"category": "INVALID_REQUEST_ERROR"
}
]
}
{
"errors": [
{
"code": "INVALID_PHONE_NUMBER",
"detail": "Loyalty phone number +19281734485 is not formatted correctly or uses an unsupported country code",
"field": "phone",
"category": "INVALID_REQUEST_ERROR"
}
]
}
@danjy Thanks for the example API call. But I would also like to take at the related API calls that were make in by your application. If you could provide your application id from Developer Dashboard, then I can take a look at all your recent API calls in your API Logs.
I took a look at the logs and all the error messages seem to be correct. The details of the error messages explain why the request failed. Whether it be a format issue, incorrect country code, or if it’s already associated to a Loyalty account. What phone number are you having trouble with?
Thanks Bryan. So I think it may have to do with the test phone numbers that I’m using. For example, ```
+14151112222 failed, but +14153334569 worked ok. The first number did not already exist in my sandbox account, so I’m wondering if there is some type of check for a valid number somehow?