Skip to content

OpenAPI Documentation

This document is intended for third-party system developers, explaining how to query warehouses, logistics channels, and inventory through OpenAPI, perform order outbound creation, and query order status and order logistics information.

Online Debugging >

1. Overview

ItemDescription
ProtocolHTTPS
Data Formatapplication/json; charset=UTF-8
Request MethodAll are POST
Character EncodingUTF-8
Authentication MethodAppKey + HMAC-SHA256 signature (no login token required)

API List (13 total):

No.API NamePath
1Get Warehouse ListPOST /openapi/warehouse/list
2Get Logistics Channel ListPOST /openapi/shipping/list
3Query Inventory by SKUPOST /openapi/inventory/query
4Paginated Inventory QueryPOST /openapi/inventory/page
5Order Outbound CreationPOST /openapi/order/create
6Query Order List by Plan IDPOST /openapi/order/listByPlan
7Order Status QueryPOST /openapi/order/status
8Order Logistics QueryPOST /openapi/order/tracking
9Query Product Category TreePOST /openapi/goods/category/list
10Create ProductPOST /openapi/goods/create
11Update ProductPOST /openapi/goods/update
12Query Product SKUPOST /openapi/goods/get
13Query Product SKU PaginatedPOST /openapi/goods/page

Base URL is provided by the operator when activating the AppKey. In the following text, it is represented as {baseUrl}, for example https://wms.example.com.

2. Authentication and Signature

All /openapi/** APIs need to include the following 4 fields in the HTTP request headers:

Request HeaderRequiredDescription
App-KeyYesClient identifier assigned by the open platform, format: T{6-digit tenant ID}_xxx, for example T123456_merchant_a
TimestampYesUnix timestamp (seconds), deviation from server time must not exceed 5 minutes
NonceYesRandom string, must not repeat within 5 minutes (anti-replay)
SignYesRequest signature, see algorithm below

2.1 Signature Algorithm

  1. Get the string to participate in signature from the request body (use empty string "" when there is no body)

  2. JSON Normalization: If the request body is a JSON object or array, first parse it and then compact serialize it (remove line breaks/indentation, field order is based on parsing result). Therefore, formatted JSON can be used in Postman, as long as the content is consistent with the signature.

  3. Concatenate strings in order:

signRaw = AppKey + Timestamp + Nonce + RequestBody
  1. Use AppSecret to perform HMAC-SHA256 on signRaw, output uppercase hexadecimal string (fixed 64 characters), which is the Sign

Java Example:

java
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(appSecret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
byte[] digest = mac.doFinal(signRaw.getBytes(StandardCharsets.UTF_8));
String sign = HexFormat.of().formatHex(digest).toUpperCase();

Python Example:

python
import hmac
import hashlib

sign = hmac.new(
    app_secret.encode("utf-8"),
    sign_raw.encode("utf-8"),
    hashlib.sha256
).hexdigest().upper()

2.2 Signature Example

Assume:

  • AppKey = T123456_test
  • AppSecret = your_secret
  • Timestamp = 1719500000
  • Nonce = abc123def456
  • RequestBody = {"warehouseCode":"JP001"}

Then:

signRaw = T123456_test1719500000abc123def456{"warehouseCode":"JP001"}
Sign    = HMAC-SHA256(signRaw, your_secret) → Uppercase HEX (64 characters)

For development and joint debugging, you can call the internal API POST /openApi/debug/buildHeaders (requires login whitelist), request example:

json
{
  "appKey": "T755003_xxxx",
  "appSecret": "your_secret",
  "body": {
    "warehouseCode": "JP001",
    "orderList": []
  }
}
  • body: Nested JSON, no need to escape (recommended)
  • Returns headers which can be directly copied to business OpenAPI request headers
  • Returns requestBody which is the normalized JSON string participating in signature
  • Business API body format can be different from body field format (line breaks/indentation do not affect), as long as JSON content is consistent

2.4 Rate Limiting

Each AppKey default limit: 60 times / 60 seconds. Returns code=429 when exceeded.

3. Unified Response Format

All OpenAPI API responses are JSON, with the following structure:

json
{
  "code": 0,
  "message": "success",
  "data": {}
}
FieldTypeDescription
codeintBusiness status code, 0 indicates success
messagestringStatus description
dataobject / array / nullBusiness data, usually null when failed

3.1 Status Code Description

Authentication Layer Errors (Filter interception, not entering business logic):

codemessageDescription
0successSuccess
401AppKey InvalidAppKey missing, format error, or tenant invalid
402Sign InvalidSignature incorrect
403Client Not FoundClient does not exist or not bound to merchant
404Client DisabledClient disabled or expired
406Request ExpiredTimestamp exceeds 5-minute window
407Duplicate RequestNonce repeated (replay request)
429Request Rate LimitedRate limit triggered
500System ErrorSystem exception

Business Layer Errors (Returned after entering Controller):

codeCommon messageDescription
500Client not bound to merchantClient corresponding to AppKey not associated with merchant
500Warehouse does not exist or is disabledPassed warehouseCode is invalid or warehouse is disabled
500Order does not existNo corresponding order outbound record found by sourceOrderNo
500warehouseCode cannot be emptyParameter validation failed
500orderList cannot be emptyParameter validation failed
500orderList maximum 200 itemsOrder list exceeds limit
500sourceOrderNo cannot be emptyParameter validation failed
500skuList cannot be emptyParameter validation failed
500skuList maximum 200 itemsSKU list exceeds limit
500specifiedCarrier only allows yamato_takkyubin (Yamato Transport·Home Delivery Service)Specified shipping method is illegal
500deliveryDate format must be yyyy-MM-ddDelivery date format error
500deliveryTimeSlot only allows 812, 1416, 1618, 1820, 1921Delivery time slot is illegal

HTTP status code is always 200, please use code in response body to determine success.

4. API Details

Please go to the OpenAPI platform to view API details

View API details >

5. Complete Call Example (cURL)

Taking "Get Warehouse List" as example:

bash
# Variables (please replace with actual values)
BASE_URL="https://wms.example.com"
APP_KEY="T123456_your_client"
APP_SECRET="your_app_secret"
TIMESTAMP=$(date +%s)
NONCE=$(uuidgen | tr -d '-')
BODY='{}'

# Calculate signature (need to implement HMAC-SHA256 yourself, or use tool language described below)
SIGN_RAW="${APP_KEY}${TIMESTAMP}${NONCE}${BODY}"
# SIGN = HMAC-SHA256(SIGN_RAW, APP_SECRET) Uppercase HEX

curl -X POST "${BASE_URL}/openapi/warehouse/list" \
  -H "Content-Type: application/json" \
  -H "App-Key: ${APP_KEY}" \
  -H "Timestamp: ${TIMESTAMP}" \
  -H "Nonce: ${NONCE}" \
  -H "Sign: ${SIGN}" \
  -d "${BODY}"

6. Integration Suggestions

  1. Call warehouse list first: Get valid warehouseCode, then call logistics channel and inventory APIs.

  2. Inventory synchronization strategy:

    • When SKU quantity is small and precise query is needed, use /inventory/query
    • When full synchronization is needed, use /inventory/page paginated pull (recommended pageSize=500)
  3. Nonce generation: Recommend using UUID or snowflake ID, ensure uniqueness for each request.

  4. Clock synchronization: Client server time deviation from standard time should be controlled within 5 minutes.

  5. Error retry: For 407 Duplicate Request, please change Nonce and retry; for 429, please reduce frequency or backoff retry; for 406, please calibrate time and retry.

  6. Data isolation: Order and inventory data only includes data for AppKey bound merchant, cannot query other merchant data.

  7. Order query suggestion: After creating order, can use /openapi/order/status to poll latest status; when needing logistics number, carrier and other information, call /openapi/order/tracking.

7. Appendix: Inventory Field Description

FieldBusiness Meaning
availableQtyCurrent inventory quantity available for ordering/allocation
lockedQtyQuantity already occupied by orders or business, not yet shipped
onwayQtyQuantity already shipped in transit, not yet completed warehousing

OSL Overseas Warehouse Help Center

OSL Overseas Warehouse Help Center