联调示例(路径 B 一站式)
下列命令把 demo / pass123 换成真实账号。先算好 sid 与 sign(见「身份认证」)。Base:https://api.fahuomao.com
0. 健康检查
curl -s 'https://api.fahuomao.com/api/health'
1. 生成签名(bash 示例)
USER=demo
PASS=pass123
SID=$(date +%s)
SIGN=$(printf '%s' "${USER}${PASS}${SID}" | md5sum | awk '{print $1}')
echo "sid=$SID sign=$SIGN"
2. 拉快递列表
curl -s -X POST 'https://api.fahuomao.com/api/lipin/list' \
-d "username=${USER}&sid=${SID}&sign=${SIGN}"
# 从 data 中找 is_wxspinhao=1,记下 kuaidi_id、wx_supplier_id
3. 商家微信侧关联后 · 审核
# 重新生成 sid/sign(每次请求建议刷新)
SID=$(date +%s); SIGN=$(printf '%s' "${USER}${PASS}${SID}" | md5sum | awk '{print $1}')
curl -s -X POST 'https://api.fahuomao.com/api/lipin/wx_sph_accept' \
-d "username=${USER}&sid=${SID}&sign=${SIGN}&merchant_appid=wx商家小店AppID"
4.(可选)BT1 绑店
# 商家打开 https://fahuomao.com/api/shopauth 复制 BT1
SID=$(date +%s); SIGN=$(printf '%s' "${USER}${PASS}${SID}" | md5sum | awk '{print $1}')
curl -s -X POST 'https://api.fahuomao.com/api/lipin/wx_sph_bind' \
-d "username=${USER}&sid=${SID}&sign=${SIGN}&bind_token=BT1.xxxx.xxxx"
5. 微信侧分配代发后 · 下单
SID=$(date +%s); SIGN=$(printf '%s' "${USER}${PASS}${SID}" | md5sum | awk '{print $1}')
curl -s -X POST 'https://api.fahuomao.com/api/lipin/buy' \
-H 'Content-Type: application/json' \
-d "{
\"username\": \"${USER}\",
\"sid\": \"${SID}\",
\"sign\": \"${SIGN}\",
\"kuaidi_id\": 12,
\"cang_id\": 1,
\"goods_id\": 100,
\"platform\": 6,
\"send_name\": \"发件人\",
\"send_mobile\": \"13800138000\",
\"rec_list\": [{
\"order_sn\": \"PARTNER001\",
\"shop_order\": \"372xxxxxxxxxxxx\",
\"shop_appid\": \"wx商家小店AppID\",
\"rec_name\": \"张三\",
\"rec_mobile\": \"13900139000\",
\"rec_province\": \"广东省\",
\"rec_city\": \"深圳市\",
\"rec_district\": \"南山区\",
\"rec_address\": \"科技园1号\"
}]
}"
6. 轮询查单
SID=$(date +%s); SIGN=$(printf '%s' "${USER}${PASS}${SID}" | md5sum | awk '{print $1}')
curl -s -X POST 'https://api.fahuomao.com/api/lipin/status' \
-H 'Content-Type: application/json' \
-d "{
\"username\": \"${USER}\",
\"sid\": \"${SID}\",
\"sign\": \"${SIGN}\",
\"order_sn\": [\"PARTNER001\"]
}"
7. 路径 A · 品牌站 BT1 / Token 示例
# 消费 BT1 curl -s -X POST 'https://fahuomao.com/api/bind_ticket/consume' \ -d 'ticket=BT1.xxxx.xxxx' # 供货商 Token 续期(须尾斜杠;key=去使用页取票密钥) curl -s 'https://fahuomao.com/api/supplierauth/token/?appid=wx供货商AppID&key=fhm_去使用页密钥'
Windows 可用 Git Bash / WSL 跑上述 bash;或在 Postman 里按同样字段组请求。每次请求请重新计算
sid/sign。