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.
Payload:
{
"loyalty_account": {
"program_id": "26de-4df7-a8c3-48724c2793e5-1398ede9",
"customer_id": "4DA991AZSEQF7EMAVHQJ37DYCT",
"mapping": {
"phone_number": "+19281735585"
}
},
"idempotency_key": "65ba8c204ffe7"
}
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"
}
]
}
5 posts - 2 participants