跳转到内容
返回官网

订单发货

实物发货接口

订单发货通知

一、请求参数

POST https://kf.fw199.com/gateway/pdd/logistices/onlinesend

参数名类型说明示例
appidString必填,合作伙伴AppIduwkahf@jfs92
timestampString必填,当前时间戳
seller_nickString必填,拼多多卖家账号,非店铺名称kingdo
signString必填,接口签名如何计算生成见示例代码
order_snString必填 ,订单号3231214234141421
logistics_idString必填,快递公司编号,必填, 可通过查询快递公司列表获取,注意是Id不是code
tracking_numberString必填,快递单号 ,具体一个物流公司的真实运单号码。
featureString非必填,发货个性内容, 支持imei(手机串号),deviceSn(设备序列号)内容。
refund_address_idString非必填 , 退货地址的id,不填则取商家默认地址
redelivery_typeint非必填 , 修改发货模式:不传则默认为首次发货 1=首次发货:用于订单首次发货,仅待发货订单可传入; 2=修改发货:用于订单修改发货,调用成功后将会覆盖原发货信息,仅已发货订单可传入

二、请求示例代码

Java

@Test
public void logisticesCompanyOnineSend() throws Exception {
String result ="";
String sellerNick = Config.PddSellerNick ; // 拼多多卖家
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost( Config.PddLogisticesOnlineSendUrl );
//业务参数
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());
// 订单号 ,必填
data.put("order_sn", "200807-059090043922507");
// 快递公司编号,必填, 可通过查询快递公司列表获取,注意是Id不是code
data.put("logistics_id","121"); //121 yunda
// 快递单号,必填
data.put("tracking_number","4307495240153");
// 发货个性内容,非必填。 支持imei(手机串号),deviceSn(设备序列号)内容。
// 形如:imei=11,22,3333; 以 “imei=” 开头,以英文分号“;”结尾,中间为手机IMEI串号信息,多个串号以英文逗号 “,”拼接释义:该订单包含三个手机IMEI串号,分别为11、22和3333;其他内容的格式同理。
data.put("feature","");
// 退货地址的id,不填则取商家默认地址, 非必填
data.put("refund_address_id","");
data.put("redelivery_type","1");
// 参数签名
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);
}

三、返回结果

{"code":0,"message":"ok","data":true}

说明: code为0表示成功,非0为失败,message会包含失败原因。失败时一定要注意,可能商户授权过期,或是参数有误。

四、常见问题

四(一)、订单发货通知接口,调用报错“接口超时,XX秒后重试”,怎么办?

当使用淘宝或其他平台的快递单号在拼多多里发货时会出现这情况, 这是拼多多对外部单号进行发货的随机拦截。建议如果拼多多的订单使用拼多多的面单进行取号发货。 见详细说明:https://open.pinduoduo.com/application/faq?id=FEE4B0E5E90F1AC2