Incorrect error response when editing the phone number of a wallet/user

Hey guys, this error almost drive me to insanity for the last couple of hours and I wanted to share it here in case somebody else has the same issue.

If you edit a wallet (endpoint: /v1/user, weirdly enough) and in your body you include the field phone_numer:

      ewallet: 'ewallet_821c0b02dcbb41d88795291976b56ce8',
      first_name: 'Test',
      last_name: 'User',
      phone_number: '+393317241899'

Sometimes you get an error message like this:

The request attempted an operation that requires a phone number, but the phone number was missing or not recognized. The request was rejected. Corrective action: Use the correct number in E.164 format.

This is misleading and the reason I lost 2 hours thinking our Rest client was sending something wrong, you see, the phone_number is not missing and it is in fact in E.164. So why?, well if you have another user in your platform with the same number the editing wallet is trying to add, you receive this error, instead of the duplicate number error you get when you try to do the same thing but in creation instead of editing.

Before somebody says, “well you need to check the duplicity in your end before pushing it to Rapyd”, yes we will, but during development is quite common that data is not in sync or you lose an asset or two, so it is very possible you end up in a situation like ours.

1 Like

Thanks for bringing this to our attention. I apologize for the confusion in the documentation that led you down this path - we have just fixed it and the change is live right now. In summary, email and phone_number are deprecated fields at the root of REST requests - this data is supposed to go in the contact.

If you run into any other odd behavior, please let us know and we will help as soon as we can.