获取订单详情
查询单个订单详情(只能获取到成交时间三个月以内的交易信息) 注:虚拟订单充值手机号信息无法通过此接口获取,请联系虚拟类目运营人员。
1.请求参数:
参数名 | 类型 | 说明 | 示例 |
---|---|---|---|
appid | String | 合作伙伴AppId | uwkahf@jfs92 |
timestamp | String | 当前时间戳 | |
seller_nick | String | 拼多多卖家账号,非店铺名称 | kingdo |
order_sn | String | 必填 订单号 | 3231214234141421 |
sign | String | 接口签名 | 如何计算生成见示例代码 |
2. 请求示例代码(Java)
/**
* 获取订单详情
* @throws Exception
*/
@Test
public void getOrderDetail() throws Exception {
String result ="";
String seller_nick = Config.PddSellerNick ; // 拼多多卖家账号
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost( Config.PddOrderV2DetailUrl );
//业务参数
Map<String, String> data = new HashMap<String, String>();
data.put("appid", Config.AppId);
data.put("seller_nick", seller_nick);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
// 必填 ,订单号
data.put("order_sn", "201221-024356457322221");
// 参数签名
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": {
"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包含订单列表的相关信息。
接口返回字段说明请移步: 拼多多订单详情字段说明
文档更新时间: 2024-06-07 13:54 作者:admin