TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelCommoninvoiceUpdateRequest req = new XhotelCommoninvoiceUpdateRequest();
XhotelCommoninvoiceUpdateRequest.CommonInvoiceInfo obj1 = new XhotelCommoninvoiceUpdateRequest.CommonInvoiceInfo();
obj1.setInvoiceAttr(0L);
obj1.setPhone("13812345678");
obj1.setEmail("zhangsan@taobao.com");
obj1.setUserNick("zhangsan");
obj1.setInvoiceType(1L);
obj1.setCompanyTitle("浙江未来酒店");
XhotelCommoninvoiceUpdateRequest.ValueAddedInfo obj2 = new XhotelCommoninvoiceUpdateRequest.ValueAddedInfo();
obj2.setTaxNo("12234342");
obj2.setAccountNo("60012121");
obj2.setRegisterAddr("杭州市余杭区和睦路1号");
obj2.setTel("0571-12132232");
obj2.setOpeningBank("中国人民银行");
obj1.setValueAddedInfo(obj2);
obj1.setInvoiceId(12234L);
req.setCommonInvoiceInfoParam(obj1);
XhotelCommoninvoiceUpdateResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelCommoninvoiceUpdateRequest req = new XhotelCommoninvoiceUpdateRequest();
XhotelCommoninvoiceUpdateRequest.CommonInvoiceInfoDomain obj1 = new XhotelCommoninvoiceUpdateRequest.CommonInvoiceInfoDomain();
obj1.InvoiceAttr = 0L;
obj1.Phone = "13812345678";
obj1.Email = "zhangsan@taobao.com";
obj1.UserNick = "zhangsan";
obj1.InvoiceType = 1L;
obj1.CompanyTitle = "浙江未来酒店";
XhotelCommoninvoiceUpdateRequest.ValueAddedInfoDomain obj2 = new XhotelCommoninvoiceUpdateRequest.ValueAddedInfoDomain();
obj2.TaxNo = "12234342";
obj2.AccountNo = "60012121";
obj2.RegisterAddr = "杭州市余杭区和睦路1号";
obj2.Tel = "0571-12132232";
obj2.OpeningBank = "中国人民银行";
obj1.ValueAddedInfo= obj2;
obj1.InvoiceId = 12234L;
req.CommonInvoiceInfoParam_ = obj1;
XhotelCommoninvoiceUpdateResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelCommoninvoiceUpdateRequest;
$common_invoice_info_param = new CommonInvoiceInfo;
$common_invoice_info_param->invoice_attr="0";
$common_invoice_info_param->phone="13812345678";
$common_invoice_info_param->email="zhangsan@taobao.com";
$common_invoice_info_param->user_nick="zhangsan";
$common_invoice_info_param->invoice_type="1";
$common_invoice_info_param->company_title="浙江未来酒店";
$value_added_info = new ValueAddedInfo;
$value_added_info->tax_no="12234342";
$value_added_info->account_no="60012121";
$value_added_info->register_addr="杭州市余杭区和睦路1号";
$value_added_info->tel="0571-12132232";
$value_added_info->opening_bank="中国人民银行";
$common_invoice_info_param->value_added_info = $value_added_info;
$common_invoice_info_param->invoice_id="12234";
$req->setCommonInvoiceInfoParam(json_encode($common_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.commoninvoice.update' \
-d 'partner_id=apidoc' \
-d 'sign=BB6753325B01DC9C7C91791025ABE049' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+15%3A55%3A47' \
-d 'v=2.0' \
-d 'common_invoice_info_param=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelCommoninvoiceUpdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.common_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.commoninvoice.update");
add_param(pRequest,"common_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.commoninvoice.update', {
'common_invoice_info_param':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})