TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripHotelDistributionOrderCreateRequest req = new AlitripBtripHotelDistributionOrderCreateRequest();
AlitripBtripHotelDistributionOrderCreateRequest.BtripHotelCreateOrderRq obj1 = new AlitripBtripHotelDistributionOrderCreateRequest.BtripHotelCreateOrderRq();
obj1.setBuyerName("张三");
obj1.setBuyerUniqueKey("hcdaisdhiuyd783t47");
obj1.setCheckIn(StringUtils.parseDateTime("2021-06-06 00:00:00"));
obj1.setCheckOut(StringUtils.parseDateTime("2021-06-06 00:00:00"));
obj1.setCreateOrderKey("2dsdnu93yhdasnd");
obj1.setCustomers("{}");
obj1.setDisOrderId("123456");
obj1.setEarliestArrivalTime(StringUtils.parseDateTime("2021-06-01 00:00:00"));
AlitripBtripHotelDistributionOrderCreateRequest.BtripHotelContactDto obj2 = new AlitripBtripHotelDistributionOrderCreateRequest.BtripHotelContactDto();
obj2.setEmail("123456@163.com");
obj2.setName("张三");
obj2.setPhone("18866668888");
obj1.setHotelContact(obj2);
obj1.setItemId(123456L);
obj1.setLatestArrivalTime(StringUtils.parseDateTime("2021-06-01 00:00:00"));
obj1.setNumberOfAdultsPerRoom(2L);
obj1.setRatePlanId(123456L);
obj1.setRoomNum(1L);
obj1.setSubChannel("distribution_dsndu37g");
obj1.setSupplierCode("fliggy");
obj1.setTotalPromotion(100L);
obj1.setTotalRoomPrice(200L);
obj1.setCorpPayPrice(100L);
obj1.setPersonPayPrice(100L);
req.setParamBtripHotelCreateOrderRq(obj1);
AlitripBtripHotelDistributionOrderCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripHotelDistributionOrderCreateRequest req = new AlitripBtripHotelDistributionOrderCreateRequest();
AlitripBtripHotelDistributionOrderCreateRequest.BtripHotelCreateOrderRqDomain obj1 = new AlitripBtripHotelDistributionOrderCreateRequest.BtripHotelCreateOrderRqDomain();
obj1.BuyerName = "张三";
obj1.BuyerUniqueKey = "hcdaisdhiuyd783t47";
obj1.CheckIn = DateTime.Parse(2021-06-06 00:00:00");
obj1.CheckOut = DateTime.Parse(2021-06-06 00:00:00");
obj1.CreateOrderKey = "2dsdnu93yhdasnd";
obj1.Customers = "{}";
obj1.DisOrderId = "123456";
obj1.EarliestArrivalTime = DateTime.Parse(2021-06-01 00:00:00");
AlitripBtripHotelDistributionOrderCreateRequest.BtripHotelContactDtoDomain obj2 = new AlitripBtripHotelDistributionOrderCreateRequest.BtripHotelContactDtoDomain();
obj2.Email = "123456@163.com";
obj2.Name = "张三";
obj2.Phone = "18866668888";
obj1.HotelContact= obj2;
obj1.ItemId = 123456L;
obj1.LatestArrivalTime = DateTime.Parse(2021-06-01 00:00:00");
obj1.NumberOfAdultsPerRoom = 2L;
obj1.RatePlanId = 123456L;
obj1.RoomNum = 1L;
obj1.SubChannel = "distribution_dsndu37g";
obj1.SupplierCode = "fliggy";
obj1.TotalPromotion = 100L;
obj1.TotalRoomPrice = 200L;
obj1.CorpPayPrice = 100L;
obj1.PersonPayPrice = 100L;
req.ParamBtripHotelCreateOrderRq_ = obj1;
AlitripBtripHotelDistributionOrderCreateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripHotelDistributionOrderCreateRequest;
$param_btrip_hotel_create_order_rq = new BtripHotelCreateOrderRq;
$param_btrip_hotel_create_order_rq->buyer_name="张三";
$param_btrip_hotel_create_order_rq->buyer_unique_key="hcdaisdhiuyd783t47";
$param_btrip_hotel_create_order_rq->check_in="2021-06-06 00:00:00";
$param_btrip_hotel_create_order_rq->check_out="2021-06-06 00:00:00";
$param_btrip_hotel_create_order_rq->create_order_key="2dsdnu93yhdasnd";
$param_btrip_hotel_create_order_rq->customers="{}";
$param_btrip_hotel_create_order_rq->dis_order_id="123456";
$param_btrip_hotel_create_order_rq->earliest_arrival_time="2021-06-01 00:00:00";
$hotel_contact = new BtripHotelContactDto;
$hotel_contact->email="123456@163.com";
$hotel_contact->name="张三";
$hotel_contact->phone="18866668888";
$param_btrip_hotel_create_order_rq->hotel_contact = $hotel_contact;
$param_btrip_hotel_create_order_rq->item_id="123456";
$param_btrip_hotel_create_order_rq->latest_arrival_time="2021-06-01 00:00:00";
$param_btrip_hotel_create_order_rq->number_of_adults_per_room="2";
$param_btrip_hotel_create_order_rq->rate_plan_id="123456";
$param_btrip_hotel_create_order_rq->room_num="1";
$param_btrip_hotel_create_order_rq->sub_channel="distribution_dsndu37g";
$param_btrip_hotel_create_order_rq->supplier_code="fliggy";
$param_btrip_hotel_create_order_rq->total_promotion="100";
$param_btrip_hotel_create_order_rq->total_room_price="200";
$param_btrip_hotel_create_order_rq->corp_pay_price="100";
$param_btrip_hotel_create_order_rq->person_pay_price="100";
$req->setParamBtripHotelCreateOrderRq(json_encode($param_btrip_hotel_create_order_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.hotel.distribution.order.create' \
-d 'partner_id=apidoc' \
-d 'session=25c53f7f-40d7-4eec-815f-909a630f9d23' \
-d 'sign=322B1EF1BC901895A8C9CC7C9005E4A7' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-04+01%3A25%3A05' \
-d 'v=2.0' \
-d 'param_btrip_hotel_create_order_rq=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripHotelDistributionOrderCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param_btrip_hotel_create_order_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.hotel.distribution.order.create");
add_param(pRequest,"param_btrip_hotel_create_order_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.hotel.distribution.order.create', {
'param_btrip_hotel_create_order_rq':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})