文档中心 > API类目 > 国内机票京杭API

alitrip.flight.itinerary.apply (申请开票)

申请开票

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
itinerary_apply_request ItineraryApplyRequest 必须 请求。注意:1.只有已出行的订单才能开行程单,即已过了航线的起飞时间。2.开票成功(开票查询接口反参status为5)后一天左右邮箱里可收到行程单 3.开票的费用项里只能开enable_apply_itinerary为true的
  • itinerary_fee_list
  • ItineraryFee []
  • 必须
  • []
  • 开票的费用项,注意这里要在渲染结果的基础上,增加itineraryTitle,itineraryType,taxNo
  • └ fee_count
  • Number
  • 可选
  • 1
  • 费用项数量
  • └ invoice_amount
  • String
  • 可选
  • 100
  • 可开金额(单位:分)
  • └ fee_total_amount
  • String
  • 可选
  • 100
  • 费用总金额(单位:分)
  • └ applied_amount
  • String
  • 可选
  • 100
  • 已申请金额(单位:分)
  • └ fee_unique_id
  • String
  • 必须
  • 355574768880_58080543733175_1
  • 费用唯一Id-如果是合并的则展示feeUniqueId$feeUniqueId$feeUniqueId
  • └ fee_name
  • String
  • 可选
  • 机票款凭证
  • 费用名称
  • └ enable_apply_itinerary
  • Boolean
  • 可选
  • true
  • 是否能开行程单
  • └ invoice_item_name
  • String
  • 可选
  • 代订机票费
  • 发票项名称
  • └ currency_code
  • String
  • 可选
  • CNY
  • 币种
  • └ itinerary_title
  • String
  • 必须
  • 杭州xxx科技有限公司
  • 公司全称,杭州xxx公司
  • └ itinerary_type
  • Number
  • 必须
  • 0
  • 发票类型,0:企业 1:个人
  • └ tax_no
  • String
  • 必须
  • 91500000747150347A
  • 税号
  • └ order_id
  • Number
  • 必须
  • 213123
  • 生单反参的订单号
  • └ apply_request_id
  • String
  • 必须
  • 8adf4f38-1efd-4719-a48e-018f7eafdb8f-13175
  • 发票申请单id,来自渲染反参
  • └ email
  • String
  • 必须
  • xxxx@qq.com
  • 接收行程单的邮箱

响应参数

名称 类型 示例值 描述
order_id Number 7125712 生单反参的订单号
is_success Boolean true 是否成功。为true只代表申请的请求通过了即状态为申请中,不代表申请开票的结果成功了。申请状态可以在申请查询接口中看。status为4的代表申请中,5代表申请成功。一天时间左右邮箱里会收到行程单的邮件
error_code_info String INPUT_PARAM_ERROR 错误码
itinerary_id_list Number [] 发票单id
error_msg String 入参错误 错误信息
apply_request_id String 8adf4f38-1efd-4719-a48e-018f7eafdb8f-13175 发票申请单id

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripFlightItineraryApplyRequest req = new AlitripFlightItineraryApplyRequest();
AlitripFlightItineraryApplyRequest.ItineraryApplyRequest obj1 = new AlitripFlightItineraryApplyRequest.ItineraryApplyRequest();
List<AlitripFlightItineraryApplyRequest.ItineraryFee> list3 = new ArrayList<AlitripFlightItineraryApplyRequest.ItineraryFee>();
AlitripFlightItineraryApplyRequest.ItineraryFee obj4 = new AlitripFlightItineraryApplyRequest.ItineraryFee();
list3.add(obj4);
obj4.setFeeCount(1L);
obj4.setInvoiceAmount("100");
obj4.setFeeTotalAmount("100");
obj4.setAppliedAmount("100");
obj4.setFeeUniqueId("355574768880_58080543733175_1");
obj4.setFeeName("机票款凭证");
obj4.setEnableApplyItinerary(true);
obj4.setInvoiceItemName("代订机票费");
obj4.setCurrencyCode("CNY");
obj4.setItineraryTitle("杭州xxx科技有限公司");
obj4.setItineraryType(0L);
obj4.setTaxNo("91500000747150347A");
obj1.setItineraryFeeList(list3);
obj1.setOrderId(213123L);
obj1.setApplyRequestId("8adf4f38-1efd-4719-a48e-018f7eafdb8f-13175");
obj1.setEmail("xxxx@qq.com");
req.setItineraryApplyRequest(obj1);
AlitripFlightItineraryApplyResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alitrip_flight_itinerary_apply_response>
    <order_id>7125712</order_id>
    <is_success>true</is_success>
    <error_code_info>INPUT_PARAM_ERROR</error_code_info>
    <error_msg>入参错误</error_msg>
    <apply_request_id>8adf4f38-1efd-4719-a48e-018f7eafdb8f-13175</apply_request_id>
</alitrip_flight_itinerary_apply_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

返回
顶部