华商城开放 API 对外开放数据接口。统一入口 POST /api.php,body 携带 action 区分端点。商品 · 订单 · 店铺 · 溯源 · 权益 · 佣金 · 授信,一站打通。
Swagger UI 在线浏览全部接口,填入密钥即可 Try it out 直接试调。
打开交互式文档 →接入三步、签名算法详解、客户端示例代码、一键生成 SDK。
查看接入指南 →今日端点状态、调用统计与服务健康度实时看板。
查看接入状态 →登录华商城 → 开发者中心,提交入驻申请。审核通过后签发 X-Api-Key 与 X-Api-Secret,Secret 仅展示一次,请妥善保管。
每个请求头携带 X-Api-Key + X-Api-Secret。写操作(发货、收款确认等)另需 HMAC 签名。
读端点返回商品、订单、店铺、溯源等数据;商家写端点支持发货、确认线下收款,沙箱模式可安全试调。
请求头携带 X-Api-Key(开发者中心签发的 Key)与 X-Api-Secret(成对的 Secret,服务端时序安全比较)。
写操作额外强制 X-Timestamp(秒级时间戳,±300 秒窗口)、X-Nonce(随机串,一次性防重放)、X-Signature(HMAC-SHA256 签名)。
按 Key 每分钟配额(套餐决定),超限返回 429;IP 级每分钟 600 次封顶,防单 IP 高频刷取。
sign = HMAC-SHA256(api_secret, base),其中 base 用换行符拼接:
其中 timestamp 为秒级时间戳,nonce 为随机串(每次请求不同),HTTP 方法为大写(GET/POST),请求路径为 /api.php。
curl -X POST https://vip.wscmall.com/api.php \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Api-Secret: YOUR_API_SECRET" \
-d '{"action":"open.products","page":1,"pageSize":20,"sort":"sales"}'$ts = (string)time();
$nonce = bin2hex(random_bytes(16));
$method = 'POST';
$path = '/api.php';
$base = $ts . "\n" . $nonce . "\n" . $method . "\n" . $path;
$sign = hash_hmac('sha256', $base, $apiSecret);
$headers = [
'Content-Type: application/json',
'X-Api-Key: ' . $apiKey,
'X-Api-Secret: ' . $apiSecret,
'X-Timestamp: ' . $ts,
'X-Nonce: ' . $nonce,
'X-Signature: ' . $sign,
];
$body = json_encode(['action' => 'open.merchant_ship', 'order_id' => 123,
'express_company' => '顺丰速运', 'express_no' => 'SF1234567890']);
$ch = curl_init('https://vip.wscmall.com/api.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);import hmac, hashlib, time, secrets, requests
ts = str(int(time.time()))
nonce = secrets.token_hex(16)
base = f"{ts}\n{nonce}\nPOST\n/api.php"
sign = hmac.new(api_secret.encode(), base.encode(), hashlib.sha256).hexdigest()
headers = {
"Content-Type": "application/json",
"X-Api-Key": api_key,
"X-Api-Secret": api_secret,
"X-Timestamp": ts,
"X-Nonce": nonce,
"X-Signature": sign,
}
resp = requests.post("https://vip.wscmall.com/api.php",
json={"action": "open.merchant_ship", "order_id": 123,
"express_company": "顺丰速运", "express_no": "SF1234567890"},
headers=headers)
print(resp.json())const crypto = require('crypto');
const ts = String(Math.floor(Date.now() / 1000));
const nonce = crypto.randomBytes(16).toString('hex');
const base = `${ts}\n${nonce}\nPOST\n/api.php`;
const sign = crypto.createHmac('sha256', apiSecret).update(base).digest('hex');
const resp = await fetch('https://vip.wscmall.com/api.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': apiKey,
'X-Api-Secret': apiSecret,
'X-Timestamp': ts,
'X-Nonce': nonce,
'X-Signature': sign,
},
body: JSON.stringify({ action: 'open.merchant_ship', order_id: 123,
express_company: '顺丰速运', express_no: 'SF1234567890' })
});
console.log(await resp.json());{ "success": bool, "msg": string, "data": ... },非 2xx 时 success 为 false。| 状态码 | 含义 | 处理建议 |
|---|---|---|
200 | 成功 | 读取 data 字段 |
400 | 参数错误 | 检查 body 中的 action 与参数 |
401 | 鉴权失败 / 签名错误 / 时间戳超时 | 核对 Key、Secret 与签名算法,时间戳 ±300 秒内 |
403 | 无权限(开发者未通过审核 / 未绑定店铺) | 完成入驻审核并绑定有效店铺 |
404 | 接口不存在 / 资源不存在 | 核对 action 名称与资源 id |
429 | 调用频率超限 | 降低频率或升级套餐提升配额 |
500 | 服务器异常 | 稍后重试,系统已自动告警 |