跳转到内容
返回官网

获取订单列表(增强版)

本接口为增强型订单列表接口,除了订单列表标准的查询条件之外,还可以按买家留言、订单旗帜、卖家备注、宝贝Id等条件查询订单。

说明:

商家首次订购授权后,一般1,2分钟后即可使用本接口,时间取决于商家的历史订单数据多寡。

淘宝获取订单列表 VS 订单列表接口

增强版

这2个订单列表接口各有特点, 大家可以根据自己的场景, 选择一种或是结合使用.

  1. 订单列表接口 : 优点: 订单实时性更强, 新商家订购后也马上可以获取到订单. 可以获取商家最近90天内的历史订单及新订单. 缺点: 受淘宝大促或是压测影响, 订单中的收件人等信息可能返回为空或是被限流.

  2. 淘宝获取订单列表(增强版) 优点: 稳定性更强, 不受大促或淘宝压测影响, 查询的条件维度更丰富. 获取商家授权后的最近3天的历史订单及新订单. 缺点: 新订购商家的历史订单略有延迟. 相对订单列表接口会有秒级的延迟.

建议大家在系统也接入淘宝获取订单列表(增强版) 接口 , 在淘宝限流或压测时, 可以进行同步.

一、请求参数

请求URL:

POST https://kf.fw199.com/gateway/taobao/order/ext/list

参数名类型必须示例值说明
appidStringtrueuwkahf@jfs92合作伙伴AppId
timestampStringtrue1633618722当前时间戳
tb_seller_nickStringtruekingdo淘宝卖家店铺登录账号,非店铺名称
signStringtrue999de41d862efaa6f1084ead3b3ba480如何计算生成见示例代码
start_createdDatetrue查询1个月内交易创建时间开始。格式:yyyy-MM-dd HH:mm:ss
end_createdDatetrue查询交易创建时间结束。格式:yyyy-MM-dd HH:mm:ss
buyer_open_uidStringfasle淘宝买家昵称实施模糊化后, 买家唯一身份标识, 此值可传空字符串
statusStringfalse交易状态 ,默认查询所有交易状态的数据, 除了默认值外每次只能查询一种状态。WAIT_BUYER_PAY:等待买家付款 WAIT_SELLER_SEND_GOODS:等待卖家发货 、 SELLER_CONSIGNED_PART:卖家部分发货 WAIT_BUYER_CONFIRM_GOODS:等待买家确认收货 TRADE_BUYER_SIGNED:买家已签收(货到付款专用) TRADE_FINISHED:交易成功 TRADE_CLOSED:交易关闭
page_nointfalse当前页,默认1
page_sizeintfalse每页大小, 最大500, 每100为一个阶梯
buyer_messageStringfalse买家留言 ,受buyer_message_op控制
buyer_message_opStringfalse对买家留言的操作。 all 或是不传值,买家留言将不参与查询; eq: 等于 ; ne: 不等于; like: 模糊匹配(包含)
seller_memoStringfalse卖家备注,受seller_memo_op控制
seller_memo_opStringfalse对卖家备注的操作。 all 或是不传值,卖家备注将不参与查询; eq: 等于 ; ne: 不等于; like: 模糊匹配(包含)
seller_flagintfalse订单旗帜不传入此字段或空串,表示全部 。 0: (即没有插过旗) 1 :红 ,2: 黄 ,3: 绿 ,4: 蓝 ,5: 紫
num_iidlongfalse商品id
tidstringfalse订单号, 如果多个订单号,请用英文逗号”,”隔开
refundinglongfalse订单退款状态,默认为全部 , 0: 表示没有退款中的订单, 1:表示有退款中的订单
date_typeintfalse查询时间(start_created和end_created)的时间类型, 0:按订单创建时间查询 ,1 :按订单更新时间查询
order_ascStringfalse查询时间(start_created和end_created)的排序,DESC:按时间降序返回,ASC: 按时间升序返回
sysidString100必填, 代表不同的应用,具体请咨询客服

二、请求示例代码

Java

@Test
public void TaoBaoOrderExtList() throws Exception {
try {
String tb_seller_nick = Config.TBSellerNick; //要查询的淘宝商家
//业务参数
Map<String, String> data = new HashMap<String, String>();
data.put("appid", Config.AppId);
data.put("sysid", "100"); // 此值很重要,代表不同的应用,否则拉到订单,具体请咨询客服。
data.put("tb_seller_nick", tb_seller_nick);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
data.put("start_created", "2021-10-29 00:00:00");
data.put("end_created", "2021-10-31 23:00:00");
data.put("status", "WAIT_SELLER_SEND_GOODS");
// data.put("buyer_message_op", "ne");
// data.put("buyer_message", "不要搞错");
// data.put("seller_memo_op", "like");
// data.put("seller_memo", "7号钟");
data.put("seller_flag", "1");
data.put("page_no", "1");
data.put("page_size", "30");
data.put("refunding", "0");
// data.put("sysid", ""); 传什么参数请咨询客服
data.put("sign", Utils.Sign(data, Config.AppSecret));
// 调用服务API
doHttpRequest(Config.TaoBaoOrderExtListUrl, data);
} catch (Exception ex) {
ex.printStackTrace();
}
}

三、返回结果

返回结果如下

{
"code":0,
"message":"ok",
"data":{
"total":3,
"items":[
{
"adjust_fee":"0.00",
"alipay_no":"2021100222001152871411937447",
"buyer_area":"福建漳州电信",
"buyer_nick":"咸梅00",
"buyer_obtain_point_fee":0,
"buyer_open_uid":"",
"buyer_rate":false,
"buyer_message":"需要礼盒,谢谢!",
"cod_fee":"0.00",
"cod_status":"NEW_CREATED",
"created":"2021-10-02 16:13:56",
"discount_fee":"8.42",
"paid_coupon_fee":"",
"order_tax_fee":"",
"credit_card_fee":"",
"coupon_fee":0,
"is_brand_sale":false,
"is_force_wlb":false,
"is_lgtype":false,
"modified":"2021-10-02 16:17:42",
"new_presell":false,
"num":1,
"num_iid":613373384956,
"orders":{
"order":[
{
"adjust_fee":"0.00",
"buyer_rate":false,
"cid":50012772,
"discount_fee":"24.00",
"divide_order_fee":"105.58",
"is_daixiao":false,
"is_oversold":false,
"nr_outer_iid":"",
"num":1,
"num_iid":613373384956,
"oid":"1410072240792463390",
"oid_str":"",
"order_from":"WAP,WAP",
"outer_iid":"",
"outer_sku_id":"",
"payment":"105.58",
"pic_path":"https://img.alicdn.com/bao/uploaded/i1/1820950890/O1CN01Ntkavy1IRf5SUyYyQ_!!1820950890.jpg",
"price":"138.00",
"refund_status":"SUCCESS",
"seller_rate":false,
"seller_type":"C",
"sku_id":"4490318210144",
"sku_properties_name":"颜色分类:豆沙色;尺码:L",
"snapshot_url":"u:1410072240792463390_1",
"status":"TRADE_CLOSED",
"title":"冰丝绸睡衣女春夏蕾丝花边性感丝滑星星仿真丝超薄开衫长袖家居服",
"total_fee":"114.00",
"invoice_no":"",
"logistics_company":"",
"part_mjz_discount":"8.42",
"fqg_num":0,
"is_fqg_s_fee":false,
"recharge_fee":"",
"credit_buy":"",
"consign_time":"",
"modified":"",
"refund_id":"89670685480469033",
"end_time":"2021-10-02 16:16:15",
"shipping_type":""
}
]
},
"pay_time":"2021-10-02 16:13:59",
"payment":"105.58",
"pic_path":"https://img.alicdn.com/bao/uploaded/i1/1820950890/O1CN01Ntkavy1IRf5SUyYyQ_!!1820950890.jpg",
"point_fee":0,
"post_fee":"0.00",
"price":"138.00",
"real_point_fee":0,
"received_payment":"0.00",
"receiver_address":"云*镇**路***号凯盛通讯",
"receiver_city":"漳州市",
"receiver_district":"云霄县",
"receiver_town":"云陵镇",
"receiver_mobile":"*******1889",
"receiver_phone":"",
"receiver_name":"丽**",
"receiver_state":"福建省",
"receiver_zip":"000000",
"seller_flag":1,
"seller_memo":"礼盒",
"seller_nick":"可拆卸aa",
"seller_rate":false,
"shipping_type":"express",
"status":"TRADE_CLOSED",
"tid":"1410072240792463390",
"tid_str":"1410072240792463390",
"title":"SUN因家而生",
"total_fee":"138.00",
"type":"fixed",
"you_xiang":false,
"trade_from":"WAP,WAP",
"app_name":"",
"oaid":"1Xic30TPmr9x7w6kdCia5YEjRsOSSZ6Ghicwp4fmw6fqkkTQQq0x1OwRIibM8kcr8n9CZ2ockH",
"consign_time":"",
"has_post_fee":true,
"timeout_action_time":"",
"snapshot_url":"u:1410072240792463390_1",
"end_time":"2021-10-02 16:16:15",
"platform_subsidy_fee":"",
"rx_audit_status":""
},
{
"adjust_fee":"0.00",
"alipay_no":"2021100622001149491452413837",
"buyer_area":"",
"buyer_nick":"tb446831190",
"buyer_obtain_point_fee":0,
"buyer_open_uid":"",
"buyer_rate":false,
"buyer_message":"",
"cod_fee":"0.00",
"cod_status":"NEW_CREATED",
"created":"2021-10-06 15:19:37",
"discount_fee":"38.16",
"paid_coupon_fee":"",
"order_tax_fee":"",
"credit_card_fee":"",
"coupon_fee":0,
"is_brand_sale":false,
"is_force_wlb":false,
"is_lgtype":false,
"modified":"2021-10-07 19:22:29",
"new_presell":false,
"num":1,
"num_iid":627502976336,
"orders":{
"order":[
{
"adjust_fee":"0.00",
"buyer_rate":false,
"cid":50012772,
"discount_fee":"46.00",
"divide_order_fee":"143.84",
"is_daixiao":false,
"is_oversold":false,
"nr_outer_iid":"",
"num":1,
"num_iid":627502976336,
"oid":"2161196210547294406",
"oid_str":"",
"order_from":"WAP,WAP",
"outer_iid":"",
"outer_sku_id":"",
"payment":"143.84",
"pic_path":"https://img.alicdn.com/bao/uploaded/i3/1820950890/O1CN01GveBvz1IRf7ceLHx9_!!1820950890.jpg",
"price":"228.00",
"refund_status":"SUCCESS",
"seller_rate":false,
"seller_type":"C",
"sku_id":"4721825188091",
"sku_properties_name":"颜色分类:三件套【白色樱桃】;尺码:均码有弹力【建议90-145斤】",
"snapshot_url":"u:2161196210547294406_1",
"status":"TRADE_CLOSED",
"title":"软绵绵睡衣女秋冬季长袖长裤吊带三件套加厚V领开衫珊瑚绒家居服",
"total_fee":"182.00",
"invoice_no":"",
"logistics_company":"",
"part_mjz_discount":"38.16",
"fqg_num":0,
"is_fqg_s_fee":false,
"recharge_fee":"",
"credit_buy":"",
"consign_time":"",
"modified":"",
"refund_id":"131819509106290644",
"end_time":"2021-10-07 19:22:30",
"shipping_type":""
}
]
},
"pay_time":"2021-10-06 15:19:56",
"payment":"143.84",
"pic_path":"https://img.alicdn.com/bao/uploaded/i3/1820950890/O1CN01GveBvz1IRf7ceLHx9_!!1820950890.jpg",
"point_fee":0,
"post_fee":"0.00",
"price":"228.00",
"real_point_fee":0,
"received_payment":"0.00",
"receiver_address":"里*乡**县**乡小**村",
"receiver_city":"衡水市",
"receiver_district":"故城县",
"receiver_town":"里老乡",
"receiver_mobile":"*******8101",
"receiver_phone":"",
"receiver_name":"刘**",
"receiver_state":"河北省",
"receiver_zip":"000000",
"seller_flag":1,
"seller_memo":"99.4",
"seller_nick":"可拆卸aa",
"seller_rate":false,
"shipping_type":"express",
"status":"TRADE_CLOSED",
"tid":"2161196210547294406",
"tid_str":"2161196210547294406",
"title":"SUN因家而生",
"total_fee":"228.00",
"type":"fixed",
"you_xiang":false,
"trade_from":"WAP,WAP",
"app_name":"",
"oaid":"1TgzWP3JffNmyL5f6yvQpThguib83ZEia46E0HhzUFavLVlqkZA045IwmJ3jmicBURupx15ug",
"consign_time":"",
"has_post_fee":true,
"timeout_action_time":"",
"snapshot_url":"u:2161196210547294406_1",
"end_time":"2021-10-07 19:22:30",
"platform_subsidy_fee":"",
"rx_audit_status":"",
"buyer_open_uid":"AAEt90gYAAjcqSrFKsJnK_Ba"
}
]
}
}

说明: code为0表示成功,非0为失败,message会包含失败原因。total为符合查询的总记录数,可根据返回的总记录数进行分页查询, data字段包含订单列表的数据, 返回的字段说明见淘宝文档