文档中心 > API类目 > 国际机票政策API

taobao.alitrip.it.fare.update (【国际机票自有政策】单条修改)

自有政策修改接口,可以根据fareId或outId修改,outId不唯一时,不能用outId修改。当外部政策id、出发城市、到达城市、出票航司任一有变化,或往返时是否允许混舱、文件编号、可混文件编号任一有变化,将删除老数据,产生一条新政策。

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
extendAttributes String 可选 {} json格式的字符串,扩展属性,预留
fareId Number 可选 1 运价id,单条新增成功时返回运价id,fareId和outId必填一个,fareId优先
fareJson String 必须 {"ticketingAirline":"CA","saleAirline":"CA","addressOption":"城市","tripType":"直达","originLand":"SHA,BJS","destination":"HKG,SHA","cabin":"N","restrictFlightNo":"","excludeFlightNo":"","validDate4Dep":"2015-05-30~2015-11-30","flightDateRestrict4Dep":"12","saleDate":"2015-05-30~2015-11-30","adultPassengerIdentity":"普通","ticketPrice":2000,"childPrice":"1980","returnPoint":1.0,"adjustMoney":0,"refundRule":"费","reissueRule":"费","noshowRule":"改期","luggageRule":"100"} 自有政策json序列化字符串,具体属性视fareType的类型,和addow或addrt接口的请求参数一致,如:{"ticketingAirline":"CA","saleAirline":"CA","addressOption":"城市","tripType":"直达","originLand":"SHA,BJS","destination":"HKG,SHA","cabin":"N","restrictFlightNo":"","excludeFlightNo":"","validDate4Dep":"2015-05-30~2015-11-30","flightDateRestrict4Dep":"12","saleDate":"2015-05-30~2015-11-30","adultPassengerIdentity":"普通","ticketPrice":2000,"childPrice":"1980","returnPoint":1.0,"adjustMoney":0,"refundRule":"收取80000元退票费","reissueRule":"收取20%改期费","noshowRule":"起飞前不得退票,不得改期","luggageRule":"逾重行李费用为每公斤100元"}
fareType Number 必须 1 运价类型,1单程 2往返
outId String 可选 1 外部id,为新增时请求参数中的外部政策id

响应参数

名称 类型 示例值 描述
extend_attributes String {} json格式的字符串,扩展属性,预留
fare_id Number 1 运价id,根据更新的内容,此id可能会重新生成

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripItFareUpdateRequest req = new AlitripItFareUpdateRequest();
req.setExtendAttributes("{}");
req.setFareId(1L);
req.setFareJson("{\"ticketingAirline\":\"CA\",\"saleAirline\":\"CA\",\"addressOption\":\"城市\",\"tripType\":\"直达\",\"originLand\":\"SHA,BJS\",\"destination\":\"HKG,SHA\",\"cabin\":\"N\",\"restrictFlightNo\":\"\",\"excludeFlightNo\":\"\",\"validDate4Dep\":\"2015-05-30~2015-11-30\",\"flightDateRestrict4Dep\":\"12\",\"saleDate\":\"2015-05-30~2015-11-30\",\"adultPassengerIdentity\":\"普通\",\"ticketPrice\":2000,\"childPrice\":\"1980\",\"returnPoint\":1.0,\"adjustMoney\":0,\"refundRule\":\"费\",\"reissueRule\":\"费\",\"noshowRule\":\"改期\",\"luggageRule\":\"100\"}");
req.setFareType(1L);
req.setOutId("1");
AlitripItFareUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alitrip_it_fare_update_response>
    <extend_attributes>{}</extend_attributes>
    <fare_id>1</fare_id>
</alitrip_it_fare_update_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部