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

alibaba.einvoice.alipay.result.get (支付宝获取电子发票开票结果)

ERP开票结果获取

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
payee_register_no String 可选 123123123123 收款方税务登记证号
platform_code String 可选 tmall 电商平台代码。TB=淘宝 、TM=天猫 、JD=京东、DD=当当、PP=拍拍、YX=易讯、EBAY=ebay、QQ=QQ网购、AMAZON=亚马逊、SN=苏宁、GM=国美、WPH=唯品会、JM=聚美、LF=乐蜂、MGJ=蘑菇街、JS=聚尚、PX=拍鞋、YT=银泰、YHD=1号店、VANCL=凡客、YL=邮乐、YG=优购、1688=阿里巴巴、POS=POS门店、OTHER=其他, (只传英文编码)
platform_tid String 可选 12132 电商平台对应的订单号
serial_no String 可选 3123123123 流水号 (serial_no)和(platform_code,platform_tid)必须填写其中一组,serial_no优先级更高
user_id String 必须 12345 卖家id
user_platform_code String 必须 ALIPAY 卖家所属平台,TB-淘宝,TM-天猫,ALIPAY-支付宝

响应参数

名称 类型 示例值 描述
invoice_result_list AlipayInvoiceResult [] 开票返回结果数据列表
  • └ anti_fake_code
  • String
  • CF6B2F6168420008
  • 防伪码
  • └ ciphertext
  • String
  • demosdffsd-32432
  • 发票密文,密码区的字符串
  • └ device_no
  • String
  • sw1231
  • 税控设备编号(新版电子发票有)
  • └ erp_tid
  • String
  • 123123
  • erp自定义单据号
  • └ file_data_type
  • String
  • jpg
  • 文件类型(pdf,jpg,png)
  • └ file_path
  • String
  • demo
  • 发票PDF的下载地址(仅在单个查询接口上显示,批量查询不显示)
  • └ invoice_amount
  • String
  • 1232.00
  • 开票金额
  • └ invoice_code
  • String
  • 1231231234
  • 发票代码
  • └ invoice_date
  • String
  • 2014-4-21
  • 开票日期
  • └ invoice_no
  • String
  • 123123
  • 发票号码
  • └ payee_register_no
  • String
  • 20150201321123
  • 收款方税务登记证号
  • └ platform_code
  • String
  • tmall
  • 电商平台代码。淘宝:taobao,天猫:tmall
  • └ platform_tid
  • String
  • 123123
  • 电商平台订单号
  • └ qr_code
  • String
  • demo
  • 二维码
  • └ serial_no
  • String
  • 123123
  • 开票流水号,唯一标志开票请求。如果两次请求流水号相同,则表示重复请求。
  • └ status
  • String
  • waiting
  • 开票状态 (waiting = 开票中) 、(create_success = 开票成功)、(create_failed = 开票失败)
  • └ biz_error_code
  • String
  • demo
  • 错误编码
  • └ biz_error_msg
  • String
  • demo
  • 错误信息
  • └ payee_phone
  • String
  • 18022229999
  • 开票方电话
  • └ payee_name
  • String
  • 海尔官方旗舰店
  • 收款方名称
  • └ invoice_type
  • String
  • blue
  • 发票(开票)类型,蓝票blue,红票red,默认blue
  • └ payer_name
  • String
  • 张三
  • 付款方名称, 对应发票title
  • invoice_items
  • InvoiceItem []
  • 发票明细
  • └ item_name
  • String
  • 冰箱
  • itemName
  • └ item_no
  • String
  • 333333
  • itemNo
  • └ price
  • String
  • 100.00
  • 单价,格式:100.00。新版电子发票,折扣行此参数不能传,非折扣行必传
  • └ quantity
  • String
  • 10
  • 数量。新版电子发票,折扣行此参数不能传,非折扣行必传
  • └ row_type
  • String
  • 1
  • rowType
  • └ specification
  • String
  • X100
  • 规格型号,可选
  • └ sum_price
  • String
  • 1.00
  • sumPrice
  • └ tax
  • String
  • 170.00
  • 税额
  • └ tax_rate
  • String
  • 0.17
  • taxRate
  • └ unit
  • String
  • 单位。新版电子发票,折扣行不能传,非折扣行必传
  • └ amount
  • String
  • 1170.00
  • 价税合计。(等于sumPrice和tax之和)
  • └ normal_invoice_code
  • String
  • 333333
  • 原发票代码
  • └ normal_invoice_no
  • String
  • 2222222
  • 原发票号码
  • └ is_retrying
  • Boolean
  • false
  • 是否重试中
  • └ sum_tax
  • String
  • 0.00
  • 税额
  • └ payer_phone
  • String
  • 010-102934
  • 购买方电话
  • └ payer_register_no
  • String
  • 91378274937948273
  • 购买方税号
  • └ payer_address
  • String
  • 杭州市文一西路969号
  • 购买方地址
  • └ payer_bankaccount
  • String
  • 网商银行 29742342
  • 购买方银行及账号
  • └ sum_price
  • String
  • 10.00
  • 不含税金额

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaEinvoiceAlipayResultGetRequest req = new AlibabaEinvoiceAlipayResultGetRequest();
req.setPayeeRegisterNo("123123123123");
req.setPlatformCode("tmall");
req.setPlatformTid("12132");
req.setSerialNo("3123123123");
req.setUserId("12345");
req.setUserPlatformCode("ALIPAY");
AlibabaEinvoiceAlipayResultGetResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_einvoice_alipay_result_get_response>
    <invoice_result_list>
        <alipay_invoice_result>
            <anti_fake_code>CF6B2F6168420008</anti_fake_code>
            <ciphertext>demosdffsd-32432</ciphertext>
            <device_no>sw1231</device_no>
            <erp_tid>123123</erp_tid>
            <file_data_type>jpg</file_data_type>
            <file_path>demo</file_path>
            <invoice_amount>1232.00</invoice_amount>
            <invoice_code>1231231234</invoice_code>
            <invoice_date>2014-4-21</invoice_date>
            <invoice_no>123123</invoice_no>
            <payee_register_no>20150201321123</payee_register_no>
            <platform_code>tmall</platform_code>
            <platform_tid>123123</platform_tid>
            <qr_code>demo</qr_code>
            <serial_no>123123</serial_no>
            <status>waiting</status>
            <biz_error_code>demo</biz_error_code>
            <biz_error_msg>demo</biz_error_msg>
            <payee_phone>18022229999</payee_phone>
            <payee_name>海尔官方旗舰店</payee_name>
            <invoice_type>blue</invoice_type>
            <payer_name>张三</payer_name>
            <invoice_items>
                <invoice_item>
                    <item_name>冰箱</item_name>
                    <item_no>333333</item_no>
                    <price>100.00</price>
                    <quantity>10</quantity>
                    <row_type>1</row_type>
                    <specification>X100</specification>
                    <sum_price>1.00</sum_price>
                    <tax>170.00</tax>
                    <tax_rate>0.17</tax_rate>
                    <unit>台</unit>
                    <amount>1170.00</amount>
                </invoice_item>
            </invoice_items>
            <normal_invoice_code>333333</normal_invoice_code>
            <normal_invoice_no>2222222</normal_invoice_no>
            <is_retrying>false</is_retrying>
            <sum_tax>0.00</sum_tax>
            <payer_phone>010-102934</payer_phone>
            <payer_register_no>91378274937948273</payer_register_no>
            <payer_address>杭州市文一西路969号</payer_address>
            <payer_bankaccount>网商银行 29742342</payer_bankaccount>
            <sum_price>10.00</sum_price>
        </alipay_invoice_result>
    </invoice_result_list>
</alibaba_einvoice_alipay_result_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>

错误码解释

错误码 错误描述 解决方案
isp.isp-system.error 系统错误 联系小二排查
isp.system-error 系统错误 联系小二排查

API工具

如何获得此API

FAQ

返回
顶部