Creating Loyalty Account Fails

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"
    }
  ]
}

Hi @danjy ,
I would like to take a look into this.
Could I get your application id, so I can take a look at your API Logs.

Thank you. Logs are below.

Request:

{
  "loyalty_account": {
    "program_id": "1398ede9-26de-4df7-a8c3-48724c2793e5",
    "customer_id": "AVHQJ37DYCT4DA991AZSEQF7EM",
    "mapping": {
      "phone_number": "+19281734485"
    }
  },
  "idempotency_key": "65ba8c204ffe7"
}

Response:

{
  "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.

Those logs are from the Square API Explorer. The application id is “sq0idp-Um5jtq1sP6NGk99RLqo75w”