Qeasy Cloud
Get Started
POSThttps://api.wangdian.cn/openapi2/{接口服务名}.phpsid + appkey + MD5 签名

Common Parameters and MD5 Signing

旺店通企业版 OpenAPI 的鉴权方式:每个接口 URL 指向独立 .php 服务,公共参数 sid、appkey、timestamp、sign 必不可少,sign 为排序拼接后首尾加 secret 的 MD5。

## Overview The WDT Enterprise (Qiyebang) OpenAPI is REST-flavored: every business interface is its own .php endpoint (trade_query.php, stock_query.php, ...) under sandbox.wangdian.cn (test) or api.wangdian.cn (production). Requests are POST with application/x-www-form-urlencoded. There is no token issuance — each call authenticates itself with common parameters plus an MD5 signature. ### Common parameters | Parameter | Meaning | | --- | --- | | sid | Seller account (the WDT login account) | | appkey | Application key issued when API authorization is granted | | timestamp | Seconds from 1970-01-01 08:00:00 Asia/Shanghai to now; ±5 minutes tolerated | | sign | Signature | ### Signing steps 1. Take every request parameter except sign (common + business) and sort ascending by name. 2. Concatenate as key1value1key2value2 without URL-encoding. 3. Prepend and append the interface secret. 4. MD5 the final string (32-char hex) — that is the sign. ### Pitfalls - timestamp is a Beijing-timezone epoch, not the standard Unix epoch — the classic trap for servers in other timezones. - Pagination parameters (pageno/pagesize) join the signature too; any change requires re-signing. - Signature errors, invalid sid and missing API permission surface in the status/message fields of the response and deserve distinct alerting.

Code examples

pseudo
params = { sid, appkey, timestamp, ...bizParams }
keys  = sortAsc(params.keys)
base  = concat(k + params[k] for k in keys)
sign  = md5(secret + base + secret)   // 32 位 hex
POST https://api.wangdian.cn/openapi2/trade_query.php
Content-Type: application/x-www-form-urlencoded

Error codes

CodeMessageMeaning
100sign 校验失败签名错误:检查排序、拼接与 secret,以及 timestamp 时区口径
102appkey 无权限该 appkey 未开通目标接口授权,需在旺店通后台申请
105timestamp 过期请求时间与服务器偏差超过 5 分钟,校准调用方时钟