文档中心 > API类目 > 电子发票

alibaba.einvoice.apply.get (开票申请数据获取接口)

ERP获取开票申请数据

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
platform_tid String 必须 221123114243242 平台订单号
apply_id String 可选 klsfj39kkhs9A 开票申请ID,跟消息中的apply_id对应,传入applyId后,只会返回一条开票申请消息
biz_type String 可选 fenxiao 支持分销体系,供应商查询分销商的开票申请,分销体系请传入fenxiao

响应参数

名称 类型 示例值 描述
is_success Boolean true success
apply_list Apply [] apply 开票明细
  • └ platform_code
  • String
  • TM
  • 电商平台代码,TB,TM,ALIPAY,JD
  • └ status
  • Number
  • 1
  • 开票申请状态,0=已拒绝,1=申请中,2=已同意
  • └ memo
  • String
  • 我是备注
  • 买家备注
  • └ payer_name
  • String
  • 张三
  • 买家抬头
  • └ platform_tid
  • String
  • 123242323212322
  • 电商平台对应的订单号
  • └ payer_register_no
  • String
  • 9132209873843221
  • 买家税号
  • └ trigger_status
  • String
  • buyer_payed
  • 开票申请的触发类型,buyer_payed=卖家已付款,sent_goods=卖家已发货,buyer_confirm=买家确认收货,refund_seller_confirm=卖家同意退款,invoice_supply=买家申请补开发票,invoice_change=买家申请改抬头,change_paper=电换纸
  • └ invoice_kind
  • Number
  • 0
  • 发票种类,0=电子发票,1=纸质发票,2=专票,3=电子专用发票,4=全电普通发票,5=全电专用发票
  • └ business_type
  • Number
  • 0
  • 抬头类型,0=个人,1=企业
  • └ invoice_type
  • String
  • blue
  • 发票(开票)类型,蓝票blue,红票red,默认blue
  • └ invoice_amount
  • String
  • 100.00
  • 开票金额
  • └ normal_invoice_code
  • String
  • 311100111
  • 原蓝票发票代码
  • └ normal_invoice_no
  • String
  • 18203813
  • 原蓝票发票号码
  • └ sum_price
  • String
  • 90.00
  • 不含税总金额
  • └ sum_tax
  • String
  • 10.00
  • 总税额
  • invoice_items
  • InvoiceItem []
  • invoiceItem
  • 发票明细
  • └ item_name
  • String
  • 电视机
  • 发票项目名称(或商品名称)
  • └ amount
  • String
  • 100.00
  • 价税合计。(等于sumPrice和tax之和)
  • └ row_type
  • String
  • 0
  • 发票行性质。0表示正常行,1表示折扣行,2表示被折扣行。比如充电器单价100元,折扣10元,则明细为2行,充电器行性质为2,折扣行性质为1。如果充电器没有折扣,则值应为0
  • └ specification
  • String
  • X100
  • 规格型号,可选
  • └ sum_price
  • String
  • 90.00
  • 总价,格式:100.00(不含税)
  • └ tax
  • String
  • 10.00
  • 税额
  • └ price
  • String
  • 100.00
  • 单价,格式:100.00(不含税)
  • └ quantity
  • String
  • 1
  • 数量
  • └ tax_rate
  • String
  • 0.00
  • 税率。税率只能为0或0.03或0.04或0.06或0.11或0.13或0.17
  • └ unit
  • String
  • 单位
  • └ item_no
  • String
  • 10000000934728123482
  • 发票项目编号(或商品编号)
  • └ biz_order_id
  • String
  • 198738479342342
  • 淘宝子订单号
  • └ is_post_fee_row
  • Boolean
  • true
  • 是否运费行标识,true:运费行,false:非运费行
  • └ zero_rate_flag
  • String
  • 1
  • 零税率标识,0=出口零税率,1=免税,2=不征收,3=普通零税率
  • └ payer_phone
  • String
  • 010-1234567
  • 购买方联系电话
  • └ payer_address
  • String
  • 浙江省杭州市余杭区
  • 购买方地址
  • └ payer_bankaccount
  • String
  • 62003449373273384
  • 购买方开户行账号
  • └ payer_bank
  • String
  • 浙商银行
  • 购买方开户银行
  • └ gmt_modified_str
  • String
  • 2018-09-18 21:09:12
  • 发票申请修改时间
  • └ extend_props
  • String
  • {"prop1": "123", "prop2": "456"}
  • 扩展属性
  • └ gmt_create
  • String
  • 2018-09-18 21:09:10
  • 发票申请创建时间

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaEinvoiceApplyGetRequest req = new AlibabaEinvoiceApplyGetRequest();
req.setPlatformTid("221123114243242");
req.setApplyId("klsfj39kkhs9A");
req.setBizType("fenxiao");
AlibabaEinvoiceApplyGetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_einvoice_apply_get_response>
    <is_success>true</is_success>
    <apply_list>
        <apply>
            <platform_code>TM</platform_code>
            <status>1</status>
            <memo>我是备注</memo>
            <payer_name>张三</payer_name>
            <platform_tid>123242323212322</platform_tid>
            <payer_register_no>9132209873843221</payer_register_no>
            <trigger_status>buyer_payed</trigger_status>
            <invoice_kind>0</invoice_kind>
            <business_type>0</business_type>
            <invoice_type>blue</invoice_type>
            <invoice_amount>100.00</invoice_amount>
            <normal_invoice_code>311100111</normal_invoice_code>
            <normal_invoice_no>18203813</normal_invoice_no>
            <sum_price>90.00</sum_price>
            <sum_tax>10.00</sum_tax>
            <invoice_items>
                <invoice_item>
                    <item_name>电视机</item_name>
                    <amount>100.00</amount>
                    <row_type>0</row_type>
                    <specification>X100</specification>
                    <sum_price>90.00</sum_price>
                    <tax>10.00</tax>
                    <price>100.00</price>
                    <quantity>1</quantity>
                    <tax_rate>0.00</tax_rate>
                    <unit>台</unit>
                    <item_no>10000000934728123482</item_no>
                    <biz_order_id>198738479342342</biz_order_id>
                    <is_post_fee_row>true</is_post_fee_row>
                    <zero_rate_flag>1</zero_rate_flag>
                </invoice_item>
            </invoice_items>
            <payer_phone>010-1234567</payer_phone>
            <payer_address>浙江省杭州市余杭区</payer_address>
            <payer_bankaccount>62003449373273384</payer_bankaccount>
            <payer_bank>浙商银行</payer_bank>
            <gmt_modified_str>2018-09-18 21:09:12</gmt_modified_str>
            <extend_props>{&quot;prop1&quot;: &quot;123&quot;, &quot;prop2&quot;: &quot;456&quot;}</extend_props>
            <gmt_create>2018-09-18 21:09:10</gmt_create>
        </apply>
    </apply_list>
</alibaba_einvoice_apply_get_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>

错误码解释

错误码 错误描述 解决方案
isv.invalid-parameter 参数错误 调整参数重新上传
isp.system-error 系统错误 联系小二排查
isv.apply-not-exists 申请不存在,可能是延迟,订单没有申请发票,订单开票金额为0等原因 请稍后重试

API工具

如何获得此API

FAQ

返回
顶部