获取订单列表
根据成团时间查询订单列表(只能获取到成交时间三个月以内的交易信息) 注:虚拟订单充值手机号信息无法通过此接口获取,请联系虚拟类目运营人员。
1.请求参数:
参数名 | 类型 | 说明 | 示例 |
---|---|---|---|
appid | String | 合作伙伴AppId | uwkahf@jfs92 |
timestamp | String | 当前时间戳 | |
seller_nick | String | 拼多多卖家账号,非店铺名称 | kingdo |
order_status | String | 必填 发货状态,1:待发货,2:已发货待签收,3:已签收 5:全部 | 3231214234141421 |
refund_status | String | 必填 售后状态 1:无售后或售后关闭,2:售后处理中,3:退款中,4: 退款成功 5:全部 | |
start_confirm_at | String | 必填,成交时间开始时间的时间 ,格式yyyy-MM-dd HH:mm:ss , 类似 2021-01-03 00:00:00 | |
end_confirm_at | String | 成交完成时间 ,格式yyyy-MM-dd HH:mm:ss ,类似 2021-01-03 00:00:00 | |
page | String | 必填 返回页码 默认 1,页码从 1 开始 PS:当前采用分页返回,数量和页数会一起传 | |
page_size | String | 返回数量, 最大 30 | |
remark_tag | String | 订单备注标记,1-红色,2-黄色,3-绿色,4-蓝色,5-紫色, 传空串代表全部标记 | |
sign | String | 接口签名 | 如何计算生成见示例代码 |
2. 请求示例代码(Java)
@Test
public void getOrderList() throws Exception {
String result ="";
String tb_seller_nick = Config.PddSellerNick ; // 拼多多卖家
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost( Config.PddOrderV2ListUrl );
//业务参数
Map<String, String> data = new HashMap<String, String>();
data.put("appid", Config.AppId);
data.put("seller_nick", tb_seller_nick);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
// 必填 发货状态,1:待发货,2:已发货待签收,3:已签收 5:全部
data.put("order_status", "5");
// 必填 售后状态 1:无售后或售后关闭,2:售后处理中,3:退款中,4: 退款成功 5:全部
data.put("refund_status", "5");
// 注意日期格式
data.put("start_confirm_at", "2021-01-03 00:00:00");
// 注意日期格式
data.put("end_confirm_at", "2021-04-03 00:00:00" );
// 必填 返回页码 默认 1,页码从 1
data.put("page", "1");
// 必填 返回数量, 最大 30
data.put("page_size", "30");
// 传空为全部, 订单备注标记,1-红色,2-黄色,3-绿色,4-蓝色,5-紫色
data.put("remark_tag", "");
// 参数签名
data.put("sign", Utils.Sign(data,Config.AppSecret));
List<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();
for (Map.Entry<String, String> entry : data.entrySet()) {
params.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
}
//发起POST请求
try {
httpPost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
HttpResponse httpResponse = httpclient.execute(httpPost);
if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
result = EntityUtils.toString(httpResponse.getEntity());
} else {
result = ("doPost Error Response: " + httpResponse.getStatusLine().toString());
}
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(result);
3. 返回结果如下:
{
"code": 0,
"message": "ok",
"data": {
"total": 1, // 总记录数
"items": [{
"address": "~AgAAAACjmWAHZ1vG5AFznCAFMfGq0FCxSSi+wJ44i5Nh9Y/Ucn4YFvHbH6k57UDR8R6Jnt/j9m/zoKB2Upz1k1whSLS0rC3d8UfdgzABf99tn658X4o/7V6KJjhw+f/v~iTTv/yU1qxpSiTTv/yU1NVJoOyjyjIYbBf9Z+VkF4Uc5fqNUxr5Sntd4fXM7UZAPXpVNVVXr~1~~",
"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-17 19:16:30",
"country": "中国",
"country_id": 0,
"created_time": "2021-03-17 19:16:21",
"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
}],
"last_ship_time": "2021-03-19 19:16:30",
"logistics_id": 0,
"mkt_biz_type": 0,
"only_support_replace": 0,
"order_change_amount": 0,
"order_sn": "210317-001532562392221",
"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-17 19:16:30",
"pay_type": "",
"platform_discount": 0,
"postage": 0,
"pre_sale_time": "",
"province": "上海市",
"province_id": 25,
"receive_time": "",
"receiver_address": "~AgAAAACjmWAIZ1vG5AG+pNSXy3yNfQqkPwX83TI8H0IYyf0f3qi8Bdzs2b5+nfKniLc2NB+tLVUhUMWwHkN8dg==~4Uc5fqNUxr5Sntd4fXM7UZAPXpVNVVXr~1~~",
"receiver_address_mask": "东方路*号*",
"receiver_name": "~AgAAAACjmWAFZ1vG5ABcHJJ+v1G1LcKH2BRzsYjGe/s=~niqTGhCNifXk~1~~",
"receiver_name_mask": "M*k",
"receiver_phone": "$WsuJt4Yh3K7a$AgAAAACjmWAGZ1vG5ABLUicfAzPuXzSdjyz1biPoE6E=$1$$",
"receiver_phone_mask": "17*******75",
"refund_status": 1,
"remark": "最近运流没有了,要晚点发222",
"remark_tag": 5, // 卖家旗帜
"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-03-20 11:21:18",
"urge_shipping_time": "",
"yyps_date": "",
"yyps_time": "",
"open_address_id":"mEBYxjcYbLtEMsZrgG9phKxYom+BNtkY0hovKsJgDvmbRiscUT9aqfvmieRS/Edu"
}]
}
}
说明: code为0表示成功,非0为失败,message会包含失败原因。失败时一定要注意,可能商户授权过期,或是参数有误。 成功时,data包含订单列表的相关信息。
详细字段说明请移步:拼多多订单列表字段说明
4. 常见问题
4.1 这个接口没有返回has_next字段, 如何判断是否还有下一页
A: 接口返回total字段表示是总记录数 。 总页数totalPages = Math.ceil( total / pageSize); //向上取整,除不尽的时候都向上取整, 如果当前页currentPage < 总页数totalPages, 就可以有下一页。
文档更新时间: 2024-06-07 13:57 作者:admin