TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripFlightRefundCreateRequest req = new AlitripFlightRefundCreateRequest();
AlitripFlightRefundCreateRequest.RefundCreateReq obj1 = new AlitripFlightRefundCreateRequest.RefundCreateReq();
obj1.setOrderId(3960040419329L);
List<AlitripFlightRefundCreateRequest.FlightRefundGroupParam> list3 = new ArrayList<AlitripFlightRefundCreateRequest.FlightRefundGroupParam>();
AlitripFlightRefundCreateRequest.FlightRefundGroupParam obj4 = new AlitripFlightRefundCreateRequest.FlightRefundGroupParam();
list3.add(obj4);
List<AlitripFlightRefundCreateRequest.RefundPassengerFeeParam> list7 = new ArrayList<AlitripFlightRefundCreateRequest.RefundPassengerFeeParam>();
AlitripFlightRefundCreateRequest.RefundPassengerFeeParam obj8 = new AlitripFlightRefundCreateRequest.RefundPassengerFeeParam();
list7.add(obj8);
obj8.setPassengerName("森春");
obj8.setCredentialNo("41272519880923829X");
obj8.setAllRefundFee(1000L);
list5.setPassengerFeeParamList(list7);
AlitripFlightRefundCreateRequest.RefundFlightItemParam obj10 = new AlitripFlightRefundCreateRequest.RefundFlightItemParam();
List<AlitripFlightRefundCreateRequest.FlightJourneyParam> list12 = new ArrayList<AlitripFlightRefundCreateRequest.FlightJourneyParam>();
AlitripFlightRefundCreateRequest.FlightJourneyParam obj13 = new AlitripFlightRefundCreateRequest.FlightJourneyParam();
list12.add(obj13);
List<AlitripFlightRefundCreateRequest.FlightSegmentParam> list16 = new ArrayList<AlitripFlightRefundCreateRequest.FlightSegmentParam>();
AlitripFlightRefundCreateRequest.FlightSegmentParam obj17 = new AlitripFlightRefundCreateRequest.FlightSegmentParam();
list16.add(obj17);
obj17.setDepAirportCode("PEK");
obj17.setFlightNo("MU3439");
obj17.setArrAirportCode("SHA");
obj17.setDepDate("2022-09-01 09:22:12");
list14.setSegmentParamList(list16);
obj10.setFlightJourneyParamList(list12);
list9.setFlightItemParam(obj10);
obj4.setRefundAttachmentUrls("");
obj4.setRefundApplyType(2L);
obj4.setRefundApplyReason("航司取消航班");
obj1.setRefundGroupParamList(list3);
req.setRefundCreateReq(obj1);
AlitripFlightRefundCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripFlightRefundCreateRequest req = new AlitripFlightRefundCreateRequest();
AlitripFlightRefundCreateRequest.RefundCreateReqDomain obj1 = new AlitripFlightRefundCreateRequest.RefundCreateReqDomain();
obj1.OrderId = 3960040419329L;
List<AlitripFlightRefundCreateRequest.FlightRefundGroupParamDomain> list3 = new List<AlitripFlightRefundCreateRequest.FlightRefundGroupParamDomain>();
AlitripFlightRefundCreateRequest.FlightRefundGroupParamDomain obj4 = new AlitripFlightRefundCreateRequest.FlightRefundGroupParamDomain();
list3.Add(obj4);
List<AlitripFlightRefundCreateRequest.RefundPassengerFeeParamDomain> list6 = new List<AlitripFlightRefundCreateRequest.RefundPassengerFeeParamDomain>();
AlitripFlightRefundCreateRequest.RefundPassengerFeeParamDomain obj7 = new AlitripFlightRefundCreateRequest.RefundPassengerFeeParamDomain();
list6.Add(obj7);
obj7.PassengerName = "森春";
obj7.CredentialNo = "41272519880923829X";
obj7.AllRefundFee = 1000L;
obj4.PassengerFeeParamList= list6;
AlitripFlightRefundCreateRequest.RefundFlightItemParamDomain obj8 = new AlitripFlightRefundCreateRequest.RefundFlightItemParamDomain();
List<AlitripFlightRefundCreateRequest.FlightJourneyParamDomain> list10 = new List<AlitripFlightRefundCreateRequest.FlightJourneyParamDomain>();
AlitripFlightRefundCreateRequest.FlightJourneyParamDomain obj11 = new AlitripFlightRefundCreateRequest.FlightJourneyParamDomain();
list10.Add(obj11);
List<AlitripFlightRefundCreateRequest.FlightSegmentParamDomain> list13 = new List<AlitripFlightRefundCreateRequest.FlightSegmentParamDomain>();
AlitripFlightRefundCreateRequest.FlightSegmentParamDomain obj14 = new AlitripFlightRefundCreateRequest.FlightSegmentParamDomain();
list13.Add(obj14);
obj14.DepAirportCode = "PEK";
obj14.FlightNo = "MU3439";
obj14.ArrAirportCode = "SHA";
obj14.DepDate = "2022-09-01 09:22:12";
obj11.SegmentParamList= list13;
obj8.FlightJourneyParamList= list10;
obj4.FlightItemParam= obj8;
obj4.RefundAttachmentUrls = "";
obj4.RefundApplyType = 2L;
obj4.RefundApplyReason = "航司取消航班";
obj1.RefundGroupParamList= list3;
req.RefundCreateReq_ = obj1;
AlitripFlightRefundCreateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripFlightRefundCreateRequest;
$refund_create_req = new RefundCreateReq;
$refund_create_req->order_id="3960040419329";
$refund_group_param_list = new FlightRefundGroupParam;
$passenger_fee_param_list = new RefundPassengerFeeParam;
$passenger_fee_param_list->passenger_name="森春";
$passenger_fee_param_list->credential_no="41272519880923829X";
$passenger_fee_param_list->all_refund_fee="1000";
$refund_group_param_list->passenger_fee_param_list = $passenger_fee_param_list;
$flight_item_param = new RefundFlightItemParam;
$flight_journey_param_list = new FlightJourneyParam;
$segment_param_list = new FlightSegmentParam;
$segment_param_list->dep_airport_code="PEK";
$segment_param_list->flight_no="MU3439";
$segment_param_list->arr_airport_code="SHA";
$segment_param_list->dep_date="2022-09-01 09:22:12";
$flight_journey_param_list->segment_param_list = $segment_param_list;
$flight_item_param->flight_journey_param_list = $flight_journey_param_list;
$refund_group_param_list->flight_item_param = $flight_item_param;
$refund_group_param_list->refund_attachment_urls="";
$refund_group_param_list->refund_apply_type="2";
$refund_group_param_list->refund_apply_reason="航司取消航班";
$refund_create_req->refund_group_param_list = $refund_group_param_list;
$req->setRefundCreateReq(json_encode($refund_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.flight.refund.create' \
-d 'partner_id=apidoc' \
-d 'session=b95550b0-29fd-4245-b949-1fbae52cf7a5' \
-d 'sign=48F1712763122629454EFF2F7FD3065A' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-01-30+12%3A56%3A12' \
-d 'v=2.0' \
-d 'refund_create_req=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripFlightRefundCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.refund_create_req="数据结构示例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.flight.refund.create");
add_param(pRequest,"refund_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.flight.refund.create', {
'refund_create_req':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})