WMS API Reference
We call the Qian Yi / 800best Haiwaicang gateway at
http://edi-glink.800best.com/gateway/api/glink. Every request is a
form-urlencoded POST with these fields:
| Field | Meaning |
|---|---|
serviceType | One of the GLINK_* service names below |
partnerId | e.g. MELODIESTEST_wsgpprod1776049378721 |
partnerKey | Shared secret (hex) |
bizData | JSON payload, service-specific shape |
sign | md5(bizData + partnerKey), lowercase hex |
Full vendor spec: WmsSyncHubApi/docs/wms-haiwaicang-api.clean.md.
Verified curl examples for every call: testapidoc.md in the main
repo.
The services we call
| GLINK service | Direction | Called by |
|---|---|---|
GLINK_BATCH_OPERATE_ITEM_NOTIFY | AC → WMS | ItemSyncWorker |
GLINK_QUERY_ITEM_NOTIFY | AC ← WMS | (manual verify only) |
GLINK_CREATE_ORDER_NOTIFY | AC → WMS | PickingNoteWorker |
GLINK_CANCEL_ORDER_NOTIFY | AC → WMS | CancellationWorker |
GLINK_UPDATE_ORDER_STATUS | AC ← WMS (webhook) | WmsCallbackController |
GLINK_CREATE_ASN_NOTIFY | AC → WMS | AsnCreateWorker |
GLINK_CANCEL_ASN_NOTIFY | AC → WMS | AsnCancellationWorker |
GLINK_UPDATE_ASN_STATUS | AC ← WMS (webhook) | WmsCallbackController |
Critical payload gotchas
1. stockStatus = "GOOD", NOT "EA"
// WRONG — WMS responds "Inventory not enough"
{ "items": [{ "skuCode": "ABC", "quantity": 48, "stockStatus": "EA" }] }
// CORRECT
{ "items": [{ "skuCode": "ABC", "quantity": 48, "stockStatus": "GOOD" }] }
stockStatus is condition (GOOD / DAMAGE), not UOM. EA is a
packaging UOM on item master only; it does not belong on order lines.
2. carrier = "GWMS-CARRIER", NOT "STD"
On outbound orders, carrier must be the WMS-registered carrier code.
GWMS-CARRIER is the catch-all value that works in the test tenant.
STD is rejected.
3. quantity is always EA
No unit field on order lines. See UOM Round-Trip.
4. orderNumbers for cancel is our own order number
GLINK_CANCEL_ORDER_NOTIFY takes orderNumbers = [PickingNoteNo]
— our own business key. WMS tracks both theirs (wmsOrderNumber) and
ours, but every cancel we issue uses ours.
5. MD5 signing caveats
bizData + partnerKey— concatenated string, no separator.- MD5 hex output is lowercase.
- The exact byte sequence of
bizDatamatters — if the server receivesbizDatawith a different whitespace / key ordering than what you hashed, the sign will mismatch. Serialise once, then sign that exact string.
WMS UOMs — the 3-unit rule
packagingList[].unit has exactly three legal values:
| Code | 中文 | Meaning |
|---|---|---|
EA | 单件 | Each / piece (base, pcsQty=1) |
INP | 内包 | Inner pack (e.g. pcsQty=6) |
CS | 箱 | Case / carton (e.g. pcsQty=24) |
These are the only valid values. Sending anything else (UN, CT, BX,
…) fails at item creation. See reports/wms-uom-reference-2026-04-23.md.
Response envelope
Every response has this shape:
{
"success": true,
"code": "SUCCESS",
"message": "OK",
"data": { ...service-specific... }
}
Common error codes:
| Code | Meaning |
|---|---|
SUCCESS | OK |
INVALID_OPERATION | Business rule refused (e.g. cancel on Shipped) |
INVALID_DATA | Missing / malformed required field |
INVALID_PARTNERID | Credentials wrong |
INTERNAL_ERROR | WMS-side exception, often transient |
ORDER_NOT_EXIST / ASN_NOT_EXIST | Record missing — safe to treat as success for cancels |
Caution
:::caution The gateway is HTTP-only
edi-glink.800best.com/gateway/api/glink is plain HTTP, not HTTPS.
Treat the link as hostile — sign every payload, reject unsigned
callbacks, and if you mirror the traffic through a corporate proxy
make sure it is not logged to a shared bucket.
:::
:::tip Use testapidoc.md as golden truth
Whenever you touch the gateway client, diff the wire format against
testapidoc.md (in the main repo). Those curl examples have been
confirmed end-to-end against the live gateway with real
customerCode=MELODIESTEST. If a response deviates from the spec JSON
shown there, trust testapidoc.md over the vendor's written spec.
:::