TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelFastinvoiceRequestRequest req = new XhotelFastinvoiceRequestRequest();
XhotelFastinvoiceRequestRequest.InvoiceInfoParam obj1 = new XhotelFastinvoiceRequestRequest.InvoiceInfoParam();
obj1.setPostType(0L);
obj1.setShortIdNumber("6211");
obj1.setRequestId("1234xxx");
obj1.setPlanInvoiceRoomPrice(10000L);
obj1.setCompanyTitle("未来酒店有限公司");
obj1.setRoomNum("501");
obj1.setInvoiceType(1L);
obj1.setWantTime("2017-01-01 12:01:01");
obj1.setPlanInvoiceOtherPrice(5000L);
obj1.setUserNick("zhangsan");
obj1.setTaxNum("10001991");
obj1.setUserChannel(1L);
obj1.setOutOrderNum("22323321");
XhotelFastinvoiceRequestRequest.ValueAddedInfo obj2 = new XhotelFastinvoiceRequestRequest.ValueAddedInfo();
obj2.setRegisterAddr("杭州市余杭区和睦路1号");
obj2.setAccountNo("60012121");
obj2.setOpeningBank("中国人民银行");
obj2.setTaxNo("12234342");
obj2.setTel("0571-21222223");
obj1.setValueAddedInfo(obj2);
req.setInvoiceInfoParam(obj1);
XhotelFastinvoiceRequestResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelFastinvoiceRequestRequest req = new XhotelFastinvoiceRequestRequest();
XhotelFastinvoiceRequestRequest.InvoiceInfoParamDomain obj1 = new XhotelFastinvoiceRequestRequest.InvoiceInfoParamDomain();
obj1.PostType = 0L;
obj1.ShortIdNumber = "6211";
obj1.RequestId = "1234xxx";
obj1.PlanInvoiceRoomPrice = 10000L;
obj1.CompanyTitle = "未来酒店有限公司";
obj1.RoomNum = "501";
obj1.InvoiceType = 1L;
obj1.WantTime = "2017-01-01 12:01:01";
obj1.PlanInvoiceOtherPrice = 5000L;
obj1.UserNick = "zhangsan";
obj1.TaxNum = "10001991";
obj1.UserChannel = 1L;
obj1.OutOrderNum = "22323321";
XhotelFastinvoiceRequestRequest.ValueAddedInfoDomain obj2 = new XhotelFastinvoiceRequestRequest.ValueAddedInfoDomain();
obj2.RegisterAddr = "杭州市余杭区和睦路1号";
obj2.AccountNo = "60012121";
obj2.OpeningBank = "中国人民银行";
obj2.TaxNo = "12234342";
obj2.Tel = "0571-21222223";
obj1.ValueAddedInfo= obj2;
req.InvoiceInfoParam_ = obj1;
XhotelFastinvoiceRequestResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelFastinvoiceRequestRequest;
$invoice_info_param = new InvoiceInfoParam;
$invoice_info_param->post_type="0";
$invoice_info_param->short_id_number="6211";
$invoice_info_param->request_id="1234xxx";
$invoice_info_param->plan_invoice_room_price="10000";
$invoice_info_param->company_title="未来酒店有限公司";
$invoice_info_param->room_num="501";
$invoice_info_param->invoice_type="1";
$invoice_info_param->want_time="2017-01-01 12:01:01";
$invoice_info_param->plan_invoice_other_price="5000";
$invoice_info_param->user_nick="zhangsan";
$invoice_info_param->tax_num="10001991";
$invoice_info_param->user_channel="1";
$invoice_info_param->out_order_num="22323321";
$value_added_info = new ValueAddedInfo;
$value_added_info->register_addr="杭州市余杭区和睦路1号";
$value_added_info->account_no="60012121";
$value_added_info->opening_bank="中国人民银行";
$value_added_info->tax_no="12234342";
$value_added_info->tel="0571-21222223";
$invoice_info_param->value_added_info = $value_added_info;
$req->setInvoiceInfoParam(json_encode($invoice_info_param));
$resp = $c->execute($req);
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.xhotel.fastinvoice.request' \
-d 'partner_id=apidoc' \
-d 'sign=6FB34111DAC850A1152DFA4A995B4BC9' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-04+01%3A18%3A03' \
-d 'v=2.0' \
-d 'invoice_info_param=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelFastinvoiceRequestRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.invoice_info_param=""
try:
resp= req.getResponse()
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.xhotel.fastinvoice.request");
add_param(pRequest,"invoice_info_param","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,NULL);
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.xhotel.fastinvoice.request', {
'invoice_info_param':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})