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

taobao.pc.bills.query (企业购账单查询)

企业购账单查询,该接口既可以查询账单,也可以查询账单内部明细条目

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
req BillQueryReq 可选 账单查询请求
  • └ bill_start_date
  • String
  • 可选
  • 2013-11-11 11:11:11
  • 账单开始日期,查询该时间范围内的所有账单
  • └ bill_end_date
  • String
  • 可选
  • 2013-11-11 11:11:11
  • 账单结束日期,查询该时间范围内的所有账单
  • └ bill_no
  • String
  • 可选
  • E_202504982001653
  • 账单号
  • └ bill_query_type
  • Number
  • 必须
  • 1
  • 查询类型 , 1.账单查询(需要传billStartDate,billEndDate) 2.账单下订单查询(需要传billNo,orderQueryType)
  • └ order_query_type
  • Number
  • 可选
  • 1
  • 订单查询维度 , 1.主单维度 2.包裹维度
  • └ buyer_id
  • Number
  • 必须
  • 10000001
  • 买家ID
  • └ client_id
  • String
  • 必须
  • 10000001
  • 项目ID
  • └ page_no
  • Number
  • 必须
  • 1
  • 分页页码
  • └ page_size
  • Number
  • 必须
  • 20
  • 分页大小

响应参数

名称 类型 示例值 描述
result Result result
  • └ success
  • Boolean
  • true
  • 操作是否成功
  • └ error_code
  • String
  • 200
  • 结果码
  • └ error_msg
  • String
  • 参数错误
  • 结果描述
  • bill_query_resp
  • BillQueryResp
  • 结果
  • bill_info
  • BillPageData
  • 账单列表,参数带入billNo单个查询明细时只会有一个
  • └ current_page
  • Number
  • 1
  • 当前页码
  • └ page_size
  • Number
  • 20
  • 每页大小
  • └ total_count
  • Number
  • 100
  • 总数量
  • └ cursor_mode
  • Boolean
  • false
  • 是否游标模式
  • └ cursor
  • String
  • 12345
  • 游标
  • bill_v_o_list
  • BillVo []
  • 数据集合
  • └ bill_no
  • String
  • xxxxx
  • 账单号
  • └ bill_name
  • String
  • xxxxx
  • 账单名称
  • └ bill_start_date
  • Date
  • null
  • 账单周期内开始时间
  • └ bill_end_date
  • Date
  • null
  • 账单周期内结束时间
  • └ settle_start_date
  • Date
  • null
  • 结算开始时间
  • └ settle_end_date
  • Date
  • null
  • 结算截止时间
  • └ amount
  • Number
  • 3
  • 账单总金额(分)
  • main_order_info
  • MainOrderPageData
  • 账单明细【主单维度】
  • └ current_page
  • Number
  • 1
  • 当前页码
  • └ page_size
  • Number
  • 20
  • 每页大小
  • └ total_count
  • Number
  • 100
  • 总数量
  • └ cursor_mode
  • Boolean
  • false
  • 是否游标模式
  • └ cursor
  • String
  • 12345
  • 游标
  • bill_main_order_v_o_list
  • BillMainOrderVo []
  • 数据集合
  • └ biz_order_id
  • Number
  • 3
  • 企业购订单号
  • └ out_order_id
  • String
  • xxxxx
  • 外部系统订单号
  • └ buyer_id
  • Number
  • 3
  • 买方的企业账号ID
  • └ tp_order_id_list
  • String []
  • Top,Pub
  • 关联的淘宝订单列表
  • └ buy_amount
  • Number
  • 10
  • 购买的商品数量
  • └ total_fee
  • Number
  • 3
  • 总费用, 单位为分
  • └ post_fee
  • Number
  • 3
  • 邮费, 单位为分
  • └ invoice_title
  • String
  • xxxxx
  • 发票抬头/社会信用编码
  • bill_sub_order_v_o_s
  • BillSubOrderVo []
  • 子订单信息
  • └ biz_order_id
  • Number
  • 3
  • 企业购订单ID
  • └ tp_order_id
  • Number
  • 3
  • 淘宝订单ID
  • └ out_order_id
  • String
  • xxxxx
  • 外部订单号
  • └ item_id
  • Number
  • 3
  • 商品ID
  • └ item_name
  • String
  • xxxxx
  • 商品名称
  • └ sku_id
  • Number
  • 3
  • 商品SKU ID
  • └ sku_title
  • String
  • xxxxx
  • 商品SKU属性
  • └ tax_code
  • String
  • xxxxx
  • 税编
  • └ tax_rate
  • String
  • xxxxx
  • 税率
  • └ item_price
  • Number
  • 3
  • 商品价格(分)
  • └ buy_amount
  • Number
  • 10
  • 购买数量
  • └ total_fee
  • Number
  • 3
  • 总支付金额(分)
  • └ refund_suc_amount
  • Number
  • 3
  • 退款成功金额(分)
  • └ refunding_amount
  • Number
  • 3
  • 退款中金额(分)
  • package_info
  • PackagePageData
  • 账单明细【包裹维度】
  • └ current_page
  • Number
  • 1
  • 当前页码
  • └ page_size
  • Number
  • 20
  • 每页大小
  • └ total_count
  • Number
  • 100
  • 总数量
  • └ cursor_mode
  • Boolean
  • false
  • 是否游标模式
  • └ cursor
  • String
  • 12345
  • 游标
  • bill_package_v_o_list
  • BillPackageVo []
  • 数据集合
  • └ package_id
  • String
  • xxxxx
  • 包裹ID
  • └ cp_code
  • String
  • xxxxx
  • 包裹快递编码
  • └ cp_name
  • String
  • xxxxx
  • 包裹快递名称
  • └ mail_no
  • String
  • xxxxx
  • 包裹运单号
  • bill_sub_order_v_o_s
  • BillSubOrderVo []
  • 包裹订单信息
  • └ biz_order_id
  • Number
  • 3
  • 企业购订单ID
  • └ tp_order_id
  • Number
  • 3
  • 淘宝订单ID
  • └ out_order_id
  • String
  • xxxxx
  • 外部订单号
  • └ item_id
  • Number
  • 3
  • 商品ID
  • └ item_name
  • String
  • xxxxx
  • 商品名称
  • └ sku_id
  • Number
  • 3
  • 商品SKU ID
  • └ sku_title
  • String
  • xxxxx
  • 商品SKU属性
  • └ tax_code
  • String
  • xxxxx
  • 税编
  • └ tax_rate
  • String
  • xxxxx
  • 税率
  • └ item_price
  • Number
  • 3
  • 商品价格(分)
  • └ buy_amount
  • Number
  • 10
  • 购买数量
  • └ total_fee
  • Number
  • 3
  • 总支付金额(分)
  • └ refund_suc_amount
  • Number
  • 3
  • 退款成功金额(分)
  • └ refunding_amount
  • Number
  • 3
  • 退款中金额(分)

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
PcBillsQueryRequest req = new PcBillsQueryRequest();
PcBillsQueryRequest.BillQueryReq obj1 = new PcBillsQueryRequest.BillQueryReq();
obj1.setBillStartDate("2013-11-11 11:11:11");
obj1.setBillEndDate("2013-11-11 11:11:11");
obj1.setBillNo("E_202504982001653");
obj1.setBillQueryType(1L);
obj1.setOrderQueryType(1L);
obj1.setBuyerId(10000001L);
obj1.setClientId("10000001");
obj1.setPageNo(1L);
obj1.setPageSize(20L);
req.setReq(obj1);
PcBillsQueryResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<pc_bills_query_response>
    <result>
        <success>true</success>
        <error_code>200</error_code>
        <error_msg>参数错误</error_msg>
        <bill_query_resp>
            <bill_info>
                <current_page>1</current_page>
                <page_size>20</page_size>
                <total_count>100</total_count>
                <cursor_mode>false</cursor_mode>
                <cursor>12345</cursor>
                <bill_v_o_list>
                    <bill_vo>
                        <bill_no>xxxxx</bill_no>
                        <bill_name>xxxxx</bill_name>
                        <bill_start_date>null</bill_start_date>
                        <bill_end_date>null</bill_end_date>
                        <settle_start_date>null</settle_start_date>
                        <settle_end_date>null</settle_end_date>
                        <amount>3</amount>
                    </bill_vo>
                </bill_v_o_list>
            </bill_info>
            <main_order_info>
                <current_page>1</current_page>
                <page_size>20</page_size>
                <total_count>100</total_count>
                <cursor_mode>false</cursor_mode>
                <cursor>12345</cursor>
                <bill_main_order_v_o_list>
                    <bill_main_order_vo>
                        <biz_order_id>3</biz_order_id>
                        <out_order_id>xxxxx</out_order_id>
                        <buyer_id>3</buyer_id>
                        <tp_order_id_list>
                            <string>Top</string>
                            <string>Pub</string>
                        </tp_order_id_list>
                        <buy_amount>10</buy_amount>
                        <total_fee>3</total_fee>
                        <post_fee>3</post_fee>
                        <invoice_title>xxxxx</invoice_title>
                        <bill_sub_order_v_o_s>
                            <bill_sub_order_vo>
                                <biz_order_id>3</biz_order_id>
                                <tp_order_id>3</tp_order_id>
                                <out_order_id>xxxxx</out_order_id>
                                <item_id>3</item_id>
                                <item_name>xxxxx</item_name>
                                <sku_id>3</sku_id>
                                <sku_title>xxxxx</sku_title>
                                <tax_code>xxxxx</tax_code>
                                <tax_rate>xxxxx</tax_rate>
                                <item_price>3</item_price>
                                <buy_amount>10</buy_amount>
                                <total_fee>3</total_fee>
                                <refund_suc_amount>3</refund_suc_amount>
                                <refunding_amount>3</refunding_amount>
                            </bill_sub_order_vo>
                        </bill_sub_order_v_o_s>
                    </bill_main_order_vo>
                </bill_main_order_v_o_list>
            </main_order_info>
            <package_info>
                <current_page>1</current_page>
                <page_size>20</page_size>
                <total_count>100</total_count>
                <cursor_mode>false</cursor_mode>
                <cursor>12345</cursor>
                <bill_package_v_o_list>
                    <bill_package_vo>
                        <package_id>xxxxx</package_id>
                        <cp_code>xxxxx</cp_code>
                        <cp_name>xxxxx</cp_name>
                        <mail_no>xxxxx</mail_no>
                        <bill_sub_order_v_o_s>
                            <bill_sub_order_vo>
                                <biz_order_id>3</biz_order_id>
                                <tp_order_id>3</tp_order_id>
                                <out_order_id>xxxxx</out_order_id>
                                <item_id>3</item_id>
                                <item_name>xxxxx</item_name>
                                <sku_id>3</sku_id>
                                <sku_title>xxxxx</sku_title>
                                <tax_code>xxxxx</tax_code>
                                <tax_rate>xxxxx</tax_rate>
                                <item_price>3</item_price>
                                <buy_amount>10</buy_amount>
                                <total_fee>3</total_fee>
                                <refund_suc_amount>3</refund_suc_amount>
                                <refunding_amount>3</refunding_amount>
                            </bill_sub_order_vo>
                        </bill_sub_order_v_o_s>
                    </bill_package_vo>
                </bill_package_v_o_list>
            </package_info>
        </bill_query_resp>
    </result>
</pc_bills_query_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

返回
顶部