查询代销采购单单据。 1. 支持商家按照供应商、分销商两种角色来查询数据。如果没有指定角色角色,系统会自动判断,此时如果商家存在供应商、分销商两种角色时,按照供应商角色查询。 2. 同时此接口还可以查询除供销经销外的其他经营模式的数据。如果需要查询供销经销单据请参考接口:taobao.fenxiao.dealer.requisitionorder.query 3. 发货请调用物流API中的发货接口taobao.logistics.offline.send 进行发货,需要注意的是这里是供应商发货,因此调发货接口时需要传人供应商账号对应的sessionkey,tid 需传入供销平台的采购单(即fenxiao_id 分销流水号))。
| 名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
|---|---|---|---|---|---|
| status | String | 可选 | WAIT_BUYER_PAY | 交易状态,不传默认查询所有采购单 根据用户角色选择自身状态可选值: * 供应商: WAIT_SELLER_SEND_GOODS(等待发货) WAIT_SELLER_CONFIRM_PAY(待确认收款) WAIT_BUYER_PAY(等待付款) WAIT_BUYER_CONFIRM_GOODS(已发货) TRADE_REFUNDING(退款中) TRADE_FINISHED(采购成功) TRADE_CLOSED(已关闭) * 分销商: WAIT_BUYER_PAY(等待付款) WAIT_BUYER_CONFIRM_GOODS(待收货确认) TRADE_FOR_PAY(已付款) TRADE_REFUNDING(退款中) TRADE_FINISHED(采购成功) TRADE_CLOSED(已关闭) | |
| start_created | Date | 可选 | 2000-01-01 00:00:00 | 起始时间,格式 yyyy-MM-dd HH:mm:ss 支持到秒的查询。若不传时分秒,默认为0时0分0秒。当指定了purchase_order_id或者tc_order_id时,此值可选,否则此参数必传。 结束时间和开始时间的时间间隔不能超过7天,精确到秒。 | |
| end_created | Date | 可选 | 2000-01-01 23:59:59 | 结束时间,格式 yyyy-MM-dd HH:mm:ss 支持到秒的查询。若不传时分秒,默认为0时0分0秒。当指定了purchase_order_id或者tc_order_id时,此值可选,否则此参数必传。 结束时间和开始时间的时间间隔不能超过7天,精确到秒。 | |
| time_type | String | 可选 | trade_time_type | 时间类型: trade_time_type(默认类型,按照采购单创建时间范围查询,推荐按照此时间类型查询) update_time_type(采购单按照更新时间范围查询) | |
| purchase_order_id | Number | 可选 | 44926651888684 | 采购单编号或分销流水号。 当指定此参数后,其他可选参数可以为空 | |
| page_no | Number | 可选 | 1 | 页码。(大于0的整数。默认为1) | |
| page_size | Number | 可选 | 10 | 每页条数。(每页条数不超过50条) | |
| fields | String | 可选 | sub_purchase_orders.tc_order_id | 指定返回的字段(废弃该参数) 多个字段用","分隔。 fields 如果为空:返回所有采购单对象(purchase_orders)字段。 如果不为空:返回指定采购单对象(purchase_orders)字段。 例1: sub_purchase_orders.tc_order_id 表示只返回tc_order_id 例2: sub_purchase_orders表示只返回子采购单列表 | |
| tc_order_id | Number | 可选 | 157026218599994214 | 消费者交易单号(采购单下游买家订单id)。 当在代销、寄售交易中,此单号存在。 | |
| channel_codes | Number [] | 可选 | 200002 |
|
渠道市场编码,可批量指定。 当不指定时,按照配置的分销市场生效 渠道编码枚举:1-供销平台(淘宝);2-供销平台(天猫);3-供销平台(天猫超市);5-供销平台(淘乡甜);110001-供销平台(全球购);110007-淘分销;200002-消费电子市场 |
| user_role_type | Number | 可选 | 1 | 当前查询用户的角色 当不指定时,默认为供应商 供应商:2,分销商:1 | |
| trade_types | Number [] | 可选 | 1 |
|
查询的经营模式,当不指定时,默认查询代销订单 代销:1 经销:2 寄售(自营寄售):5 平台寄售:6 |
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| total_results | Number | 9999 | 查询到的采购单记录总数 |
| purchase_orders | TopDpOrderDo [] | 采购单及子采购单信息。 返回 PurchaseOrder 包含的字段信息。 | |
|
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
FenxiaoOrdersGetRequest req = new FenxiaoOrdersGetRequest();
req.setStatus("WAIT_BUYER_PAY");
req.setStartCreated(StringUtils.parseDateTime("2000-01-01 00:00:00"));
req.setEndCreated(StringUtils.parseDateTime("2000-01-01 23:59:59"));
req.setTimeType("trade_time_type");
req.setPurchaseOrderId(44926651888684L);
req.setPageNo(1L);
req.setPageSize(10L);
req.setFields("sub_purchase_orders.tc_order_id");
req.setTcOrderId(157026218599994214L);
req.setChannelCodes("200002");
req.setUserRoleType(1L);
req.setTradeTypes("1");
FenxiaoOrdersGetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
<fenxiao_orders_get_response>
<total_results>9999</total_results>
<purchase_orders>
<top_dp_order_do>
<tc_order_id>157026218599994214</tc_order_id>
<supplier_from>values: taobao</supplier_from>
<supplier_username>zhangsan</supplier_username>
<distributor_from>taobao</distributor_from>
<distributor_username>zhangsan</distributor_username>
<buyer_taobao_id>F21121542129F21121542129F2112154</buyer_taobao_id>
<buyer_nick>zhangsan</buyer_nick>
<trade_type>AGENT</trade_type>
<created>2000-01-01 00:00:00</created>
<id>555</id>
<fenxiao_id>1001</fenxiao_id>
<memo>留言。</memo>
<supplier_memo>供应商信息描述</supplier_memo>
<supplier_flag>1</supplier_flag>
<alipay_no>200010507220088888888449086137</alipay_no>
<total_fee>200.07</total_fee>
<post_fee>200.07</post_fee>
<distributor_payment>200.07</distributor_payment>
<buyer_payment>200.07</buyer_payment>
<snapshot_url>www.vancl.com</snapshot_url>
<status>TRADE_FINISHED(交易成功)</status>
<pay_time>2000-01-01 00:00:00</pay_time>
<end_time>2000-01-01 00:00:00</end_time>
<consign_time>2000-01-01 00:00:00</consign_time>
<modified>2000-01-01 00:00:00</modified>
<isv_custom_key>
<string>isv_custom_key</string>
</isv_custom_key>
<isv_custom_value>
<string>isv_custom_value</string>
</isv_custom_value>
<features>
<feature_do>
<attr_key>1234</attr_key>
<attr_value>2342</attr_value>
</feature_do>
</features>
<pay_type>ALIPAY_SURETY</pay_type>
<shipping>FAST</shipping>
<logistics_company_name>EMS</logistics_company_name>
<logistics_id>123123</logistics_id>
<sub_purchase_orders>
<sub_order_detail>
<tc_order_id>157026218599994214</tc_order_id>
<fenxiao_id>46467999930382</fenxiao_id>
<item_id>620019999537</item_id>
<item_outer_id>OUT00001</item_outer_id>
<sku_id>555</sku_id>
<auction_id>100</auction_id>
<auction_sku_id>100</auction_sku_id>
<sku_outer_id>5555</sku_outer_id>
<sku_properties>颜色:红色</sku_properties>
<old_sku_properties>颜色:红色</old_sku_properties>
<num>50</num>
<title>裙子</title>
<price>50</price>
<snapshot_url>www.vancl.com</snapshot_url>
<created>2000-01-01 00:00:00</created>
<status>WAIT_BUYER_PAY(等待买家付款)</status>
<id>5552</id>
<total_fee>200.07</total_fee>
<distributor_payment>200.07</distributor_payment>
<buyer_payment>200.07</buyer_payment>
<refund_fee>12.23</refund_fee>
<order_200_status>PAID_SEND_GOODS</order_200_status>
<auction_price>100.10</auction_price>
<bill_fee>100.10</bill_fee>
<sc_item_id>100000000</sc_item_id>
<tc_preferential_type>聚划算</tc_preferential_type>
<tc_discount_fee>1000</tc_discount_fee>
<tc_adjust_fee>1000</tc_adjust_fee>
<discount_fee>11.11</discount_fee>
<promotion_type>1</promotion_type>
<features>
<feature_do>
<attr_key>1234</attr_key>
<attr_value>2342</attr_value>
</feature_do>
</features>
<top_memo>
<remark>123</remark>
<operate_user_nick>123</operate_user_nick>
<attachments>
<top_memo_attachment>
<url>123</url>
<name>123</name>
</top_memo_attachment>
</attachments>
</top_memo>
<order_status>WAIT_SELLER_SEND_GOODS</order_status>
<refund_status>RF_STATUS_NO_REFUND</refund_status>
<suit_status>ORDER_RF_NO_SUIT</suit_status>
<need_sn>true</need_sn>
<bybt_sn_code_tag>{t:1}</bybt_sn_code_tag>
<latest_refund_id>125656688526</latest_refund_id>
<latest_suit_id>123899666366</latest_suit_id>
<latest_exchange_refund_id>125899633653</latest_exchange_refund_id>
<latest_exchange_suit_id>125846639978</latest_exchange_suit_id>
</sub_order_detail>
</sub_purchase_orders>
<receiver>
<name>zhangsan</name>
<address>文一西路969号</address>
<zip>310000</zip>
<phone>57188155188</phone>
<mobile_phone>13812345678</mobile_phone>
<state>浙江省</state>
<city>杭州市</city>
<district>余杭区</district>
<oaid>xxxx</oaid>
</receiver>
<order_messages>
<order_messages>
<message_time>2000-01-01 00:00:00</message_time>
<message_title>分销商留言</message_title>
<message_content>留言内容</message_content>
<pic_url>1</pic_url>
</order_messages>
</order_messages>
<logistics_infos>
<erp_logistics_info>
<consign_type>cn</consign_type>
<num_iid>12222</num_iid>
<sku_id>213</sku_id>
<type>00</type>
<store_code>2223</store_code>
<need_consign_num>5</need_consign_num>
<item_code>323232</item_code>
<item_id>2323232</item_id>
<sub_order_id>1100070860173581613</sub_order_id>
<order_id>1100070860172581613</order_id>
<combine_item_id>558578215712</combine_item_id>
<combine_item_code>1021-0</combine_item_code>
<item_ratio>1</item_ratio>
<bar_code>a223323</bar_code>
<delivery_cps>STO</delivery_cps>
<biz_store_code>YT_HD_STORE</biz_store_code>
<biz_delivery_code>2356364</biz_delivery_code>
<biz_sd_type>1</biz_sd_type>
<send_division_code>330110005</send_division_code>
<send_country>中国</send_country>
<send_state>浙江</send_state>
<send_city>杭州</send_city>
<send_district>西湖区</send_district>
<send_town>三墩镇</send_town>
<black_delivery_cps>SF,YT,ZT</black_delivery_cps>
<white_delivery_cps>YD,JT,JD</white_delivery_cps>
</erp_logistics_info>
</logistics_infos>
<alipay_order_no>2020081222001182111436382503</alipay_order_no>
<confirm_paid_fee_yuan>22.22</confirm_paid_fee_yuan>
<channel_code>200002</channel_code>
<open_buyer_uid>44544541165</open_buyer_uid>
<delivery_time>2019-04-12 16:00:00</delivery_time>
<sign_time>2019-04-12 16:00:00</sign_time>
<asdp_ads>201,202</asdp_ads>
<delivery_cps>STO</delivery_cps>
<order_status>WAIT_SELLER_SEND_GOODS</order_status>
<refund_status>ORDER_RF_NO_REFUND</refund_status>
<suit_status>ORDER_RF_NO_SUIT</suit_status>
<order_type>100</order_type>
<order_type_desc>销售订单</order_type_desc>
</top_dp_order_do>
</purchase_orders>
</fenxiao_orders_get_response>
<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:user_id_num | 用户数字ID不合法,或者不是分销平台用户 | |
| isv.invalid-parameter:purchaseorder_intervaldate | 采购单查询的起始时间与结束时间跨度不能超过7天 | |
| isv.invalid-parameter:purchaseorder_empty | 此错误是 查询订单的起始时间,结束时间为空或者间隔超过7天。 | |
| isv.invalid-parameter:fields |