获取增量订单列表
查询订单增量,注:虚拟订单充值手机号信息无法通过此接口获取,请联系虚拟类目运营人员。 拉取卖家已卖出的增量交易数据(只能获取到成交时间三个月以内的交易信息) ①. 一次请求只能查询时间跨度为30分钟的增量交易记录,即end_updated_at - start_updated_at<= 30min。 ②. 通过从后往前翻页的方式以及结束时间不小于拼多多系统时间前3min可以避免漏单问题。
1.请求参数:
参数名 | 类型 | 说明 | 示例 |
---|---|---|---|
appid | String | 合作伙伴AppId | uwkahf@jfs92 |
timestamp | String | 当前时间戳 | |
seller_nick | String | 拼多多卖家账号,非店铺名称 | kingdo |
order_status | int | 必填 发货状态,1:待发货,2:已发货待签收,3:已签收 5:全部 | 3231214234141421 |
refund_status | int | 必填 售后状态 1:无售后或售后关闭,2:售后处理中,3:退款中,4: 退款成功 5:全部 | |
start_updated_at | long | 必填,最后更新时间开始时间的时间戳,指格林威治时间 1970 年01 月 01 日 00 时 00 分 00 秒(北京时间 1970 年 01 月 01 日 08 时 00 分 00 秒)起至现在的总秒数 | |
end_updated_at | long | 必填,最后更新时间结束时间的时间戳,指格林威治时间 1970 年 01 月 01 日 00 时 00 分 00 秒(北京时间 1970 年 01 月 01 日 08 时 00 分 00 秒)起至现在的总秒数 PS:开始时间结束时间间距不超过 30 分钟 | |
is_lucky_flag | int | 必填,订单类型(是否抽奖订单),0-全部,1-非抽奖订单,2-抽奖订单 | |
page | int | 必填 ,返回页码,默认 1,页码从 1 开始 PS:当前采用分页返回,数量和页数会一起传,如果不传,则采用 默认值;注:必须采用倒序的分页方式(从最后一页往回取)才能避免漏单问题。 | |
page_size | int | 必填, 返回数量, 最大500, 每100为一个阶梯 | |
trade_type | int | 非必填 ,订单类型 0-普通订单 ,1- 定金订单 | |
use_has_next | bool | 非必填, 是否启用has_next的分页方式,如果指定true,则返回的结果中不包含总记录数,但是会新增一个是否存在下一页的的字段,通过此种方式获取增量交易,效率在原有的基础上有80%的提升。 | |
sign | String | 接口签名 | 如何计算生成见示例代码 |
2. 请求示例代码(Java)
@Test
public void getPddOrderListIncrement() throws Exception {
String result ="";
String sellerNick = Config.PddSellerNick ; // 拼多多卖家
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost( Config.PddOrderListUrl );
//业务参数
Map<String, String> data = new HashMap<String, String>();
data.put("appid", Config.AppId);
data.put("seller_nick", sellerNick);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
// 必填 订单类型(是否抽奖订单),0-全部,1-非抽奖订单,2-抽奖订单
data.put("is_lucky_flag", "0");
// 必填 发货状态,1:待发货,2:已发货待签收,3:已签收 5:全部
data.put("order_status", "5");
// 必填 售后状态 1:无售后或售后关闭,2:售后处理中,3:退款中,4: 退款成功 5:全部
data.put("refund_status", "5");
// 必填,成交时间开始时间的时间戳,指格林威治时间 1970 年 01 月 01 日 00 时 00 分 00 秒(北京时间 1970 年 01 月 01 日 08 时 00 分 00 秒)起至现在的总秒数
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.set(Calendar.MINUTE, calendar.get(Calendar.MINUTE) - 30);
long startDate = calendar.getTime().getTime() / 1000;
data.put("start_updated_at", String.valueOf(startDate)); // 秒数: 1610301600
// 必填,成交时间结束时间的时间戳,指格林威治时间 1970 年 01 月 01 日 00 时 00 分 00 秒(北京时间 1970 年 01 月 01 日 08 时 00 分 00 秒)起至现在的总秒数 PS:开始时间结束时间间距不超过 30分钟
long endDate = new Date().getTime() / 1000 ;
data.put("end_updated_at", String.valueOf(endDate)); // 秒数: 1610301900
// 必填 返回页码 默认 1,页码从 1 开始 PS:当前采用分页返回,数量和页数会一起传,如果不传,则采用 默认值
data.put("page", "1");
data.put("page_size", "30");
// 非必填 订单类型 0-普通订单 ,1- 定金订单
data.put("trade_type", "");
// 非必填 是否启用has_next的分页方式,如果指定true,则返回的结果中不包含总记录数,但是会新增一个是否存在下一页的的字段,通过此种方式获取增量交易,效率在原有的基础上有80%的提升。
data.put("use_has_next", "false");
// 参数签名
data.put("sign", Utils.Sign(data,Config.AppSecret));
doHttpRequest( Config.PddOrderListIncrementUrl, data);
}
3. 返回结果如下:
{
"code": 0,
"message": "ok",
"data": {
"has_next": false,
"order_sn_list": [{
"address": "~AgAAAACsR/YHv69wiQA3Il26q1OlNA4P45gjN0m+VZxXGtaR13QsuwQ+hUdTQTtVDPm21nuMmgCs8yNCaYJ1kQuK69nHbbR6FvEgpTFC9/w=~qcK29hqe28qdqcK29hqeiuryim3R/hBE/6qd+OmHnAcOCnvZBKe6+Os8CPzrXB4Q57wwFRst~0~~",
"address_mask": "上海市上海市浦东新区商城路*号*",
"after_sales_status": 0,
"buyer_memo": "",
"capital_free_discount": 0,
"card_info_list": [],
"cat_id_1": 16901,
"cat_id_2": 18055,
"cat_id_3": 18056,
"cat_id_4": 0,
"city": "上海市",
"city_id": 321,
"confirm_status": 1,
"confirm_time": "2021-03-04 09:34:57",
"country": "中国",
"country_id": 0,
"created_time": "2021-03-04 09:34:50",
"delivery_one_day": 0,
"discount_amount": 3,
"duoduo_wholesale": 0,
"free_sf": 0,
"goods_amount": 15,
"group_status": 1,
"home_delivery_type": 0,
"id_card_name": "",
"id_card_num": "",
"inner_transaction_id": "",
"invoice_status": 0,
"is_lucky_flag": 1,
"is_pre_sale": 0,
"is_stock_out": 0,
"item_list": [{
"goods_count": 1,
"goods_id": 160210883299,
"goods_img": "https://t16img.yangkeduo.com/garner-api/70ec7360c13688309252f88a9ce49965.jpeg",
"goods_name": "A4白纸一张十圆不支持退货,不要乱拍!",
"goods_price": 15,
"goods_spec": "50cm",
"outer_goods_id": "g100",
"outer_id": "s50cm",
"sku_id": 648106686604
}],
"gift_list": [],
"last_ship_time": "2021-03-06 09:34:57",
"logistics_id": 0,
"mkt_biz_type": 0,
"only_support_replace": 0,
"order_change_amount": 0,
"order_sn": "210304-155155172182221",
"order_status": 1,
"order_tag_list": [{
"name": "delivery_one_day",
"value": 0
}, {
"name": "no_trace_delivery",
"value": 0
}, {
"name": "self_contained",
"value": 0
}, {
"name": "return_freight_payer",
"value": 0
}, {
"name": "free_sf",
"value": 0
}, {
"name": "duoduo_wholesale",
"value": 0
}, {
"name": "support_nationwide_warranty",
"value": 0
}, {
"name": "only_support_replace",
"value": 0
}, {
"name": "oversea_tracing",
"value": 0
}],
"pay_amount": 12,
"pay_no": "",
"pay_time": "2021-03-04 09:34:57",
"pay_type": "",
"platform_discount": 3,
"postage": 0,
"pre_sale_time": "",
"province": "上海市",
"province_id": 25,
"receive_time": "",
"receiver_address": "~AgAAAACsR/YIv69wiQAnfdBVJo7VNKsuJ1noy3BduOEf0FgKUf5NTDtyfm9FVX6M~nAcOCnvZBKe6+Os8CPzrXB4Q57wwFRst~0~~",
"receiver_address_mask": "商城路*号*",
"receiver_name": "~AgAAAACsR/YFv69wiQBAYE9PbobjNOg/qhu758WDWOk=~7rDNKhB7n0mq~0~~",
"receiver_name_mask": "M*r",
"receiver_phone": "$j6CIhOBvrLmR$AgAAAACsR/YGv69wiQCEF4g5jIkySW5vDVDOB3sHLho=$0$$",
"receiver_phone_mask": "17*******75",
"refund_status": 1,
"remark": "aaf ",
"remark_tag": 1,
"return_freight_payer": 0,
"risk_control_status": 0,
"self_contained": 0,
"seller_discount": 0,
"shipping_time": "",
"shipping_type": 0,
"stock_out_handle_status": -1,
"street": "",
"support_nationwide_warranty": 0,
"town": "浦东新区",
"town_id": 2707,
"tracking_number": "",
"trade_type": 0,
"updated_at": "2021-05-26 17:41:41",
"urge_shipping_time": "",
"yyps_date": "",
"yyps_time": "",
"open_address_id":"mEBYxjcYbLtEMsZrgG9phKxYom+BNtkY0hovKsJgDvmbRiscUT9aqfvmieRS/Edu"
}, {
"address": "~AgAAAACsR/YHKKS3PwCCKq1n+1fzdFA8Cb2NVYTzW50DdsnWHUg9Pc6RaUgPtJUEzlz8ED+PZmM3UJrwDZ+SA/36Yg9aNSFUd3gcX0wZ/gA=~qcK29hqe28qdqcK29hqeiuryim3R/hBE/6qd+OmHnAcOCnvZBKe6+Os8CPzrXB4Q57wwFRst~0~~",
"address_mask": "上海市上海市浦东新区商城路*号*",
"after_sales_status": 0,
"buyer_memo": "",
"capital_free_discount": 0,
"card_info_list": [],
"cat_id_1": 16901,
"cat_id_2": 18055,
"cat_id_3": 18056,
"cat_id_4": 0,
"city": "上海市",
"city_id": 321,
"confirm_status": 1,
"confirm_time": "2021-03-24 17:13:08",
"country": "中国",
"country_id": 0,
"created_time": "2021-03-24 17:13:01",
"delivery_one_day": 0,
"discount_amount": 0,
"duoduo_wholesale": 0,
"free_sf": 0,
"goods_amount": 15,
"group_status": 1,
"home_delivery_type": 0,
"id_card_name": "",
"id_card_num": "",
"inner_transaction_id": "",
"invoice_status": 0,
"is_lucky_flag": 1,
"is_pre_sale": 0,
"is_stock_out": 0,
"item_list": [{
"goods_count": 1,
"goods_id": 160210883299,
"goods_img": "https://t16img.yangkeduo.com/garner-api/70ec7360c13688309252f88a9ce49965.jpeg",
"goods_name": "A4白纸一张十圆不支持退货,不要乱拍!",
"goods_price": 15,
"goods_spec": "50cm",
"outer_goods_id": "g100",
"outer_id": "s50cm",
"sku_id": 648106686604
}],
"gift_list": [],
"last_ship_time": "2021-03-26 17:13:08",
"logistics_id": 0,
"mkt_biz_type": 0,
"only_support_replace": 0,
"order_change_amount": 0,
"order_sn": "210324-137383117442221",
"order_status": 1,
"order_tag_list": [{
"name": "delivery_one_day",
"value": 0
}, {
"name": "no_trace_delivery",
"value": 0
}, {
"name": "self_contained",
"value": 0
}, {
"name": "return_freight_payer",
"value": 0
}, {
"name": "free_sf",
"value": 0
}, {
"name": "duoduo_wholesale",
"value": 0
}, {
"name": "support_nationwide_warranty",
"value": 0
}, {
"name": "only_support_replace",
"value": 0
}, {
"name": "oversea_tracing",
"value": 0
}],
"pay_amount": 15,
"pay_no": "",
"pay_time": "2021-03-24 17:13:08",
"pay_type": "",
"platform_discount": 0,
"postage": 0,
"pre_sale_time": "",
"province": "上海市",
"province_id": 25,
"receive_time": "",
"receiver_address": "~AgAAAACsR/YIKKS3PwA3JVMf0Ua1hDqXqG0r39kxun6LLa9+2wQwPkH4jJzF4ymv~nAcOCnvZBKe6+Os8CPzrXB4Q57wwFRst~0~~",
"receiver_address_mask": "商城路*号*",
"receiver_name": "~AgAAAACsR/YFKKS3PwAt3d0fdccQIQAIJn2C0FRsIlM=~7rDNKhB7n0mq~0~~",
"receiver_name_mask": "M*r",
"receiver_phone": "$j6CIhOBvrLmR$AgAAAACsR/YGKKS3PwCdVVLq1QKSVQ2S7Ooe2aoUM5U=$0$$",
"receiver_phone_mask": "17*******75",
"refund_status": 1,
"remark": "我是通过API接口进来的说明哈22222xx",
"remark_tag": 2,
"return_freight_payer": 0,
"risk_control_status": 0,
"self_contained": 0,
"seller_discount": 0,
"shipping_time": "",
"shipping_type": 0,
"stock_out_handle_status": -1,
"street": "",
"support_nationwide_warranty": 0,
"town": "浦东新区",
"town_id": 2707,
"tracking_number": "",
"trade_type": 0,
"updated_at": "2021-05-26 17:41:34",
"urge_shipping_time": "",
"yyps_date": "",
"yyps_time": "",
"open_address_id":"mEBYxjcYbLtEMsZrgG9phKxYom+BNtkY0hovKsJgDvmbRiscUT9aqfvmieRS/Edu"
}],
"request_id": "16220229195614651",
"total_count": 2
}
}
说明: code为0表示成功,非0为失败,message会包含失败原因。失败时一定要注意,可能商户授权过期,或是参数有误。 成功时,data包含订单列表的相关信息。
详细字段说明请移步:拼多多订单列表字段说明
文档更新时间: 2024-06-07 13:56 作者:admin