Skip to main content
Solved

Placed Order event fails for invalid phone number

  • 2 July 2024
  • 2 replies
  • 42 views

We are testing our integration and submitted a test ‘placed order’ event with a fake phone number, we get a 400 error “The phone number provided either does not exist or is ineligible to receive SMS”

The problem is that in real life customers can also enter invalid phone number (either intentionally or by accident).

It doesn’t seem logical that the ‘placed order’ event metric should fail in such a case, obviously if the phone number is not valid we would not be able to use the phone number, but why would we choose to lose the event altogether just because of an invalid phone number? shouldn’t your system at least save the rest of the data?

2 replies

Userlevel 5
Badge +8

Hey @mmn, thanks for your feedback. We’re considering whether we might update this validation behavior in the future, if other valid profile identifiers (e.g. email) are provided. 

In the meantime, we’d recommend you first validate the phone # using a library like https://github.com/google/libphonenumber. If the phone # passes the isValidNumber check, you can include it as part of the payload when creating the event. If it doesn’t, you can omit the phone # and only provide an email (for example) when creating the event. 

 

Badge

Hi and thanks for the clarification.

I don’t think I’m going to do phone number validation right now, it’s out of the scope of the project.

We’ll just submit the data as we get it, and some data will be missing while we wait for you to change your validation logic.

Reply