Antom, leading provider of tailored payment solutionsAntom, leading provider of tailored payment solutions

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

Https://globalopenapi.alipay.com/gateway.do

Test environment

https://openapi.alipaydev.com/gateway.do

Request parameters

ParameterDescription

Basic parameter

app_id

String(32) Required

The unique ID that is assigned by Alipay to identify an application.

Example:2014072300007148

method

String(128) Required

Interface name

Example:alipay.overseas.tax.userinfo.query

format

String(40)

Only JSON is supported.

Example:JSON

charset

String(10) Required

The charset with which the request data are encoded, such as GBK, UTF-8, and GB2312.

Example:UTF-8

sign_type

String(10) Required

Sign type. RSA and RSA2 are supported. RSA2 is recommended to be used.

Example:RSA2

sign 

String(344) Required

The signature value

Example:ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE

timestamp

String(19) Required

The time when the request is sent. The format is yyyy-mm-dd hh:mm:ss.

Example:2014-07-24 03:07:50

version

String(3) Required

The API version. The value is fixed as 1.0.

Example: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) Required

The Alipay account identifier type. Possible values include:

  • Barcode
  • LogonId

Example:barcode

identify_account_no

String(32) Required

The number that is used to identify an Alipay account. When the value of identify_account_type is barcode, this filed is obtained when the tax refund agency scans the user's Alipay barcode or QR code. When the value of identify_account_type is logonId, this filed is provided by the user.

Example:286139798480113981

Response

ParameterDescription

Basic parameter

code

String Required

Gateway return code, which indicates whether the request is accepted by Alipay gateway.

Example:40004

msg

String Required

Description of the gateway return code

Example:Business Failed

sub_code

String

Processing result of the request.

Example:isv.invalid-signature

sub_msg

String

Description of the processing result of the request.

Example:The transaction has been paid.

sign

String(64) Required

The signature value

Business parameter

user_id

String(16) Required

User's unique Alipay user ID

Example:2088302344321752

user_name

String(32) Required

User's name

Example:张**

logon_id

String(64) Required

User's Alipay login account name

Example:152****5010

eligible

Boolean(5) Required

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:

  • true: Indicates that the user is eligible for receiving tax refund funds by Alipay
  • false: Indicates that the user is not eligible for receiving tax refund funds by Alipay

Example:false

eligible_msg

String(100)

This field indicates that the user's status is illegal. This field is returned when eligible is false. Possible values include:

  • REAL_NAME_UNCERTIFIED: Not the real-name certified user with valid document
  • ILLEGAL_USER: Illegal user
  • USER_ACCOUNT_FREEZED: Indicates that the user's account is frozen and the process is terminated.

Example:REAL_NAME_UNCERTIFIED

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 
identify_account_no

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

copy
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

copy
$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

copy
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

copy
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

copy
{ "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.

copy
{
"alipay_overseas_tax_userinfo_query_response":{
"code":"20000","msg":"Service Currently Unavailable","sub_code":"isp.unknow-error","sub_msg":"System is busy"} ,"sign":"ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"}