文档中心 > API类目 > 采购宝API

taobao.pc.invoice.detail (企业购发票查询)

企业购发票查询

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
req InvoiceDetailReq 可选 查询发票详情,同时传多个则优先级:发票申请号 > 发票号码 > 子订单编号 > 淘宝子订单ID
  • └ invoice_apply_no
  • String
  • 可选
  • 000000
  • 发票申请号
  • └ outer_biz_no
  • String
  • 可选
  • 1000001
  • 外部申请单号
  • └ invoice_no
  • String
  • 可选
  • 000000
  • 发票号码
  • └ sub_biz_order_id
  • String
  • 可选
  • 000000
  • 子订单编号
  • └ sub_tp_order_id
  • String
  • 可选
  • 000000
  • 淘宝子订单ID
  • └ buyer_id
  • Number
  • 可选
  • 10000001
  • 买家ID
  • └ client_id
  • String
  • 必须
  • 10000001
  • 项目ID

响应参数

名称 类型 示例值 描述
result Result result
  • └ success
  • Boolean
  • true
  • 操作是否成功
  • └ error_code
  • String
  • 200
  • 结果码
  • └ error_msg
  • String
  • 参数错误
  • 结果描述
  • invoice_detail_resp
  • InvoiceDetailResp
  • 结果
  • invoice_details
  • InvoiceDetailVo []
  • 发票详情列表
  • └ invoice_no
  • String
  • xxxxx
  • 发票号码
  • └ invoice_code
  • String
  • xxxxx
  • 发票代码
  • └ title
  • String
  • xxxxx
  • 抬头
  • └ company_name
  • String
  • xxxxx
  • 公司名称
  • └ invoice_amount_with_tax
  • Number
  • 3
  • 价税合计金额(分)
  • └ invoice_amount_without_tax
  • Number
  • 3
  • 不含税金额(分)
  • └ tax_amount
  • Number
  • 3
  • 税额(分)
  • └ remark
  • String
  • xxxxx
  • 备注
  • └ invoice_material_code
  • String
  • xxxxx
  • 发票介质
  • └ invoice_class_code
  • String
  • xxxxx
  • 发票类型
  • └ billing_type
  • Number
  • 10
  • 开票类型
  • └ blue_invoice_code
  • String
  • xxxxx
  • 关联蓝票代码
  • └ blue_invoice_no
  • String
  • xxxxx
  • 关联蓝票编号
  • └ file_url
  • String
  • xxxxx
  • 发票文件下载地址
  • items
  • InvoiceItemsVo []
  • 发票明细信息
  • └ goods_description
  • String
  • xxxxx
  • 货物名称
  • └ specifications
  • String
  • xxxxx
  • 规格型号
  • └ unit_amount
  • Number
  • 3
  • 单价(分)
  • └ unit
  • String
  • xxxxx
  • 单位
  • └ invoice_amount_with_tax
  • Number
  • 3
  • 价税合计金额(分)
  • └ invoice_amount_without_tax
  • Number
  • 3
  • 不含税金额(分)
  • └ tax_amount
  • Number
  • 3
  • 税额(分)
  • └ tax_code
  • String
  • xxxxx
  • 税码

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
PcInvoiceDetailRequest req = new PcInvoiceDetailRequest();
PcInvoiceDetailRequest.InvoiceDetailReq obj1 = new PcInvoiceDetailRequest.InvoiceDetailReq();
obj1.setInvoiceApplyNo("000000");
obj1.setOuterBizNo("1000001");
obj1.setInvoiceNo("000000");
obj1.setSubBizOrderId("000000");
obj1.setSubTpOrderId("000000");
obj1.setBuyerId(10000001L);
obj1.setClientId("10000001");
req.setReq(obj1);
PcInvoiceDetailResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<pc_invoice_detail_response>
    <result>
        <success>true</success>
        <error_code>200</error_code>
        <error_msg>参数错误</error_msg>
        <invoice_detail_resp>
            <invoice_details>
                <invoice_detail_vo>
                    <invoice_no>xxxxx</invoice_no>
                    <invoice_code>xxxxx</invoice_code>
                    <title>xxxxx</title>
                    <company_name>xxxxx</company_name>
                    <invoice_amount_with_tax>3</invoice_amount_with_tax>
                    <invoice_amount_without_tax>3</invoice_amount_without_tax>
                    <tax_amount>3</tax_amount>
                    <remark>xxxxx</remark>
                    <invoice_material_code>xxxxx</invoice_material_code>
                    <invoice_class_code>xxxxx</invoice_class_code>
                    <billing_type>10</billing_type>
                    <blue_invoice_code>xxxxx</blue_invoice_code>
                    <blue_invoice_no>xxxxx</blue_invoice_no>
                    <file_url>xxxxx</file_url>
                    <items>
                        <invoice_items_vo>
                            <goods_description>xxxxx</goods_description>
                            <specifications>xxxxx</specifications>
                            <unit_amount>3</unit_amount>
                            <unit>xxxxx</unit>
                            <invoice_amount_with_tax>3</invoice_amount_with_tax>
                            <invoice_amount_without_tax>3</invoice_amount_without_tax>
                            <tax_amount>3</tax_amount>
                            <tax_code>xxxxx</tax_code>
                        </invoice_items_vo>
                    </items>
                </invoice_detail_vo>
            </invoice_details>
        </invoice_detail_resp>
    </result>
</pc_invoice_detail_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

返回
顶部