TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TrainAgentChangeOccupyVtwoRequest req = new TrainAgentChangeOccupyVtwoRequest();
TrainAgentChangeOccupyVtwoRequest.ChangeOccupyCallbackRQ obj1 = new TrainAgentChangeOccupyVtwoRequest.ChangeOccupyCallbackRQ();
obj1.setAgentOrderId("NO1802578604520501248");
obj1.setFliggyOrderId("abc2024061802");
obj1.setFromStationCode("SXH");
obj1.setToStationCode("KNH");
obj1.setFromStationName("上海西");
obj1.setToStationName("昆山南");
obj1.setTrainDate("2024-06-17");
obj1.setStartTime("18:41");
obj1.setEndTime("18:57");
obj1.setTrainNo("G7260");
obj1.setRunTime("16");
obj1.setTicketNo("EG35547255");
obj1.setAllTicketPrice("2100");
List<TrainAgentChangeOccupyVtwoRequest.BaguaTicketDTO> list3 = new ArrayList<TrainAgentChangeOccupyVtwoRequest.BaguaTicketDTO>();
TrainAgentChangeOccupyVtwoRequest.BaguaTicketDTO obj4 = new TrainAgentChangeOccupyVtwoRequest.BaguaTicketDTO();
list3.add(obj4);
obj4.setAgentPassengerId("1667");
obj4.setAgentSubOrderId("NT1802578604520501249");
obj4.setFliggySubOrderId("abc202406110928");
obj4.setPassengerName("xxx");
obj4.setPassengerType("1");
obj4.setCertIdNo("xxx");
obj4.setCertIdType("1");
obj4.setTicketNo("EG35547255105013A");
obj4.setTicketPrice("1200");
obj4.setSeatType("o");
obj4.setSeatNo("13A");
obj4.setCoachNo("05");
obj4.setBatchNo("1");
obj4.setCheckpoint("12");
obj1.setTickets(list3);
obj1.setResultCode("200");
obj1.setResultMsg("成功");
obj1.setSuccess(true);
obj1.setFliggyRequestId("qsa1232");
obj1.setAgentChangeApplyId("NO1739168948991684608");
obj1.setFliggyChangeApplyId("abc2024061802");
obj1.setChangeType(1L);
obj1.setChangeDiffFee("2");
obj1.setRealChangeRefundFee("2");
obj1.setChangeHandingFee("2");
obj1.setChangeHandingRate("5%");
obj1.setChangePayFee("4");
req.setParam(obj1);
TrainAgentChangeOccupyVtwoResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TrainAgentChangeOccupyVtwoRequest req = new TrainAgentChangeOccupyVtwoRequest();
TrainAgentChangeOccupyVtwoRequest.ChangeOccupyCallbackRQDomain obj1 = new TrainAgentChangeOccupyVtwoRequest.ChangeOccupyCallbackRQDomain();
obj1.AgentOrderId = "NO1802578604520501248";
obj1.FliggyOrderId = "abc2024061802";
obj1.FromStationCode = "SXH";
obj1.ToStationCode = "KNH";
obj1.FromStationName = "上海西";
obj1.ToStationName = "昆山南";
obj1.TrainDate = "2024-06-17";
obj1.StartTime = "18:41";
obj1.EndTime = "18:57";
obj1.TrainNo = "G7260";
obj1.RunTime = "16";
obj1.TicketNo = "EG35547255";
obj1.AllTicketPrice = "2100";
List<TrainAgentChangeOccupyVtwoRequest.BaguaTicketDTODomain> list3 = new List<TrainAgentChangeOccupyVtwoRequest.BaguaTicketDTODomain>();
TrainAgentChangeOccupyVtwoRequest.BaguaTicketDTODomain obj4 = new TrainAgentChangeOccupyVtwoRequest.BaguaTicketDTODomain();
list3.Add(obj4);
obj4.AgentPassengerId = "1667";
obj4.AgentSubOrderId = "NT1802578604520501249";
obj4.FliggySubOrderId = "abc202406110928";
obj4.PassengerName = "xxx";
obj4.PassengerType = "1";
obj4.CertIdNo = "xxx";
obj4.CertIdType = "1";
obj4.TicketNo = "EG35547255105013A";
obj4.TicketPrice = "1200";
obj4.SeatType = "o";
obj4.SeatNo = "13A";
obj4.CoachNo = "05";
obj4.BatchNo = "1";
obj4.Checkpoint = "12";
obj1.Tickets= list3;
obj1.ResultCode = "200";
obj1.ResultMsg = "成功";
obj1.Success = true;
obj1.FliggyRequestId = "qsa1232";
obj1.AgentChangeApplyId = "NO1739168948991684608";
obj1.FliggyChangeApplyId = "abc2024061802";
obj1.ChangeType = 1L;
obj1.ChangeDiffFee = "2";
obj1.RealChangeRefundFee = "2";
obj1.ChangeHandingFee = "2";
obj1.ChangeHandingRate = "5%";
obj1.ChangePayFee = "4";
req.Param_ = obj1;
TrainAgentChangeOccupyVtwoResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TrainAgentChangeOccupyVtwoRequest;
$param = new ChangeOccupyCallbackRQ;
$param->agent_order_id="NO1802578604520501248";
$param->fliggy_order_id="abc2024061802";
$param->from_station_code="SXH";
$param->to_station_code="KNH";
$param->from_station_name="上海西";
$param->to_station_name="昆山南";
$param->train_date="2024-06-17";
$param->start_time="18:41";
$param->end_time="18:57";
$param->train_no="G7260";
$param->run_time="16";
$param->ticket_no="EG35547255";
$param->all_ticket_price="2100";
$tickets = new BaguaTicketDTO;
$tickets->agent_passenger_id="1667";
$tickets->agent_sub_order_id="NT1802578604520501249";
$tickets->fliggy_sub_order_id="abc202406110928";
$tickets->passenger_name="xxx";
$tickets->passenger_type="1";
$tickets->cert_id_no="xxx";
$tickets->cert_id_type="1";
$tickets->ticket_no="EG35547255105013A";
$tickets->ticket_price="1200";
$tickets->seat_type="o";
$tickets->seat_no="13A";
$tickets->coach_no="05";
$tickets->batch_no="1";
$tickets->checkpoint="12";
$param->tickets = $tickets;
$param->result_code="200";
$param->result_msg="成功";
$param->success="true";
$param->fliggy_request_id="qsa1232";
$param->agent_change_apply_id="NO1739168948991684608";
$param->fliggy_change_apply_id="abc2024061802";
$param->change_type="1";
$param->change_diff_fee="2";
$param->real_change_refund_fee="2";
$param->change_handing_fee="2";
$param->change_handing_rate="5%";
$param->change_pay_fee="4";
$req->setParam(json_encode($param));
$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=taobao.train.agent.change.occupy.vtwo' \
-d 'partner_id=apidoc' \
-d 'session=5d063636-ca7a-4aa4-97cb-6656b0c2b9de' \
-d 'sign=CA3EB2C309BBEC78593CA222DB2F45A6' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-08-29+03%3A57%3A57' \
-d 'v=2.0' \
-d 'param=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TrainAgentChangeOccupyVtwoRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param="数据结构示例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,"taobao.train.agent.change.occupy.vtwo");
add_param(pRequest,"param","数据结构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('taobao.train.agent.change.occupy.vtwo', {
'param':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})