# Square is claiming valid phone numbers are invalid

**URL:** <https://developer.squareup.com/forums/t/square-is-claiming-valid-phone-numbers-are-invalid/20906>\
**Category:** Questions\
**Tags:** customers-api, checkout-api\
**Created:** [February 1, 2025, 3:30am UTC](https://developer.squareup.com/forums/t/square-is-claiming-valid-phone-numbers-are-invalid/20906 "2025-02-01T03:30:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![benzado](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/benzado/32/8667_2.png) [@benzado](https://developer.squareup.com/forums/u/benzado)\
**Post date:** [February 1, 2025, 3:30am UTC](https://developer.squareup.com/forums/t/square-is-claiming-valid-phone-numbers-are-invalid/20906/1 "2025-02-01T03:30:33Z")

</div>

We’re using Square to handle payments for a business in London, where people from around the world come to take classes.

A significant number of customers are unable to complete the checkout process because Square considers their _valid, working_ phone number to be invalid (either returning `INVALID_PHONE_NUMBER` from the API or displaying “A valid phone number must be provided” on the checkout page). This prevents them from paying for a class.

**How does Square decide which phone numbers are valid?**

For example, a number of the format `+44 077xx xxx xxx` is being rejected; it is a valid UK mobile number, but I suspect Square may be misidentifying it as a virtual number `070 xxxx xxxx` or pager `076 xxxx xxxx`.

If that’s not the reason, I would like a little more information on how Square validates numbers, because right now we’re unable to support our customers who want to know why they are being told their phone numbers aren’t valid.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [February 1, 2025, 3:30am UTC](https://developer.squareup.com/forums/t/square-is-claiming-valid-phone-numbers-are-invalid/20906/2 "2025-02-01T03:30:51Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:  
[https://developer.squareup.com/docs/app-marketplace/requirements/web-payments-sdk](https://developer.squareup.com/docs/app-marketplace/requirements/web-payments-sdk)

> **[Supported Payment Methods by Country](https://developer.squareup.com/docs/payment-card-support-by-country)**
>
> Learn about Square support for payment card brands by country for card-not-present and card-present payments.

> **Additional Documentation**
>
> [Guidelines and Limitations](https://developer.squareup.com/docs/checkout-api/guidelines-and-limitations)  
> [Payment API: Process Online and In-Person Payments](https://developer.squareup.com/docs/payments)  
> [Payments Pricing with Square APIs and SDKs](https://developer.squareup.com/docs/payments-pricing)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![benzado](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/benzado/32/8667_2.png) [@benzado](https://developer.squareup.com/forums/u/benzado)\
**Post date:** [February 1, 2025, 3:35am UTC](https://developer.squareup.com/forums/t/square-is-claiming-valid-phone-numbers-are-invalid/20906/3 "2025-02-01T03:35:09Z")

</div>

No, none of that answers my question.

---

<div class="post-metadata">

**Author:** ![sde1000](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sde1000](https://developer.squareup.com/forums/u/sde1000)\
**Post date:** [February 3, 2025, 11:53am UTC](https://developer.squareup.com/forums/t/square-is-claiming-valid-phone-numbers-are-invalid/20906/4 "2025-02-03T11:53:30Z")

</div>

Wouldn’t the correct format for the number be `+44 77xx xxxxxx`?

The `0` is used when the `+44` is absent, for calls from within the UK.

---

<div class="post-metadata">

**Author:** ![josh-square](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@josh-square](https://developer.squareup.com/forums/u/josh-square)\
**Post date:** [February 3, 2025, 5:08pm UTC](https://developer.squareup.com/forums/t/square-is-claiming-valid-phone-numbers-are-invalid/20906/5 "2025-02-03T17:08:08Z")

</div>

Hello!

Square checks if the number is valid based on the country code and the length of the number. However, it doesn’t check if the number is actually in use or if it’s a virtual number or a pager.

In your example, the number `+44 077xx xxx xxx` should be a valid UK mobile number. If it’s being rejected, it might be due to an issue with the formatting. Can you try removing the leading zero after the country code, making it `+44 77xx xxx xxx`, and see if that resolves the issue.

---

<div class="post-metadata">

**Author:** ![benzado](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/benzado/32/8667_2.png) [@benzado](https://developer.squareup.com/forums/u/benzado)\
**Post date:** [February 10, 2025, 8:26pm UTC](https://developer.squareup.com/forums/t/square-is-claiming-valid-phone-numbers-are-invalid/20906/6 "2025-02-10T20:26:03Z")

</div>

You’re correct that the leading `0` should be omitted after the country code `+44`. However, in every case I have observed, the Square API treats the number with and without the leading 0 the same way.

Also, adding or removing a leading `0` is the first thing the users are trying when they are told their numbers are invalid.

---

<div class="post-metadata">

**Author:** ![benzado](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/benzado/32/8667_2.png) [@benzado](https://developer.squareup.com/forums/u/benzado)\
**Post date:** [February 10, 2025, 8:40pm UTC](https://developer.squareup.com/forums/t/square-is-claiming-valid-phone-numbers-are-invalid/20906/7 "2025-02-10T20:40:23Z")

</div>

I did some more experimentation and discovered:

1. Including or omitting a leading zero does not matter. Square responds to either variation the same way.
2. It is clearly doing more than checking the number of digits, as it rejects some fictitious numbers which are reserved for use in TV and movies.
3. The same validation rules appear to apply in sandbox and production (which is annoying, as I cannot use fake numbers for test purposes in the sandbox).

I wrote a small script to create a payment link with a specified number.

**Treated as valid both in sandbox and production:**

- `+440772431xxxx` (actual customer number, redacted)
- `+44772431xxxx` (actual customer number, redacted)
- `+440798105xxxx` (actual customer number, redacted)
- `+44798105xxxx` (actual customer number, redacted)
- `+441617151234` (fake area code used on _Coronation Street_)

**Treated as invalid in both sandbox and production:**

- `+447700900123` (fake UK mobile number)
- `+4407700900123` (fake UK mobile number)
- `+441154960004` (fake number in Nottingham)
- `+4401154960004` (fake number in Nottingham)

The good/strange news is that a number that is failing for a customer is working for me in my test script, so I’ve got more work to do to figure out what the difference is.

It would be helpful to know if Square is using an open source library for phone number validation, like Google’s libphonenumber. Then I wouldn’t have to experiment with the API to discover what the validation rules are.
