代发订单发货
微信小店代发 - 订单发货(Dropship Order Send)
一、接口名称
接口 URL:https://kf.fw199.com/gateway/wxstore/df/logistics/online
请求方式:POST
Content-Type:application/json
二、请求参数
| 参数名 | 类型 | 是否必需 | 说明 | 示例值 |
|---|---|---|---|---|
| **appid** | string | **是** | 开发者分配的 AppID | `Config.AppId` |
| **seller_nick** | string | **是** | 供货商 OpenID,应用首页获取 (对应业务字段 ownerId) | `f524edc1-c2fa-47b0-bfea-f05bbcb14a9a` |
| **timestamp** | string | **是** | 毫秒级时间戳 | `1713824000000` |
| **sign** | string | **是** | 请求参数签名字符串 | `682bc45f6d54d28e6664aec2ace60990` |
| **ds_order_id** | string | **是** | 代发订单号 | `4435896307942968320` |
| **delivery_list** | array | **是** | 物流信息对象列表 | - |
| └─ **delivery_id** | string | **是** | 快递公司 ID(如 ZTO, SF) | `ZTO` |
| └─ **waybill_id** | string | **是** | 快递单号 | `73612959240139` |
| └─ **deliver_type** | number | **是** | 发货方式,1: 自寄快递发货 | `1` |
| └─ **product_infos** | array | **是** | 商品明细列表 | - |
| └─ **product_id** | string | **是** | 商品 ID | `63` |
| └─ **sku_id** | string | **是** | 商品 SKU | `82` |
| └─ **product_cnt** | number | **是** | 商品数量 | `2` |
示例请求
{ "ownerId": "a877d3bd-cb6c-467a-becf-ea3db501c0d1", "ds_order_id": "4435896307942968320", "delivery_list": [ { "delivery_id": "SF", "waybill_id": "SF73612959240139", "deliver_type": 1, "product_infos": [ { "product_id": "10000741839533", "sku_id": "12739225212", "product_cnt": 1 }
] } ] }三、请求示例代码
Java
import org.junit.Test;import java.util.HashMap;import java.util.Map;import java.util.ArrayList;import java.util.List;import com.alibaba.fastjson.JSON;
public class WxstoreDfLogisticsOnlineTest {
@Test public void dfLogisticsOnline() throws Exception {
String apiUrl = "https://kf.fw199.com/gateway/wxstore/df/logistics/online"; // 供货商openid String sellerNick = "f524edc1-c2fa-47b0-bfea-f05bbcb14a9a";
// 准备业务请求参数 String reqData = "{\n" + " \"ownerId\": \"a877d3bd-cb6c-467a-becf-ea3db501c0d1\",\n" + " \"ds_order_id\": \"4435896307942968320\",\n" + " \"delivery_list\": [\n" + " {\n" + " \"delivery_id\": \"SF\",\n" + " \"waybill_id\": \"SF73612959240139\",\n" + " \"deliver_type\": 1,\n" + " \"product_infos\": [\n" + " {\n" + " \"product_id\": \"10000741839533\",\n" + " \"sku_id\": \"12739225212\",\n" + " \"product_cnt\": 1\n" + " }\n" + " \n" + " ]\n" + " }\n" + " ]\n" + " }";
data.put("request_data", reqData)); // 参数签名 data.put("sign", Utils.Sign(data, Config.AppSecret));
// 发送请求 String result = doHttpRequest(apiUrl, data); System.out.println("result:" + result); }}四、 返回结果
成功
{ "code": 10000, "message": "success", "result": { "status": true, "message": "ok" }}失败
{ "code": 9999, "message": "请使用电子面单发货 | 代发单需使用微信小店“电子面单”运单号发货。新运单号同步可能延迟,可稍后重试。 rid: 69eddb25-2f3de59f-78c0bb16", "trace_id": ""}