TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
BusInvoiceReturnRequest req = new BusInvoiceReturnRequest();
BusInvoiceReturnRequest.ReceiptDo obj1 = new BusInvoiceReturnRequest.ReceiptDo();
obj1.setAgentId(123456L);
obj1.setReceiptDateTime(StringUtils.parseDateTime("2019-11-01 00:00:00"));
obj1.setReceiptNumber("M112323");
obj1.setReceiptStatus(1L);
obj1.setReceiptUrl("http://ip:port/test");
obj1.setFailReason("sys-error");
obj1.setFailCode("系统异常");
req.setInvoiceParam(obj1);
BusInvoiceReturnResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
BusInvoiceReturnRequest req = new BusInvoiceReturnRequest();
BusInvoiceReturnRequest.ReceiptDoDomain obj1 = new BusInvoiceReturnRequest.ReceiptDoDomain();
obj1.AgentId = 123456L;
obj1.ReceiptDateTime = DateTime.Parse(2019-11-01 00:00:00");
obj1.ReceiptNumber = "M112323";
obj1.ReceiptStatus = 1L;
obj1.ReceiptUrl = "http://ip:port/test";
obj1.FailReason = "sys-error";
obj1.FailCode = "系统异常";
req.InvoiceParam_ = obj1;
BusInvoiceReturnResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new BusInvoiceReturnRequest;
$invoice_param = new ReceiptDo;
$invoice_param->agent_id="123456";
$invoice_param->receipt_date_time="2019-11-01 00:00:00";
$invoice_param->receipt_number="M112323";
$invoice_param->receipt_status="1";
$invoice_param->receipt_url="http://ip:port/test";
$invoice_param->fail_reason="sys-error";
$invoice_param->fail_code="系统异常";
$req->setInvoiceParam(json_encode($invoice_param));
$resp = $c->execute($req, $sessionKey);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=taobao.bus.invoice.return' \
-d 'partner_id=apidoc' \
-d 'session=db8b271b-b03c-462f-ad0b-20e24bef4004' \
-d 'sign=512A53D161B286172A1F5308EA32C6C9' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-29+18%3A23%3A33' \
-d 'v=2.0' \
-d 'invoice_param=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.BusInvoiceReturnRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.invoice_param=""
try:
resp= req.getResponse(sessionkey)
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"taobao.bus.invoice.return");
add_param(pRequest,"invoice_param","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,sessionKey);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('taobao.bus.invoice.return', {
'invoice_param':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})