目录
下载安装与运行
支持的订单读取方式
请求数据格式一
请求头示例
数据格式说明
数据格式示例
返回数据格式一
返回头示例
数据格式说明
数据格式示例
请求数据格式二(根据订单编号)
请求头示例
返回数据格式二(根据订单编号)
特别提醒
返回头示例
常见问题
工作过程中切换账号
不同页面层级各自有什么订单数据
下载安装与运行
下载、安装与运行 · 语雀
经过前面基本概念与调用说明,你已经对API规范有了大概的了解
这里是具体的接口规范
支持的订单读取方式
订单查询支持两种方式
- 查询指定账号下的订单(按时间、按状态等等)
- 根据提供的订单编号查询订单(仅支持获取物流信息)
请求数据格式一
客户端往服务器端发送请求
请求头示例
POST http://localhost:3001/tborder/request HTTP/1.1
Host: localhost:3001
Connection: keep-alive
Content-Length: 25
Accept: application/json, text/javascript, */*; q=0.01
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36
Content-Type: application/json; charset=UTF-8
Origin: https://happ
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
{"account-name":"tiplip","isLogin":true}
数据格式说明
account_name | 淘宝用户名 | 服务器端可以用来区分当前请求来源 |
isLogin | 是否已登录 | 结合account_name以及是否登录 决定是否可以向当前账号下发任务 |
extra | 附加内容 | 返回数据时携带 服务器端可以自定义的部分,客户端会原封不动的返回 |
orders | 查询到的订单数组 | 返回数据时携带 不是每次都会发送这个字段 |
数据格式示例
{
"account_name": "tb953**2593",
"extra": "custom",
"orders": [{
"actualFee": 148,
"actualFee_cent": 14800,
"aftersale": "未发货; 退款/退货",
"alipayNum": "2023031722001136501452694799",
"babyStatus": "未确认收货",
"buyMessage": "-",
"buyerNick": "tb953**2593",
"certifyUrl": "",
"city": "广州",
"confirmTime": "",
"createTime": "2023-03-17 12:51:39",
"detailUrl": "//trade.tmall.com/detail/orderDetail.htm?bizOrderId=3263251069857080215",
"flag": 0,
"flagColor": "",
"id": 3469280242,
"logisticsCompany": "韵达快递",
"logisticsNumber": "433124**1075120",
"memo": "",
"multiple": 1,
"name": "广州萌吉商贸有限公司",
"num": 10,
"orderDiscount": "",
"orderId": "3263251069857080215",
"originalPrice": 100,
"originalPrice_cent": 10000,
"payTime": "2023-03-17 13:18:31",
"postFee": 0,
"postFee_cent": 0,
"productFees": 148,
"productId": "694679071453",
"productPic": "https://img.alicdn.com/imgextra/i1/3469280242/O1CN01JzOEb61Desan1nw5L_!!3469280242.jpg",
"productTitle": "短袖t恤女夏超仙蕾丝衬衫设计感小众V领泡泡袖上衣夏装2023年新款",
"productUrl": "//item.taobao.com/item.htm?id=694679071453&_u=j3tg008u60c9",
"quantity": "1",
"rateStatus": "",
"realPrice": 69,
"realPriceSold": 69,
"realPrice_cent": 6900,
"receiverAddress": "Mr丶许3.17,86-135**020321,福建省 莆田市 城厢区 霞林街道 荔华东大道1692号三楼,乱发投诉3-17(尽量不要发韵达",
"receiverName": "Mr丶许3.17",
"receiverPhone": "135**020321",
"sellerEncoding": "",
"sellerNick": "贝朵菲旗舰店",
"sellerPhone": "020-22108654",
"sendTime": "2023-03-18 23:11:25",
"shipType": "",
"shopName": "贝朵菲旗舰店",
"shopUrl": "https://store.taobao.com/shop/view_shop.htm?user_number_id=3469280242",
"skuId": "5102719031134",
"skuInfo": "杏色【主图款】; M",
"snapUrl": "//trade.taobao.com/trade/detail/tradeSnap.htm?tradeID=3263251069859080215",
"status": 0,
"tradeId": "3263251069858080215",
"tradeStatus": "物流运输中"
},
]
}
返回数据格式一
服务器端往客户端返回数据
按时间范围,按订单类型查询订单
返回头示例
HTTP/1.1 200 OK
Content-Length: 273
Last-Modified: Sat, 18 Mar 2023 12:13:57 GMT
Cache-Control: max-age=0
Content-Type: application/json; charset=utf-8
Date: Mon, 20 Mar 2023 00:17:53 GMT
Connection: keep-alive
Keep-Alive: timeout=5
{
"success": 1,
"errcode": "",
"errmsg": "",
"order_query": {
"action": "itemlist/BoughtQueryAction",
"extra": null,
"params": {
"auctionStatus": "PAID",
"dateBegin": "1677600000411",
"dateEnd": "1679068800411"
}
}
}
数据格式说明
success | 请求是否成功 | 1:表示成功;0:表示失败,如果当前没有需要webcrawl执行的任务,就填写0 |
order_query | 订单查询任务 | |
action | "itemlist/BoughtQueryAction" | 查询买家订单 |
extra | 服务器端自定义的数据,webcrawl会在返回中完整携带 | 可以用于server端识别任务 |
auctionStatus | 订单类型 | ALL:全部类型 NOT_PAID:等待买家付款 PAID:买家已付款 SEND:卖家已发货 SUCCESS:交易成功 DROP:交易关闭 REFUNDING:退款中的订单 |
dateBegin | 订单成交日期起始时间点 | 1677600000411 (2023年3月1号 00:00:00) |
dateEnd | 订单成交日期结束时间点 | 1679068800411 (2023年3月18号 00:00:00) |
pageLevel | 订单数据页面层级 | 当前支持页面层级 orderList:订单列表页(始终为true) orderDetail:订单详情页(默认为true) logisTrack:物流跟踪页(默认为false) tradeSnap:交易快照页(默认为false) 说明:如果不提供pageLevel, 默认只读取orderList和orderDetail |
数据格式示例
示例一
- 买家订单
- 已付款未发货
- 2023年3月1号 00:00:00和2023年3月18号 00:00:00中间成交的订单
{
"success": 1,
"errcode": "",
"errmsg": "",
"order_query": {
"action": "itemlist/BoughtQueryAction",
"extra": null,
"params": {
"auctionStatus": "PAID",
"dateBegin": "1677600000411",
"dateEnd": "1679068800411"
}
}
}
示例二
- 买家订单
- 已付款未发货
- 2023年3月1号 00:00:00和2023年3月18号 00:00:00中间成交的订单
- 读取物流跟踪数据
{
"success": 1,
"errcode": "",
"errmsg": "",
"order_query": {
"action": "itemlist/BoughtQueryAction",
"extra": null,
"params": {
"auctionStatus": "PAID",
"dateBegin": "1677600000411",
"dateEnd": "1679068800411"
}
"pageLevel": {
"orderDetail": false,
"logisTrack": true
}
}
}
请求数据格式二(根据订单编号)
请求头示例
POST /tborder/request HTTP/1.1
Host: localhost:3001
Connection: keep-alive
Content-Length: 367
Accept: application/json, text/javascript, */*; q=0.01
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36
Content-Type: application/json; charset=UTF-8
Origin: https://happ
{
"account-name": "tb50****64044",
"isLogin": true,
"orders": [
{
"latestLogistics": "2023-04-14 14:55:31 包裹正在等待揽收",
"logisticsCompany": "韵达快递",
"logisticsNumber": "4331709***903797",
"logisticsStatus": "待揽收",
"logisticsStatusCode": "CONSIGN",
"orderId": "1868708569429265283",
"sendTime": "2023-04-14 14:55:31"
},
{
"orderId": "1868755226357265283"
}
],
"extra": null
}
返回数据格式二(根据订单编号)
特别提醒
同一批查询订单里不要连续出现相同的orderId
返回头示例
HTTP/1.1 200 OK
Content-Length: 255
Last-Modified: Fri, 14 Apr 2023 08:24:47 GMT
Cache-Control: max-age=0
Content-Type: application/json; charset=utf-8
{
"success": 1,
"errcode": "",
"errmsg": "",
"order_query": {
"extra": null,
"orderList": [
{
"orderId": "1868708569429265283"
},
{
"orderId": "1868755226357265283"
}
]
}
}
常见问题
工作过程中切换账号
- 点击控制面板,使左侧边栏隐藏
- 退出当前用户
- 登录其他用户,再次点击控制面板显示左侧栏