Skip to main content

Open Warehouse Execution Management System API Documentation

🔐 Authentication

All API requests must include an api key in the header:

X-API-KEY: <your_api_key>

Authentication Errors

Status CodeDescriptionSolution
401Invalid API KeyGet the correct API key

🌐 Base Information

Base URL: https://api.warehouse.example.com/v1
Endpoint: POST /execute
Content-Type: application/json

📝 Request Format

Common Headers

Content-Type: application/json
X-API-KEY: <your_api_key>
X-Request-ID: <unique_request_id>

Common Parameters

ParameterTypeRequiredDescription
apiTypeStringAPI type identifier
bodyJSONRequest body (varies by apiType)

📦 Available APIs

SKU Management


apiType: SKU_CREATE

Creates a new SKU (Stock Keeping Unit)

Request Body Schema:

[
{
"skuCode": "SKU-2023-001",
"warehouseCode": "WH-EAST-01",
"ownerCode": "ACME_CORP",
"skuName": "Premium Laptop",
"color": "Space Gray",
"brand": "OpenWES",
"volumeDTO": {
"volume": 1500000,
"height": 150,
"width": 100,
"length": 100
},
"skuAttribute": {
"imageUrl": "https://storage.example.com/sku123.jpg",
"skuFirstCategory": "Electronics",
"skuSecondCategory": "Computers"
},
"skuPackage": {
"skuPackageDetails": [
{
"level": 1,
"packageCode": "LP-BOX-01",
"unit": "box",
"height": 200,
"width": 300,
"length": 400,
"weight": 1500
}
]
},
"skuBarcode": {
"barcodes": [
"1234567890123",
"2345678901234"
]
}
}
]

字段说明

字段类型必填说明
skuCodestring商品编码,最大长度64
warehouseCodestring仓库编码,最大长度64
ownerCodestring货主编码,最大长度64
skuNamestring商品名称,最大长度128
stylestring商品样式
colorstring商品颜色
sizestring商品尺寸
brandstring商品品牌
weightobject重量信息
volumeDTOobject体积信息
skuAttributeobject商品属性
skuConfigobject商品配置
skuPackageobject商品包装
skuBarcodeobject商品条码

体积信息(VolumeDTO)

字段类型必填说明
volumelong体积(立方毫米) ≥0
heightlong高(毫米) ≥0
widthlong宽(毫米) ≥0
lengthlong长(毫米) ≥0

商品属性(SkuAttributeDTO)

字段类型必填说明
imageUrlstring商品图片地址
unitstring商品单位
skuFirstCategorystring一级分类
skuSecondCategorystring二级分类
skuThirdCategorystring三级分类
skuAttributeCategorystring属性类别
skuAttributeSubCategorystring属性子类别

商品包装(SkuPackageDTO)

字段类型必填说明
skuPackageDetailsarray包装明细列表
包装明细
字段类型必填说明
levelinteger包装级别
packageCodestring包装编码
unitstring包装单位
enableSplitboolean是否可拆包
heightlong包装高度(mm) ≥0
widthlong包装宽度(mm) ≥0
lengthlong包装长度(mm) ≥0
weightinteger包装重量(mg) ≥0

商品条码(BarcodeDTO)

字段类型必填说明
barcodesarray条码列表(需确保唯一性)

Success Response:

{
"code": "0",
"msg": "success"
}

Inbound Management

apiType: ORDER_INBOUND_CREATE

Request Body Schema:

[
{
"customerOrderNo": "CUST-ORDER-001",
"lpnCode": "LPN123456",
"warehouseCode": "WH01",
"customerOrderType": "PURCHASE|RETURN|TRANSFER",
"storageType": "storage|overstock|in_transit",
"sender": "供应商A",
"carrier": "顺丰快递",
"shippingMethod": "陆运",
"trackingNumber": "SF123456789",
"estimatedArrivalDate": 1672531200000,
"remark": "易碎品,小心搬运",
"extendFields": {
"customField1": "value1",
"customField2": 100
},
"details": [
{
"ownerCode": "OWNER01",
"boxNo": "BOX001",
"qtyRestocked": 100,
"skuCode": "SKU001",
"skuName": "商品A",
"style": "2023新款",
"color": "红色",
"size": "XL",
"brand": "品牌A",
"batchAttributes": {
"batchNo": "BATCH2023",
"productionDate": "2023-01-01"
},
"extendFields": {
"qualityGrade": "A"
}
}
]
}
]

字段说明

主单字段说明

字段类型必填说明
customerOrderNostring客户订单号,最大长度64
lpnCodestringLPN编码,最大长度64
warehouseCodestring仓库编码,最大长度64
customerOrderTypestring入库计划单类型
storageTypestring存储类型(STORAGE/OVERSTOCK/IN_TRANSIT)
senderstring发货人,最大长度128
carrierstring物流公司,最大长度128
shippingMethodstring购买方式,最大长度128
trackingNumberstring快递单号,最大长度128
estimatedArrivalDatelong预计送达日期(时间戳)
remarkstring备注,最大长度255
extendFieldsobject扩展字段(key-value形式)
detailsarray入库明细列表

明细字段说明

字段类型必填说明
ownerCodestring货主编码,最大长度64
boxNostring箱号,最大长度64
qtyRestockedinteger入库数量(≥1)
skuCodestring商品编码,最大长度64
skuNamestring商品名称
stylestring商品样式
colorstring商品颜色
sizestring商品尺寸
brandstring商品品牌
batchAttributesobject批次属性(key-value形式)
extendFieldsobject扩展属性(key-value形式)

存储类型枚举

说明
storage存储
overstock越库
in_transit在途

Success Response:

{
"code": "0",
"msg": "success"
}

apiType: ORDER_INBOUND_CANCEL

Request Body Schema:

{
"identifyNos": [
"INB-2023001",
"INB-2023002"
],
"warehouseCode": "WH01"
}

字段说明

字段类型必填说明
identifyNosarray要取消的入库单号列表(支持批量)
warehouseCodestring仓库编码(用于校验权限)

Success Response

{
"code": "0",
"msg": "success"
}

🔄 Response Format

All APIs return responses in the following format:

{
"success": "",
"code": "string",
"message": "string",
"data": {},
"requestId": "string",
"timestamp": "datetime"
}

⚠️ Error Handling

Common Error Codes

CodeStatusDescription
200SuccessRequest processed successfully
400Bad RequestInvalid parameters or request body
401UnauthorizedMissing or invalid authentication
403ForbiddenInsufficient permissions
404Not FoundResource not found
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer-side error

Error Response Example

{
"code": "400",
"msg": "Invalid request parameters"
}

📈 Rate Limiting

The API implements rate limiting per token:

  • 100 requests per minute per IP
  • 1000 requests per hour per token

When rate limit is exceeded, the API returns:

{
"success": false,
"code": "429",
"message": "Rate limit exceeded. Please try again in 60 seconds",
"requestId": "req-123456",
"timestamp": "2024-02-11T10:30:00Z"
}

📚 Best Practices

  1. Always include a unique X-Request-ID in headers for request tracking
  2. Handle token expiration by implementing refresh token logic
  3. Implement exponential backoff for failed requests
  4. Cache frequently used data to minimize API calls
  5. Use appropriate HTTP methods for different operations