/v1/customers/user/inquiryUserInfoByAccessToken

POST /v1/customers/user/inquiryUserInfoByAccessToken

The inquiryUserInfoByAccessToken API is used for merchant side to get the user related information after obtain user authorization.

Message structure

Request

Property

Data type

Required

Description

accessTokenString 

Yes

An access token that can be used to access the user resource scope.

Max. length: 128 characters.

extendInfoString 

No

The extend information,wallet and merchant can put extend info here.

Max. length: 4096 characters.

Response

Property

Data type

Required

Description

resultResult

Yes

The request result, which contains information related to the request result, such as status and error codes.

userInfo

OpenUserInfo

User open information.

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, that means user information inquiry is successful, merchant can use the accessToken to access the corresponding user resource scope.
  • If the value of result.resultStatus is F, that means user information inquiry is failed, the failed reason can refer to result code param.
  • If the value of result.resultStatus is U, that means unknown exception occur on wallet side, merchant may try again.

Result

NoresultStatusresultCoderesultMessage

1

SSUCCESSSuccess.

2

UUNKNOWN_EXCEPTIONAn API calling is failed, which is caused by unknown reasons.

3

UREQUEST_TRAFFIC_EXCEED_LIMITThe request traffic exceeds the limit.

4

FPROCESS_FAILA general business failure occurred. Don't retry.

5

FPARAM_ILLEGALIllegal parameters exist. For example, a non-numeric input, or an invalid date.

6

FACCESS_DENIEDThe access is denied.

7

FINVALID_APIThe called API is invalid or not active.

8

FINVALID_ACCESS_TOKENThe access token is invalid.

9

FINVALID_AUTH_CLIENTThe auth client id is invalid. 

10

FEXPIRED_ACCESS_TOKENThe access token is expired.

11

F

EXPIRED_AGENT_TOKEN

The access token of mini program is expired.

12

F

INVALID_AGENT_TOKEN

The access token of mini program is invalid.

Sample

Query user info via access token,the access token is generated via OAuth after authorization is successful.

/v1/customers/user/inquiryUserInfoByAccessToken
  1. Merchant calls /v1/customers/user/inquiryUserInfoByAccessToken interface with access token (Step 1)
  2. Wallet server returns user information the to merchant based on the access token (Step 2).

Request

copy
{
    "accessToken": "20210727hUCT6YdB5bWaJ33BSHrcAU0HL5GNOw6YitvhrdI7zwn0880603106508",
    "extendInfo": "{\"customerBelongsTo\":\"TNG\"}"
}
  • extendInfo, includes key - customerBelongsTo the e-wallet that the customer uses. Corresponding to the field 'siteName' that obtained from the API 'my.getSiteInfo', in the Mini Program scenario this is mandatory.

Response

copy
{
    "result": {
        "resultCode": "SUCCESS",
        "resultMessage": "Success.",
        "resultStatus": "S"
    },
    "userInfo": {
        "userId": "1000000935800000"
    }
}