TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripInvoiceSettingRuleRequest req = new AlitripBtripInvoiceSettingRuleRequest();
AlitripBtripInvoiceSettingRuleRequest.OpenInvoiceRuleRq obj1 = new AlitripBtripInvoiceSettingRuleRequest.OpenInvoiceRuleRq();
obj1.setAllEmploye(true);
obj1.setCorpId("corpid1");
List<AlitripBtripInvoiceSettingRuleRequest.Entity> list3 = new ArrayList<AlitripBtripInvoiceSettingRuleRequest.Entity>();
AlitripBtripInvoiceSettingRuleRequest.Entity obj4 = new AlitripBtripInvoiceSettingRuleRequest.Entity();
list3.add(obj4);
obj4.setId("123");
obj4.setName("张三");
obj4.setType(1L);
obj1.setEntities(list3);
obj1.setThirdPartId("i123");
obj1.setVersion(2L);
req.setRq(obj1);
AlitripBtripInvoiceSettingRuleResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripInvoiceSettingRuleRequest req = new AlitripBtripInvoiceSettingRuleRequest();
AlitripBtripInvoiceSettingRuleRequest.OpenInvoiceRuleRqDomain obj1 = new AlitripBtripInvoiceSettingRuleRequest.OpenInvoiceRuleRqDomain();
obj1.AllEmploye = true;
obj1.CorpId = "corpid1";
List<AlitripBtripInvoiceSettingRuleRequest.EntityDomain> list3 = new List<AlitripBtripInvoiceSettingRuleRequest.EntityDomain>();
AlitripBtripInvoiceSettingRuleRequest.EntityDomain obj4 = new AlitripBtripInvoiceSettingRuleRequest.EntityDomain();
list3.Add(obj4);
obj4.Id = "123";
obj4.Name = "张三";
obj4.Type = 1L;
obj1.Entities= list3;
obj1.ThirdPartId = "i123";
obj1.Version = 2L;
req.Rq_ = obj1;
AlitripBtripInvoiceSettingRuleResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripInvoiceSettingRuleRequest;
$rq = new OpenInvoiceRuleRq;
$rq->all_employe="true";
$rq->corp_id="corpid1";
$entities = new Entity;
$entities->id="123";
$entities->name="张三";
$entities->type="1";
$rq->entities = $entities;
$rq->third_part_id="i123";
$rq->version="2";
$req->setRq(json_encode($rq));
$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=alitrip.btrip.invoice.setting.rule' \
-d 'partner_id=apidoc' \
-d 'session=3524a9f2-809f-484a-b002-d8471904e1ca' \
-d 'sign=34A148D8A78BDA8E8D0AEB5CE7D7386E' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-04+01%3A16%3A24' \
-d 'v=2.0' \
-d 'rq=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripInvoiceSettingRuleRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.rq=""
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,"alitrip.btrip.invoice.setting.rule");
add_param(pRequest,"rq","数据结构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('alitrip.btrip.invoice.setting.rule', {
'rq':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})