跳到主要内容

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:

FieldMeaning
serviceTypeOne of the GLINK_* service names below
partnerIde.g. MELODIESTEST_wsgpprod1776049378721
partnerKeyShared secret (hex)
bizDataJSON payload, service-specific shape
signmd5(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 serviceDirectionCalled by
GLINK_BATCH_OPERATE_ITEM_NOTIFYAC → WMSItemSyncWorker
GLINK_QUERY_ITEM_NOTIFYAC ← WMS(manual verify only)
GLINK_CREATE_ORDER_NOTIFYAC → WMSPickingNoteWorker
GLINK_CANCEL_ORDER_NOTIFYAC → WMSCancellationWorker
GLINK_UPDATE_ORDER_STATUSAC ← WMS (webhook)WmsCallbackController
GLINK_CREATE_ASN_NOTIFYAC → WMSAsnCreateWorker
GLINK_CANCEL_ASN_NOTIFYAC → WMSAsnCancellationWorker
GLINK_UPDATE_ASN_STATUSAC ← 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 + partnerKeyconcatenated string, no separator.
  • MD5 hex output is lowercase.
  • The exact byte sequence of bizData matters — if the server receives bizData with 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)
CSCase / 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:

CodeMeaning
SUCCESSOK
INVALID_OPERATIONBusiness rule refused (e.g. cancel on Shipped)
INVALID_DATAMissing / malformed required field
INVALID_PARTNERIDCredentials wrong
INTERNAL_ERRORWMS-side exception, often transient
ORDER_NOT_EXIST / ASN_NOT_EXISTRecord 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. :::