TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripFlightDistributionOrderCreateRequest req = new AlitripBtripFlightDistributionOrderCreateRequest();
AlitripBtripFlightDistributionOrderCreateRequest.BtripFlightCreateOrderRq obj1 = new AlitripBtripFlightDistributionOrderCreateRequest.BtripFlightCreateOrderRq();
obj1.setArrCityCode("BJS");
obj1.setAsyncCreateOrderMode(false);
obj1.setAutoPay("false");
obj1.setBuyerName("张三");
obj1.setBuyerUniqueKey("008784");
AlitripBtripFlightDistributionOrderCreateRequest.ContactInfoDto obj2 = new AlitripBtripFlightDistributionOrderCreateRequest.ContactInfoDto();
obj2.setContactEmail("hanqiao.123@163.com");
obj2.setContactName("李四");
obj2.setContactPhone("13488888888");
obj1.setContactInfo(obj2);
obj1.setDepCityCode("HGH");
obj1.setDepDate("2021-07-01");
List<AlitripBtripFlightDistributionOrderCreateRequest.BookFlightSegmentDto> list4 = new ArrayList<AlitripBtripFlightDistributionOrderCreateRequest.BookFlightSegmentDto>();
AlitripBtripFlightDistributionOrderCreateRequest.BookFlightSegmentDto obj5 = new AlitripBtripFlightDistributionOrderCreateRequest.BookFlightSegmentDto();
list4.add(obj5);
obj5.setArrAirportCode("PEK");
obj5.setArrCityCode("BJS");
obj5.setCabin("Y");
obj5.setDepAirportCode("HGH");
obj5.setDepCityCode("HGH");
obj5.setDepDate("2021-08-01");
obj5.setFlightNo("CZ2001");
obj5.setPrice(500L);
obj5.setSegmentNumber("00");
obj5.setSegSecretParams("HJGWYUG42387237478293784287346782637854623SDGF");
obj5.setInvoiceType(2L);
obj1.setFlightSegmentList(list4);
obj1.setOrderAttr("{\"outId\":\"0011\"}");
obj1.setPrice(500L);
obj1.setReceiptAddress("杭州乐佳国际");
obj1.setReceiptTarget(1L);
obj1.setReceiptTitle("阿里商旅公司");
obj1.setOrderParams("2YI3UY42Y387459827348RUIUWEHRWE");
obj1.setSubChannel("distributecorp001");
List<AlitripBtripFlightDistributionOrderCreateRequest.TravelerInfo> list7 = new ArrayList<AlitripBtripFlightDistributionOrderCreateRequest.TravelerInfo>();
AlitripBtripFlightDistributionOrderCreateRequest.TravelerInfo obj8 = new AlitripBtripFlightDistributionOrderCreateRequest.TravelerInfo();
list7.add(obj8);
obj8.setBirthday("2000-01-01");
obj8.setCertNo("3453453466");
obj8.setCertType("1");
obj8.setName("章三");
obj8.setPhone("123987682354");
obj8.setType("AUT");
obj8.setUserId("uid");
obj8.setSex("0");
obj8.setCertValidDate("2024-09-08");
obj8.setCertIssueCountry("中国大陆");
obj8.setNationality("中国大陆");
obj8.setNationalityCode("CN");
obj1.setTravelerInfoList(list7);
obj1.setTripType(0L);
obj1.setDisOrderId("testorder001");
req.setParamBtripFlightCreateOrderRq(obj1);
AlitripBtripFlightDistributionOrderCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripFlightDistributionOrderCreateRequest req = new AlitripBtripFlightDistributionOrderCreateRequest();
AlitripBtripFlightDistributionOrderCreateRequest.BtripFlightCreateOrderRqDomain obj1 = new AlitripBtripFlightDistributionOrderCreateRequest.BtripFlightCreateOrderRqDomain();
obj1.ArrCityCode = "BJS";
obj1.AsyncCreateOrderMode = false;
obj1.AutoPay = "false";
obj1.BuyerName = "张三";
obj1.BuyerUniqueKey = "008784";
AlitripBtripFlightDistributionOrderCreateRequest.ContactInfoDtoDomain obj2 = new AlitripBtripFlightDistributionOrderCreateRequest.ContactInfoDtoDomain();
obj2.ContactEmail = "hanqiao.123@163.com";
obj2.ContactName = "李四";
obj2.ContactPhone = "13488888888";
obj1.ContactInfo= obj2;
obj1.DepCityCode = "HGH";
obj1.DepDate = "2021-07-01";
List<AlitripBtripFlightDistributionOrderCreateRequest.BookFlightSegmentDtoDomain> list4 = new List<AlitripBtripFlightDistributionOrderCreateRequest.BookFlightSegmentDtoDomain>();
AlitripBtripFlightDistributionOrderCreateRequest.BookFlightSegmentDtoDomain obj5 = new AlitripBtripFlightDistributionOrderCreateRequest.BookFlightSegmentDtoDomain();
list4.Add(obj5);
obj5.ArrAirportCode = "PEK";
obj5.ArrCityCode = "BJS";
obj5.Cabin = "Y";
obj5.DepAirportCode = "HGH";
obj5.DepCityCode = "HGH";
obj5.DepDate = "2021-08-01";
obj5.FlightNo = "CZ2001";
obj5.Price = 500L;
obj5.SegmentNumber = "00";
obj5.SegSecretParams = "HJGWYUG42387237478293784287346782637854623SDGF";
obj5.InvoiceType = 2L;
obj1.FlightSegmentList= list4;
obj1.OrderAttr = "{\"outId\":\"0011\"}";
obj1.Price = 500L;
obj1.ReceiptAddress = "杭州乐佳国际";
obj1.ReceiptTarget = 1L;
obj1.ReceiptTitle = "阿里商旅公司";
obj1.OrderParams = "2YI3UY42Y387459827348RUIUWEHRWE";
obj1.SubChannel = "distributecorp001";
List<AlitripBtripFlightDistributionOrderCreateRequest.TravelerInfoDomain> list7 = new List<AlitripBtripFlightDistributionOrderCreateRequest.TravelerInfoDomain>();
AlitripBtripFlightDistributionOrderCreateRequest.TravelerInfoDomain obj8 = new AlitripBtripFlightDistributionOrderCreateRequest.TravelerInfoDomain();
list7.Add(obj8);
obj8.Birthday = "2000-01-01";
obj8.CertNo = "3453453466";
obj8.CertType = "1";
obj8.Name = "章三";
obj8.Phone = "123987682354";
obj8.Type = "AUT";
obj8.UserId = "uid";
obj8.Sex = "0";
obj8.CertValidDate = "2024-09-08";
obj8.CertIssueCountry = "中国大陆";
obj8.Nationality = "中国大陆";
obj8.NationalityCode = "CN";
obj1.TravelerInfoList= list7;
obj1.TripType = 0L;
obj1.DisOrderId = "testorder001";
req.ParamBtripFlightCreateOrderRq_ = obj1;
AlitripBtripFlightDistributionOrderCreateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripFlightDistributionOrderCreateRequest;
$param_btrip_flight_create_order_rq = new BtripFlightCreateOrderRq;
$param_btrip_flight_create_order_rq->arr_city_code="BJS";
$param_btrip_flight_create_order_rq->async_create_order_mode="false";
$param_btrip_flight_create_order_rq->auto_pay="false";
$param_btrip_flight_create_order_rq->buyer_name="张三";
$param_btrip_flight_create_order_rq->buyer_unique_key="008784";
$contact_info = new ContactInfoDto;
$contact_info->contact_email="hanqiao.123@163.com";
$contact_info->contact_name="李四";
$contact_info->contact_phone="13488888888";
$param_btrip_flight_create_order_rq->contact_info = $contact_info;
$param_btrip_flight_create_order_rq->dep_city_code="HGH";
$param_btrip_flight_create_order_rq->dep_date="2021-07-01";
$flight_segment_list = new BookFlightSegmentDto;
$flight_segment_list->arr_airport_code="PEK";
$flight_segment_list->arr_city_code="BJS";
$flight_segment_list->cabin="Y";
$flight_segment_list->dep_airport_code="HGH";
$flight_segment_list->dep_city_code="HGH";
$flight_segment_list->dep_date="2021-08-01";
$flight_segment_list->flight_no="CZ2001";
$flight_segment_list->price="500";
$flight_segment_list->segment_number="00";
$flight_segment_list->seg_secret_params="HJGWYUG42387237478293784287346782637854623SDGF";
$flight_segment_list->invoice_type="2";
$param_btrip_flight_create_order_rq->flight_segment_list = $flight_segment_list;
$param_btrip_flight_create_order_rq->order_attr="{\"outId\":\"0011\"}";
$param_btrip_flight_create_order_rq->price="500";
$param_btrip_flight_create_order_rq->receipt_address="杭州乐佳国际";
$param_btrip_flight_create_order_rq->receipt_target="1";
$param_btrip_flight_create_order_rq->receipt_title="阿里商旅公司";
$param_btrip_flight_create_order_rq->order_params="2YI3UY42Y387459827348RUIUWEHRWE";
$param_btrip_flight_create_order_rq->sub_channel="distributecorp001";
$traveler_info_list = new TravelerInfo;
$traveler_info_list->birthday="2000-01-01";
$traveler_info_list->cert_no="3453453466";
$traveler_info_list->cert_type="1";
$traveler_info_list->name="章三";
$traveler_info_list->phone="123987682354";
$traveler_info_list->type="AUT";
$traveler_info_list->user_id="uid";
$traveler_info_list->sex="0";
$traveler_info_list->cert_valid_date="2024-09-08";
$traveler_info_list->cert_issue_country="中国大陆";
$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->trip_type="0";
$param_btrip_flight_create_order_rq->dis_order_id="testorder001";
$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.create' \
-d 'partner_id=apidoc' \
-d 'session=00635111-b1f8-46de-89da-42b3e8d029b8' \
-d 'sign=CCEFE5033A3EF3617FA8BC03133A5829' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+19%3A43%3A10' \
-d 'v=2.0' \
-d 'param_btrip_flight_create_order_rq=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripFlightDistributionOrderCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param_btrip_flight_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.flight.distribution.order.create");
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.create', {
'param_btrip_flight_create_order_rq':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})