Get a user by phone
GET/svc/ts/api/v1/openapi/user/phone
Look up a user by phone number. The response shape matches GET /api/v1/openapi/user.
Lookup logic
- Resolve the user ID in the wonder users database by
x-p-business-id+calling_code+phone_number, joining users, oauth2_clients, platforms, and phones. - Look up an existing binding in the treasury
external_userstable (p_business_id+p_user_id). Return it when found. - When
external_usershas no row, fill the response in real time (read-only, no write): phone and calling code come from the internal user service, document fields come from the internal KYC service, andissuing_countryis converted from the KYC alpha-3 code to alpha-2. Fields that cannot be filled arenull.
Notes
- A leading
+is stripped fromcalling_code(+86and%2B86are both treated as86). datais a single object{user_id, user}. When the user is not bound,user.id,user.reference_id, anduser.p_created_atarenull.
Error codes (all HTTP 400)
500011Invalid parameter (business ID, calling_code, or phone_number is empty)500012Data not found (no user for this phone number under the platform)500999Unknown error (wonder user database query failed)500998Internal server error (external_users query failed)
Request
Responses
- 200
Query succeeded. data is a single external user object, with the same shape as GET /api/v1/openapi/user.