TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripFlightDistributionOrderNewcreateRequest req = new AlitripBtripFlightDistributionOrderNewcreateRequest();
AlitripBtripFlightDistributionOrderNewcreateRequest.BtripFlightCreateOrderRq obj1 = new AlitripBtripFlightDistributionOrderNewcreateRequest.BtripFlightCreateOrderRq();
obj1.setDepCityCode("BJS");
obj1.setArrCityCode("HGH");
obj1.setDepAirportCode("BJS");
obj1.setArrAirportCode("HGH");
obj1.setDepDate(StringUtils.parseDateTime("2000-01-01 00:00:00"));
AlitripBtripFlightDistributionOrderNewcreateRequest.ContactInfoDTO obj2 = new AlitripBtripFlightDistributionOrderNewcreateRequest.ContactInfoDTO();
obj2.setContactName("张三");
obj2.setContactEmail("demo");
obj2.setContactPhone("demo");
obj1.setContactInfo(obj2);
List<AlitripBtripFlightDistributionOrderNewcreateRequest.TravelerInfo> list4 = new ArrayList<AlitripBtripFlightDistributionOrderNewcreateRequest.TravelerInfo>();
AlitripBtripFlightDistributionOrderNewcreateRequest.TravelerInfo obj5 = new AlitripBtripFlightDistributionOrderNewcreateRequest.TravelerInfo();
list4.add(obj5);
obj5.setType("1");
obj5.setName("张三");
obj5.setCertType("1");
obj5.setCertNo("demo");
obj5.setUserId("demo");
obj5.setPhone("13425671927");
obj5.setBirthday("1995-01-25");
obj5.setCertValidDate("2025-03-01");
obj5.setCertNation("中国大陆");
obj5.setSex("1");
obj5.setNationality("中国大陆");
obj5.setNationalityCode("CN");
obj1.setTravelerInfoList(list4);
obj1.setOrderParams("demo");
obj1.setOrderAttr("{\"outId\":1231}");
obj1.setAutoPay("1");
obj1.setBuyerUniqueKey("0291111");
obj1.setDisOrderId("jianhang123");
obj1.setOtaItemId("demo");
obj1.setTripType(1L);
obj1.setPrice(10000L);
obj1.setReceiptTarget(1L);
obj1.setReceiptTitle("demo");
obj1.setReceiptAddress("demo");
obj1.setSubChannel("jianhang");
obj1.setBuyerName("demo");
req.setParamBtripFlightCreateOrderRq(obj1);
AlitripBtripFlightDistributionOrderNewcreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripFlightDistributionOrderNewcreateRequest req = new AlitripBtripFlightDistributionOrderNewcreateRequest();
AlitripBtripFlightDistributionOrderNewcreateRequest.BtripFlightCreateOrderRqDomain obj1 = new AlitripBtripFlightDistributionOrderNewcreateRequest.BtripFlightCreateOrderRqDomain();
obj1.DepCityCode = "BJS";
obj1.ArrCityCode = "HGH";
obj1.DepAirportCode = "BJS";
obj1.ArrAirportCode = "HGH";
obj1.DepDate = DateTime.Parse(2000-01-01 00:00:00");
AlitripBtripFlightDistributionOrderNewcreateRequest.ContactInfoDTODomain obj2 = new AlitripBtripFlightDistributionOrderNewcreateRequest.ContactInfoDTODomain();
obj2.ContactName = "张三";
obj2.ContactEmail = "demo";
obj2.ContactPhone = "demo";
obj1.ContactInfo= obj2;
List<AlitripBtripFlightDistributionOrderNewcreateRequest.TravelerInfoDomain> list4 = new List<AlitripBtripFlightDistributionOrderNewcreateRequest.TravelerInfoDomain>();
AlitripBtripFlightDistributionOrderNewcreateRequest.TravelerInfoDomain obj5 = new AlitripBtripFlightDistributionOrderNewcreateRequest.TravelerInfoDomain();
list4.Add(obj5);
obj5.Type = "1";
obj5.Name = "张三";
obj5.CertType = "1";
obj5.CertNo = "demo";
obj5.UserId = "demo";
obj5.Phone = "13425671927";
obj5.Birthday = "1995-01-25";
obj5.CertValidDate = "2025-03-01";
obj5.CertNation = "中国大陆";
obj5.Sex = "1";
obj5.Nationality = "中国大陆";
obj5.NationalityCode = "CN";
obj1.TravelerInfoList= list4;
obj1.OrderParams = "demo";
obj1.OrderAttr = "{\"outId\":1231}";
obj1.AutoPay = "1";
obj1.BuyerUniqueKey = "0291111";
obj1.DisOrderId = "jianhang123";
obj1.OtaItemId = "demo";
obj1.TripType = 1L;
obj1.Price = 10000L;
obj1.ReceiptTarget = 1L;
obj1.ReceiptTitle = "demo";
obj1.ReceiptAddress = "demo";
obj1.SubChannel = "jianhang";
obj1.BuyerName = "demo";
req.ParamBtripFlightCreateOrderRq_ = obj1;
AlitripBtripFlightDistributionOrderNewcreateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripFlightDistributionOrderNewcreateRequest;
$param_btrip_flight_create_order_rq = new BtripFlightCreateOrderRq;
$param_btrip_flight_create_order_rq->dep_city_code="BJS";
$param_btrip_flight_create_order_rq->arr_city_code="HGH";
$param_btrip_flight_create_order_rq->dep_airport_code="BJS";
$param_btrip_flight_create_order_rq->arr_airport_code="HGH";
$param_btrip_flight_create_order_rq->dep_date="2000-01-01 00:00:00";
$contact_info = new ContactInfoDTO;
$contact_info->contact_name="张三";
$contact_info->contact_email="demo";
$contact_info->contact_phone="demo";
$param_btrip_flight_create_order_rq->contact_info = $contact_info;
$traveler_info_list = new TravelerInfo;
$traveler_info_list->type="1";
$traveler_info_list->name="张三";
$traveler_info_list->cert_type="1";
$traveler_info_list->cert_no="demo";
$traveler_info_list->user_id="demo";
$traveler_info_list->phone="13425671927";
$traveler_info_list->birthday="1995-01-25";
$traveler_info_list->cert_valid_date="2025-03-01";
$traveler_info_list->cert_nation="中国大陆";
$traveler_info_list->sex="1";
$traveler_info_list->nationality="中国大陆";
$traveler_info_list->nationality_code="CN";
$param_btrip_flight_create_order_rq->traveler_info_list = $traveler_info_list;
$param_btrip_flight_create_order_rq->order_params="demo";
$param_btrip_flight_create_order_rq->order_attr="{\"outId\":1231}";
$param_btrip_flight_create_order_rq->auto_pay="1";
$param_btrip_flight_create_order_rq->buyer_unique_key="0291111";
$param_btrip_flight_create_order_rq->dis_order_id="jianhang123";
$param_btrip_flight_create_order_rq->ota_item_id="demo";
$param_btrip_flight_create_order_rq->trip_type="1";
$param_btrip_flight_create_order_rq->price="10000";
$param_btrip_flight_create_order_rq->receipt_target="1";
$param_btrip_flight_create_order_rq->receipt_title="demo";
$param_btrip_flight_create_order_rq->receipt_address="demo";
$param_btrip_flight_create_order_rq->sub_channel="jianhang";
$param_btrip_flight_create_order_rq->buyer_name="demo";
$req->setParamBtripFlightCreateOrderRq(json_encode($param_btrip_flight_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.flight.distribution.order.newcreate' \
-d 'partner_id=apidoc' \
-d 'session=13e7916c-e63f-4b9c-90e2-18807ad8bc2b' \
-d 'sign=03617AA563D9593F93FC498455B13B7B' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+19%3A47%3A35' \
-d 'v=2.0' \
-d 'param_btrip_flight_create_order_rq=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripFlightDistributionOrderNewcreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param_btrip_flight_create_order_rq="数据结构示例JSON格式"
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.flight.distribution.order.newcreate");
add_param(pRequest,"param_btrip_flight_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.flight.distribution.order.newcreate', {
'param_btrip_flight_create_order_rq':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})