Skip to main content

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​

  1. 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.
  2. Look up an existing binding in the treasury external_users table (p_business_id + p_user_id). Return it when found.
  3. When external_users has 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, and issuing_country is converted from the KYC alpha-3 code to alpha-2. Fields that cannot be filled are null.

Notes​

  • A leading + is stripped from calling_code (+86 and %2B86 are both treated as 86).
  • data is a single object {user_id, user}. When the user is not bound, user.id, user.reference_id, and user.p_created_at are null.

Error codes (all HTTP 400)​

  • 500011 Invalid parameter (business ID, calling_code, or phone_number is empty)
  • 500012 Data not found (no user for this phone number under the platform)
  • 500999 Unknown error (wonder user database query failed)
  • 500998 Internal server error (external_users query failed)

Request​

Responses​

Query succeeded. data is a single external user object, with the same shape as GET /api/v1/openapi/user.

Response Headers