TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripXhotelChannelOrderCreateRequest req = new AlitripXhotelChannelOrderCreateRequest();
AlitripXhotelChannelOrderCreateRequest.OutSourceOrderCreateReq obj1 = new AlitripXhotelChannelOrderCreateRequest.OutSourceOrderCreateReq();
obj1.setHid(123L);
obj1.setRoomNumber(1L);
obj1.setCreateAppKey("h5");
obj1.setTagJsqr(1L);
obj1.setGid(12L);
obj1.setMemo("备注");
obj1.setRid(1L);
obj1.setTitle("标题信息");
obj1.setRpId(123L);
obj1.setOutUserId("userid");
obj1.setRateId(123L);
obj1.setSrid(123L);
obj1.setSellerId(123L);
obj1.setItemIid(123L);
obj1.setOutSource("钉钉");
obj1.setIsDirectOrder(true);
obj1.setLateArriveTime(StringUtils.parseDateTime("2020-02-20 10:00:00"));
obj1.setCheckout(StringUtils.parseDateTime("2020-02-21 10:00:00"));
obj1.setContactName("xxxxxx");
obj1.setRoomTypeName("xxxx");
obj1.setGmtCreate(StringUtils.parseDateTime("2020-02-10 10:00:00"));
obj1.setTtid("xxxxx");
obj1.setHotelName("xxx");
List<AlitripXhotelChannelOrderCreateRequest.GuestInfo> list3 = new ArrayList<AlitripXhotelChannelOrderCreateRequest.GuestInfo>();
AlitripXhotelChannelOrderCreateRequest.GuestInfo obj4 = new AlitripXhotelChannelOrderCreateRequest.GuestInfo();
list3.add(obj4);
obj4.setPersonPos("1");
obj4.setRoomPos("1");
obj4.setName("xxx");
obj1.setGuestInfoList(list3);
obj1.setCheckIn(StringUtils.parseDateTime("2020-02-20 10:00:00"));
obj1.setOutOrderId("xxxx");
obj1.setTotalRoomPrice(11111L);
List<AlitripXhotelChannelOrderCreateRequest.DailyPriceInfo> list6 = new ArrayList<AlitripXhotelChannelOrderCreateRequest.DailyPriceInfo>();
AlitripXhotelChannelOrderCreateRequest.DailyPriceInfo obj7 = new AlitripXhotelChannelOrderCreateRequest.DailyPriceInfo();
list6.add(obj7);
obj7.setBreakFastCount(2L);
obj7.setPrice(122L);
obj7.setDay(StringUtils.parseDateTime("2020-02-20 10:00:00"));
obj7.setBasePrice(1000L);
obj1.setDailyPriceInfoList(list6);
obj1.setAttributes("{\"attribute\":\"property\"}");
obj1.setContactPhone("1361212121212");
AlitripXhotelChannelOrderCreateRequest.CancelPolicy obj8 = new AlitripXhotelChannelOrderCreateRequest.CancelPolicy();
obj8.setCancelPolicyType(1L);
obj1.setCancelPolicy(obj8);
obj1.setInventoryTypeFlag(0L);
obj1.setCancelPolicyDesc("免费取消");
obj1.setPlatformPromotion(2222L);
obj1.setSellerPromotion(333333L);
req.setOutSourceOrderCreateReq(obj1);
AlitripXhotelChannelOrderCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripXhotelChannelOrderCreateRequest req = new AlitripXhotelChannelOrderCreateRequest();
AlitripXhotelChannelOrderCreateRequest.OutSourceOrderCreateReqDomain obj1 = new AlitripXhotelChannelOrderCreateRequest.OutSourceOrderCreateReqDomain();
obj1.Hid = 123L;
obj1.RoomNumber = 1L;
obj1.CreateAppKey = "h5";
obj1.TagJsqr = 1L;
obj1.Gid = 12L;
obj1.Memo = "备注";
obj1.Rid = 1L;
obj1.Title = "标题信息";
obj1.RpId = 123L;
obj1.OutUserId = "userid";
obj1.RateId = 123L;
obj1.Srid = 123L;
obj1.SellerId = 123L;
obj1.ItemIid = 123L;
obj1.OutSource = "钉钉";
obj1.IsDirectOrder = true;
obj1.LateArriveTime = DateTime.Parse(2020-02-20 10:00:00");
obj1.Checkout = DateTime.Parse(2020-02-21 10:00:00");
obj1.ContactName = "xxxxxx";
obj1.RoomTypeName = "xxxx";
obj1.GmtCreate = DateTime.Parse(2020-02-10 10:00:00");
obj1.Ttid = "xxxxx";
obj1.HotelName = "xxx";
List<AlitripXhotelChannelOrderCreateRequest.GuestInfoDomain> list3 = new List<AlitripXhotelChannelOrderCreateRequest.GuestInfoDomain>();
AlitripXhotelChannelOrderCreateRequest.GuestInfoDomain obj4 = new AlitripXhotelChannelOrderCreateRequest.GuestInfoDomain();
list3.Add(obj4);
obj4.PersonPos = "1";
obj4.RoomPos = "1";
obj4.Name = "xxx";
obj1.GuestInfoList= list3;
obj1.CheckIn = DateTime.Parse(2020-02-20 10:00:00");
obj1.OutOrderId = "xxxx";
obj1.TotalRoomPrice = 11111L;
List<AlitripXhotelChannelOrderCreateRequest.DailyPriceInfoDomain> list6 = new List<AlitripXhotelChannelOrderCreateRequest.DailyPriceInfoDomain>();
AlitripXhotelChannelOrderCreateRequest.DailyPriceInfoDomain obj7 = new AlitripXhotelChannelOrderCreateRequest.DailyPriceInfoDomain();
list6.Add(obj7);
obj7.BreakFastCount = 2L;
obj7.Price = 122L;
obj7.Day = DateTime.Parse(2020-02-20 10:00:00");
obj7.BasePrice = 1000L;
obj1.DailyPriceInfoList= list6;
obj1.Attributes = "{\"attribute\":\"property\"}";
obj1.ContactPhone = "1361212121212";
AlitripXhotelChannelOrderCreateRequest.CancelPolicyDomain obj8 = new AlitripXhotelChannelOrderCreateRequest.CancelPolicyDomain();
obj8.CancelPolicyType = 1L;
obj1.CancelPolicy= obj8;
obj1.InventoryTypeFlag = 0L;
obj1.CancelPolicyDesc = "免费取消";
obj1.PlatformPromotion = 2222L;
obj1.SellerPromotion = 333333L;
req.OutSourceOrderCreateReq_ = obj1;
AlitripXhotelChannelOrderCreateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripXhotelChannelOrderCreateRequest;
$out_source_order_create_req = new OutSourceOrderCreateReq;
$out_source_order_create_req->hid="123";
$out_source_order_create_req->room_number="1";
$out_source_order_create_req->create_app_key="h5";
$out_source_order_create_req->tag_jsqr="1";
$out_source_order_create_req->gid="12";
$out_source_order_create_req->memo="备注";
$out_source_order_create_req->rid="1";
$out_source_order_create_req->title="标题信息";
$out_source_order_create_req->rp_id="123";
$out_source_order_create_req->out_user_id="userid";
$out_source_order_create_req->rate_id="123";
$out_source_order_create_req->srid="123";
$out_source_order_create_req->seller_id="123";
$out_source_order_create_req->item_iid="123";
$out_source_order_create_req->out_source="钉钉";
$out_source_order_create_req->is_direct_order="true";
$out_source_order_create_req->late_arrive_time="2020-02-20 10:00:00";
$out_source_order_create_req->checkout="2020-02-21 10:00:00";
$out_source_order_create_req->contact_name="xxxxxx";
$out_source_order_create_req->room_type_name="xxxx";
$out_source_order_create_req->gmt_create="2020-02-10 10:00:00";
$out_source_order_create_req->ttid="xxxxx";
$out_source_order_create_req->hotel_name="xxx";
$guest_info_list = new GuestInfo;
$guest_info_list->person_pos="1";
$guest_info_list->room_pos="1";
$guest_info_list->name="xxx";
$out_source_order_create_req->guest_info_list = $guest_info_list;
$out_source_order_create_req->check_in="2020-02-20 10:00:00";
$out_source_order_create_req->out_order_id="xxxx";
$out_source_order_create_req->total_room_price="11111";
$daily_price_info_list = new DailyPriceInfo;
$daily_price_info_list->break_fast_count="2";
$daily_price_info_list->price="122";
$daily_price_info_list->day="2020-02-20 10:00:00";
$daily_price_info_list->base_price="1000";
$out_source_order_create_req->daily_price_info_list = $daily_price_info_list;
$out_source_order_create_req->attributes="{\"attribute\":\"property\"}";
$out_source_order_create_req->contact_phone="1361212121212";
$cancel_policy = new CancelPolicy;
$cancel_policy->cancel_policy_type="1";
$out_source_order_create_req->cancel_policy = $cancel_policy;
$out_source_order_create_req->inventory_type_flag="0";
$out_source_order_create_req->cancel_policy_desc="免费取消";
$out_source_order_create_req->platform_promotion="2222";
$out_source_order_create_req->seller_promotion="333333";
$req->setOutSourceOrderCreateReq(json_encode($out_source_order_create_req));
$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.xhotel.channel.order.create' \
-d 'partner_id=apidoc' \
-d 'session=6c8cc33e-857c-4132-a39b-c08300f4d611' \
-d 'sign=2FEFE000F8056DF656E85FF0E83DAAD4' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-04+01%3A36%3A51' \
-d 'v=2.0' \
-d 'out_source_order_create_req=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripXhotelChannelOrderCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.out_source_order_create_req=""
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.xhotel.channel.order.create");
add_param(pRequest,"out_source_order_create_req","数据结构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.xhotel.channel.order.create', {
'out_source_order_create_req':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})