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

alipay.overseas.tax.order.query

Call this interface to query the status of an Alipay tax refund order.

Request

Service address

Environment

HTTPS request URL

Production environment

Https://globalopenapi.alipay.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.order.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

out_order_no

String(64) Required

The unique serial number that is assigned by tax refund organization to identify a tax refund order. The length of each serial number ranges from 3-64 bitsand only numbers and English characters can be passed.

Example:0005520171122115751

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

out_order_no

String(64) Required

The unique serial number that is assigned by tax refund organization to identify a tax refund order. The length of each serial number ranges from 3-64 bitsand only numbers and English characters can be passed.

Example:0005520171122115751

tax_no

String(64) Required

A unique serial number that is assigned by Alipay to identify a tax refund order.

Example:2017113000384435

status

String(1) Required

The tax refund status. Possible values include:

  • S: Success
  • F: Fail

Example:S

identify_account_type

String(32) Required

The Alipay account identifier type. Possible values include:

  • Barcode
  • Mobile

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 mobile, this field is the Alipay user's mobile phone number.

When the value of identify_account_type is barcode, this field is obtained when the tax refund agency scans the user's Alipay barcode or QR code.

Example:286139798480113981

success_time

Date(20)

The time when the tax refund succeeds. The field is returned only when status is S. The time is in GMT+8and in a yyyy-mm-dd hh:mm:ss format.

Example:2017-11-15 11:23:04

Error codes

Error code

Description

ILLEGAL_ARGUMENT

The parameter is incorrect. Check each request parameter according to the API specification.

TAX_REFUND_RESULT_UNKNOWN

The tax refund status is unknown.

SYSTEM_ERROR

The query result is unknown. The 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");
AlipayOverseasTaxOrderQueryRequest request = new AlipayOverseasTaxOrderQueryRequest(); request.setBizContent("{" +
"\"out_order_no\":\"0005520171122115751\"" +
" }");
AlipayOverseasTaxOrderQueryResponse response = alipayClient.execute(request); if(response.isSuccess()){
System.out.println("Call succeed");
} else {
System.out.println("Call failed");
}

PHP

copy
$aop = new AopClient ();
$aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do'; $aop->appId = 'your app_id';
$aop->rsaPrivateKey = 'Fill in the developer's private key, one line'; $aop->alipayrsaPublicKey='Fill in the alipay_public_key_file, one line'; $aop->apiVersion = '1.0';
$aop->signType = 'RSA2';
$aop->postCharset='GBK';
$aop->format='json';
$request = new AlipayOverseasTaxOrderQueryRequest (); $request->setBizContent("{" . "\"out_order_no\":\"0005520171122115751\"" .
" }");
$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); AlipayOverseasTaxOrderQueryRequest request= new AlipayOverseasTaxOrderQueryRequest() ; request.BizContent="{" +
"\"out_order_no\":\"0005520171122115751\"" +
" }";
AlipayOverseasTaxOrderQueryResponse response=client.execute(request); Console.WriteLine(response.Body);
HTTP edition:
https://openapi.alipay.com/gateway.do?timestamp=2013-01-01 08:08:08&method=alipay.overseas.tax.order.query&app_id=5097&sign_type=RSA2&sign=ERITJKEIJKJHKKKKKKKHJ EREEEEEEEEEEE&version=1.0&biz_content=
{ "out_order_no":"0005520171122115751"
}
// To ensure secure communication, verify whether the sign value in the response example is provided by Ant Financial.
Response sample
JSON edition:
{ "alipay_overseas_tax_order_query_response":{
"code":"10000",
"msg":"Success",
"out_order_no":"0005520171122115751",
"tax_no":"2017113000384435",
"status":"S",
"identify_account_type":"barcode",
"identify_account_no":"286139798480113981",
"success_time":"2017-11-15 11:23:04"
}
,"sign":"ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}

Exception sample

JSON

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