inquiryUserInfo
Use the inquiryUserInfo API to query basic user information after the user authentication and authorization through an account authorization process. Merchants can use the user information to determine whether to perform the account binding process and other related operations. If merchants decide to reject the account binding, merchants need to revoke the account binding process by using the revoke interface.
Request parameters
accessToken String REQUIRED
An access token that can be used to access the user resource scope. The value of this field must be identical to that of accessToken in the Access Token Application interface.
More information:
- Maximum length: 128 characters
Response parameters
result Result REQUIRED
The request result, which contains information related to the request result, such as status and error codes.
userId String
The unique account ID of the user, which can be the internal account ID of the payment service provider or Alipay account ID.
More information:
- Maximum length: 64 characters
userLoginId String
More information:
- Maximum length: 64 characters
hashUserLoginId String
An MD5 hashed version of the userLoginId. Whether or not this field is returned depends on the PMP or wallet's capability.
Note: PMP, payment method provider, is an organization that processes payment services and other value-added services on behalf of the payer.
More information:
- Maximum length: 64 characters
Request
Response
More information
This section gives additional information about this interface and certain parameters. See the following list for details:
- The returned fields in the response are determined by the scope that is authorized by the user during the authorization process. Merchants need to pass the desired scope when calling the consult interface to retrieve user information that are allowed to be shared by PMP. The scopes field defined in the consult interface determines the returned fields of this interface with the following these rules:
- When the value of scopes is
BASE_USER_INFO
, only userId is returned. - When the value of scopes is
USER_INFO
, additional user information is returned on top of userId, such as userLoginId and hashUserLoginId. - When the value of scopes is
AGREEMENT_PAY
, no user information is authorized to be shared. - hashUserLoginId:
Not all payment methods can return this information due to local regulations and compliance requirement even if the scope is correct. If the merchant has a desire to leverage this information, contact Alipay technical support for more details.
When the value of userLoginId is a mobile phone number, the phone number needs to use E.164 formatting. E.164 phone number format is +{country code}{area code with leading 0 removed}{number}. For example, +14154567899 is a US mobile phone number with country code as 1, area code as 415 and local number as 4567899. A UK mobile phone number (020) 4455 5666 in E.164 formatting is +442044555666, where 44 is the country code for UK and the leading 0 is removed from the area code 020. Therefore, the value of hashUserLoginId is going to be a hashed value of +442044555666.
Result process logic
For different request results, different actions are to be performed. See the following list for details:
- If the value of result.resultStatus is
S
, the inquiryUserInfo request is successful. - If the value of result.resultStatus is
F
orU
, retry the process.
Result/Error codes
Code | Value | Message |
---|---|---|
SUCCESS | S | Success |
INVALID_ACCESS_TOKEN | F | Invalid access token |
PARAM_ILLEGAL | F | Illegal parameters exist. For example, a non-numeric input, or an invalid date. |
PROCESS_FAIL | F | A general business failure occurred. Do not retry. |
KEY_NOT_FOUND | F | The key is not found. |
ACCESS_DENIED | F | Access denied |
REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. |
API_INVALID | F | API is invalid or not active. |
CLIENT_INVALID | F | The client is invalid. |
INVALID_SIGNATURE | F | The signature is invalid. |
METHOD_NOT_SUPPORTED | F | The server does not implement the requested HTTP method. |
MEDIA_TYPE_NOT_ACCEPTABLE | F | The server does not implement the media type that is acceptable to the client. |
UNKNOWN_EXCEPTION | U | An API calling is failed, which is caused by unknown reasons. |