TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripTravelHotelticketOrderCreateRequest req = new AlitripTravelHotelticketOrderCreateRequest();
req.setExtendParamsString("{\"example\": \"例子\"}");
req.setOrderId("5435342");
req.setFailMsg("重复下单");
AlitripTravelHotelticketOrderCreateRequest.HotelTicketVoucherDTO obj1 = new AlitripTravelHotelticketOrderCreateRequest.HotelTicketVoucherDTO();
obj1.setCode("t1234");
obj1.setAvailableNums(2L);
obj1.setCertificateId("11234234");
obj1.setType(1L);
obj1.setUrl("//image");
obj1.setCanUse(true);
obj1.setUsageNums(0L);
obj1.setBizType(1L);
req.setVouchers(obj1);
req.setStatus(1L);
req.setFliggyOrderId("TB1234");
AlitripTravelHotelticketOrderCreateResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripTravelHotelticketOrderCreateRequest req = new AlitripTravelHotelticketOrderCreateRequest();
req.ExtendParams = "{\"example\": \"例子\"}";
req.OrderId = "5435342";
req.FailMsg = "重复下单";
AlitripTravelHotelticketOrderCreateRequest.HotelTicketVoucherDTODomain obj1 = new AlitripTravelHotelticketOrderCreateRequest.HotelTicketVoucherDTODomain();
obj1.Code = "t1234";
obj1.AvailableNums = 2L;
obj1.CertificateId = "11234234";
obj1.Type = 1L;
obj1.Url = "//image";
obj1.CanUse = true;
obj1.UsageNums = 0L;
obj1.BizType = 1L;
req.Vouchers_ = obj1;
req.Status = 1L;
req.FliggyOrderId = "TB1234";
AlitripTravelHotelticketOrderCreateResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripTravelHotelticketOrderCreateRequest;
$req->setExtendParams("{\"example\": \"例子\"}");
$req->setOrderId("5435342");
$req->setFailMsg("重复下单");
$vouchers = new HotelTicketVoucherDTO;
$vouchers->code="t1234";
$vouchers->available_nums="2";
$vouchers->certificate_id="11234234";
$vouchers->type="1";
$vouchers->url="//image";
$vouchers->can_use="true";
$vouchers->usage_nums="0";
$vouchers->biz_type="1";
$req->setVouchers(json_encode($vouchers));
$req->setStatus("1");
$req->setFliggyOrderId("TB1234");
$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=alitrip.travel.hotelticket.order.create' \
-d 'partner_id=apidoc' \
-d 'sign=DD1AB3F67E3FC98306A7E74033A7A871' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-05+02%3A52%3A35' \
-d 'v=2.0' \
-d 'extend_params=%7B%5C%22example%5C%22%3A+%5C%22%E4%BE%8B%E5%AD%90%5C%22%7D' \
-d 'fail_msg=%E9%87%8D%E5%A4%8D%E4%B8%8B%E5%8D%95' \
-d 'fliggy_order_id=TB1234' \
-d 'order_id=5435342' \
-d 'status=1' \
-d 'vouchers=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripTravelHotelticketOrderCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.extend_params="{\"example\": \"例子\"}"
req.order_id="5435342"
req.fail_msg="重复下单"
req.vouchers="[]"
req.status=1
req.fliggy_order_id="TB1234"
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,"alitrip.travel.hotelticket.order.create");
add_param(pRequest,"extend_params","{\"example\": \"例子\"}");
add_param(pRequest,"order_id","5435342");
add_param(pRequest,"fail_msg","重复下单");
add_param(pRequest,"vouchers","数据结构JSON示例");
add_param(pRequest,"status","1");
add_param(pRequest,"fliggy_order_id","TB1234");
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('alitrip.travel.hotelticket.order.create', {
'extend_params':'{\"example\": \"例子\"}',
'order_id':'5435342',
'fail_msg':'重复下单',
'vouchers':'数据结构JSON示例',
'status':'1',
'fliggy_order_id':'TB1234'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})