alipay.overseas.tax.userinfo.query
Call this interface to obtain the user's ID and other data. After the merchant confirms the user's tax refund account, the merchant sends the tax refund request with UID to the tax refund agency.
Request
Service address
Environment | HTTPS request URL |
Production environment | |
Test environment |
Request parameters
Parameter | Description |
Basic parameter | |
app_id String(32) | The unique ID that is assigned by Alipay to identify an application.
|
method String(128) | Interface name
|
format String(40) | Only JSON is supported.
|
charset String(10) | The charset with which the request data are encoded, such as GBK, UTF-8, and GB2312.
|
sign_type String(10) | Sign type. RSA and RSA2 are supported. RSA2 is recommended to be used.
|
sign String(344) | The signature value
|
timestamp String(19) | The time when the request is sent. The format is yyyy-mm-dd hh:mm:ss.
|
version String(3) | The API version. The value is fixed as 1.0.
|
app_auth_token String(40) | See Overview of the app authorization for details. |
biz_content String | Collection of request parameters. JSON format. The maximum length is not limited. Except for common parameters, all other request parameters must be passed in to this parameter. |
Business parameter | |
identify_account_type String(32) | The Alipay account identifier type. Possible values include:
|
identify_account_no String(32) | The number that is used to identify an Alipay account. When the value of
|
Response
Parameter | Description |
Basic parameter | |
code String | Gateway return code, which indicates whether the request is accepted by Alipay gateway.
|
msg String | Description of the gateway return code
|
sub_code String | Processing result of the request.
|
sub_msg String | Description of the processing result of the request.
|
sign String(64) | The signature value |
Business parameter | |
user_id String(16) | User's unique Alipay user ID
|
user_name String(32) | User's name
|
logon_id String(64) | User's Alipay login account name
|
eligible Boolean(5) | This field indicates whether the user meets the conditions for receiving tax refund funds by the specified Alipay account, such as verification of user status and certification status. Possible values include:
|
eligible_msg String(100) | This field indicates that the user's status is illegal. This field is returned when
|
Error codes
Error code | Description |
ILLEGAL_ARGUMENT | The parameter is incorrect. Check each request parameter according to the API specification. |
ILLEGAL_IDENTIFY_ACCOUNT_NO | Not able to get user ID based on provided |
USER_NOT_EXIST | The user's account information cannot be retrieved. For example, the account has been signed off. |
ACCESS_FORBIDDEN | Tax refund result is unknown. The merchant doesn't sign the contract or the contract has expired. |
SYSTEM_ERROR | System is busy. |
Samples
Request sample
JAVA
AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do","app_id","your private_key","json","GBK","alipay_public_key","RSA2");
AlipayOverseasTaxUserinfoQueryRequest request = new AlipayOverseasTaxUserinfoQueryRequest(); request.setBizContent("{" + "\"identify_account_type\":\"barcode\"," + "\"identify_account_no\":\"286139798480113981\"" +
" }");
AlipayOverseasTaxUserinfoQueryResponse response = alipayClient.execute(request); if(response.isSuccess()){
System.out.println("success");
} else {
System.out.println("fail");
}
PHP
$aop = new AopClient ();
$aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do'; $aop->appId = 'your app_id';
$aop->rsaPrivateKey = 'Merchant’s private key in one line without spaces'; $aop->alipayrsaPublicKey='Alipay’s public key in one line '; $aop->apiVersion = '1.0';
$aop->signType = 'RSA2';
$aop->postCharset='GBK';
$aop->format='json';
$request = new AlipayOverseasTaxUserinfoQueryRequest (); $request->setBizContent("{" . "\"identify_account_type\":\"barcode\"," . "\"identify_account_no\":\"286139798480113981\"" .
" }");
$result = $aop->execute ( $request);
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; $resultCode = $result->$responseNode->code;
if(!empty($resultCode)&&$resultCode == 10000){
echo "success"; } else {
echo "fail"; }
.NET
IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", "app_id", "merchant_private_key", "json", "1.0", "RSA2", "alipay_public_key", "GBK", false); AlipayOverseasTaxUserinfoQueryRequest request= new AlipayOverseasTaxUserinfoQueryRequest() ; request.BizContent="{" +
"\"identify_account_type\":\"barcode\"," + "\"identify_account_no\":\"286139798480113981\"" +
" }";
AlipayOverseasTaxUserinfoQueryResponse response=client.execute(request); Console.WriteLine(response.Body);
HTTP
https://openapi.alipay.com/gateway.do?timestamp=2013-01-01 08:08:08&method=alipay.overseas.tax.userinfo.query&app_id=13892&sign_type=RSA2&sign=ERITJKEIJKJHKKKKKK KHJEREEEEEEEEEEE&version=1.0&charset=GBK&biz_content=
{
"identify_account_type":"barcode", "identify_account_no":"286139798480113981"
} //To ensure the communication channel is secure, please verify the signature return from Alipay
Response sample
JSON
{ "alipay_overseas_tax_userinfo_query_response":{
"code":"10000",
"msg":"Success",
"user_id":"2088302344321752",
"user_name":"张**",
"logon_id":"152****5010",
"eligible":false,
"eligible_msg":"REAL_NAME_UNCERTIFIED"
}
,"sign":"ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE" }
Exception sample
JSON
This sample occurs in exception situation.
{
"alipay_overseas_tax_userinfo_query_response":{
"code":"20000","msg":"Service Currently Unavailable","sub_code":"isp.unknow-error","sub_msg":"System is busy"} ,"sign":"ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"}