TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelInvoiceCreateRequest req = new XhotelInvoiceCreateRequest();
req.setName("张三");
req.setIdcard("123456x");
req.setOutOid("123456x");
req.setVendor("chinaonline");
req.setOutHid("ABCDE");
req.setInvoice("{}");
XhotelInvoiceCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelInvoiceCreateRequest req = new XhotelInvoiceCreateRequest();
req.Name = "张三";
req.Idcard = "123456x";
req.OutOid = "123456x";
req.Vendor = "chinaonline";
req.OutHid = "ABCDE";
req.Invoice = "{}";
XhotelInvoiceCreateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelInvoiceCreateRequest;
$req->setName("张三");
$req->setIdcard("123456x");
$req->setOutOid("123456x");
$req->setVendor("chinaonline");
$req->setOutHid("ABCDE");
$req->setInvoice("{}");
$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.xhotel.invoice.create' \
-d 'partner_id=apidoc' \
-d 'session=d08acce5-331c-4ade-9c7d-43c2a41ed12a' \
-d 'sign=6A55BFA92C0AB460A349D53A70BC3DB3' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-04+01%3A38%3A15' \
-d 'v=2.0' \
-d 'idcard=123456x' \
-d 'invoice=%7B%7D' \
-d 'name=%E5%BC%A0%E4%B8%89' \
-d 'out_hid=ABCDE' \
-d 'out_oid=123456x' \
-d 'vendor=chinaonline'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelInvoiceCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.name="张三"
req.idcard="123456x"
req.out_oid="123456x"
req.vendor="chinaonline"
req.out_hid="ABCDE"
req.invoice="{}"
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.xhotel.invoice.create");
add_param(pRequest,"name","张三");
add_param(pRequest,"idcard","123456x");
add_param(pRequest,"out_oid","123456x");
add_param(pRequest,"vendor","chinaonline");
add_param(pRequest,"out_hid","ABCDE");
add_param(pRequest,"invoice","{}");
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.xhotel.invoice.create', {
'name':'张三',
'idcard':'123456x',
'out_oid':'123456x',
'vendor':'chinaonline',
'out_hid':'ABCDE',
'invoice':'{}'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})