第12章:出库订单
12.1 出库订单创建
12.1.1 接口说明
创建出库订单,支持批量创建,单次请求最多支持100个订单。批量创建时,每个订单独立处理,支持部分成功部分失败。订单创建成功后,系统会返回 IWIN 出库订单号(orderNo)和客户自定义出库订单号(referenceNo)。
收货地址支持:支持美国(US)和加拿大(CA)地址。创建订单时,请根据收货国家填写相应的地址格式,详见地址格式说明。
重要说明:
- 批量创建时,每个订单独立处理,互不影响
- 如果部分订单成功、部分订单失败,
success字段返回true(只要有一个订单成功) - 成功的订单在
result.successResultList中返回 - 失败的订单在
result.failedResultList中返回,包含失败原因
12.1.2 请求信息
- 接口地址:
POST /onixport/api/wms/outbound/create - 请求方式:POST
- Content-Type:application/json
12.1.3 请求参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| outboundInfoList | Array | 是 | 出库订单信息列表,最多100个 |
| outboundInfoList[].warehouseCode | String | 是 | 发货仓库编码,可以从获取仓库信息接口获取 |
| outboundInfoList[].referenceNo | String | 是 | 客户自定义出库订单号,唯一,不允许重复(包括取消状态下),最大长度32,仅支持字母、数字、横线、斜线 |
| outboundInfoList[].orderType | Integer | 是 | 出库订单类型编码:1:Fulfil; 2:Replace; 3:Return |
| outboundInfoList[].carrierCode | Integer | 是 | 出库订单发货渠道编码:1:LTL; 2:UPS; 3:FedEx; 4:Hold; 5:USPS; 6:Will Call Pickup; 7:Onixport; 8:Others; 9:Amazon Pickup; 10:FTL |
| outboundInfoList[].shipDate | String | 否 | 发货日期,格式:MM/dd/yyyy。发货日期设置规则详见发货日期设置规则 |
| outboundInfoList[].specialInstruction | String | 否 | 特殊指令信息,最大长度1024 |
| outboundInfoList[].consigneeCompany | String | 是 | 收件人企业名称,最大长度35 |
| outboundInfoList[].consigneeName | String | 是 | 收件人联系人姓名,最大长度70 |
| outboundInfoList[].consigneePhone | String | 是 | 收件人联系电话,最大长度20,需符合美国或加拿大电话号码格式 |
| outboundInfoList[].consigneeEmail | String | 否 | 收件人联系邮箱,最大长度64 |
| outboundInfoList[].consigneeAddress1 | String | 是 | 收件详细地址1,最大长度35 |
| outboundInfoList[].consigneeAddress2 | String | 否 | 收件详细地址2,最大长度35 |
| outboundInfoList[].consigneeZipcode | String | 是 | 收件邮编,美国或加拿大地址正常邮编,最大长度20 |
| outboundInfoList[].consigneeCity | String | 是 | 收件城市,最大长度35 |
| outboundInfoList[].consigneeState | String | 是 | 收件州/省,最大长度8。美国使用州代码(如:CA、NY),加拿大使用省代码(如:ON、BC) |
| outboundInfoList[].consigneeCountry | String | 是 | 收件国家,最大长度2。支持:US(美国)、CA(加拿大) |
| outboundInfoList[].itemList | Array | 是 | 出库订单明细列表 |
| outboundInfoList[].itemList[].sku | String | 是 | SKU,SKU信息必须已经在商品库中已维护,最大长度128 |
| outboundInfoList[].itemList[].inventoryType | Integer | 是 | SKU出库的库存类型:1:New; 2:Refurbished |
| outboundInfoList[].itemList[].outboundQty | Integer | 是 | 出库数量,必须大于0 |
12.1.4 响应参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| success | Boolean | 是 | 请求是否成功。只要有一个订单成功创建,该字段就返回 true |
| errorCode | Integer | 否 | 错误码。当 success=true 时,该字段为 null;当 success=false 时(所有订单都失败),该字段有值 |
| errorMsg | String | 否 | 错误信息。当 success=true 时,该字段为 null;当 success=false 时(所有订单都失败),该字段有值 |
| result | Object | 否 | 创建结果对象 |
| result.successResultList | Array | 否 | 成功创建的订单列表 |
| result.successResultList[].orderNo | String | 是 | IWIN系统返回出库订单号,唯一,可以根据此订单号拉取订单信息或更新订单信息 |
| result.successResultList[].referenceNo | String | 是 | 客户自定义出库订单号,也可以根据此订单号拉取订单信息或更新订单信息 |
| result.successResultList[].success | Boolean | 是 | 订单是否创建成功,成功时为 true |
| result.successResultList[].errorCode | Integer | 否 | 错误原因代码,当订单创建成功时为 null |
| result.successResultList[].errorMsg | String | 否 | 错误原因描述,当订单创建成功时为 null |
| result.failedResultList | Array | 否 | 失败创建的订单列表 |
| result.failedResultList[].orderNo | String | 否 | IWIN系统返回出库订单号,订单创建失败时可能为 null |
| result.failedResultList[].referenceNo | String | 是 | 客户自定义出库订单号 |
| result.failedResultList[].success | Boolean | 是 | 订单是否创建成功,失败时为 false |
| result.failedResultList[].errorCode | Integer | 是 | 错误原因代码,当订单创建失败时才有值,可根据错误码以及错误原因定位问题 |
| result.failedResultList[].errorMsg | String | 是 | 错误原因描述,当订单创建失败时才有值,可根据错误码以及错误原因定位问题 |
12.1.5 请求示例
示例1:美国地址
{
"outboundInfoList": [
{
"warehouseCode": "W1",
"referenceNo": "VIBE-245662",
"orderType": 1,
"carrierCode": 2,
"shipDate": "11/15/2025",
"specialInstruction": "Handle with care",
"consigneeCompany": "ABC Company",
"consigneeName": "John Doe",
"consigneePhone": "1234567890",
"consigneeEmail": "john@example.com",
"consigneeAddress1": "123 Main St",
"consigneeAddress2": "Suite 100",
"consigneeZipcode": "90001",
"consigneeCity": "Los Angeles",
"consigneeState": "CA",
"consigneeCountry": "US",
"itemList": [
{
"sku": "SKU123456",
"inventoryType": 1,
"outboundQty": 10
}
]
}
]
}
示例2:加拿大地址
{
"outboundInfoList": [
{
"warehouseCode": "W1",
"referenceNo": "VIBE-245663",
"orderType": 1,
"carrierCode": 2,
"shipDate": "11/15/2025",
"specialInstruction": "Handle with care",
"consigneeCompany": "XYZ Company",
"consigneeName": "Jane Smith",
"consigneePhone": "4161234567",
"consigneeEmail": "jane@example.com",
"consigneeAddress1": "456 Yonge Street",
"consigneeAddress2": "Unit 200",
"consigneeZipcode": "M5B 2H4",
"consigneeCity": "Toronto",
"consigneeState": "ON",
"consigneeCountry": "CA",
"itemList": [
{
"sku": "SKU123456",
"inventoryType": 1,
"outboundQty": 10
}
]
}
]
}
12.1.6 响应示例
全部成功响应
{
"success": true,
"errorCode": null,
"errorMsg": null,
"result": {
"successResultList": [
{
"orderNo": "POT13424424",
"referenceNo": "VIBE-245662",
"success": true,
"errorCode": null,
"errorMsg": null
},
{
"orderNo": "POT13424425",
"referenceNo": "VIBE-245663",
"success": true,
"errorCode": null,
"errorMsg": null
}
],
"failedResultList": []
}
}
部分成功部分失败响应
{
"success": true,
"errorCode": null,
"errorMsg": null,
"result": {
"successResultList": [
{
"orderNo": "POT13424424",
"referenceNo": "VIBE-245662",
"success": true,
"errorCode": null,
"errorMsg": null
}
],
"failedResultList": [
{
"orderNo": null,
"referenceNo": "VIBE-245663",
"success": false,
"errorCode": 1000,
"errorMsg": "SKU不存在"
},
{
"orderNo": null,
"referenceNo": "VIBE-245664",
"success": false,
"errorCode": 2003,
"errorMsg": "referenceNo已存在"
}
]
}
}
全部失败响应
{
"success": false,
"errorCode": 1000,
"errorMsg": "无效的参数",
"result": null
}
12.1.7 错误码说明
| 错误码 | 说明 | 解决方案 |
|---|---|---|
| 1000 | 无效的参数 | 检查请求参数是否完整、格式正确 |
| 2003 | 当前的数据不支持此操作 | 检查数据状态 |
12.1.8 注意事项
1. 批量处理机制:
- 单次请求最多支持100个订单,超过限制的订单将被丢弃
- 每个订单独立处理,互不影响
- 部分订单成功、部分订单失败时,
success返回true
2. 成功订单处理:
- 成功的订单在
result.successResultList中返回 - 包含
orderNo(IWIN系统生成的订单号)和referenceNo(客户自定义订单号) - 可以根据
orderNo或referenceNo拉取订单信息或更新订单
3. 失败订单处理:
- 失败的订单在
result.failedResultList中返回 - 包含
referenceNo、errorCode和errorMsg - 调用方应根据错误信息修正后重新提交失败的订单
4. 业务规则:
- referenceNo 必须唯一,包括已取消的订单
- SKU 必须在商品库中已维护,否则创建失败
- 出库数量必须大于0
5. 收货地址支持:
- 支持美国(US)和加拿大(CA)地址
- 美国地址:使用州代码(如:CA、NY),邮编为5位或9位数字(如:90001、90001-1234)
- 加拿大地址:使用省代码(如:ON、BC、QC),邮编为6位字符格式(如:M5B 2H4、K1A 0B1)
- 电话号码格式:美国为10位数字,加拿大为10位数字(可能包含区号)
6. 调用方建议:
- 检查
result.successResultList和result.failedResultList两个列表 - 对失败的订单进行错误处理,修正后重新提交
- 建议分批提交,每批不超过 100 个订单,以提高成功率
12.1.9 发货日期设置规则
发货日期(shipDate)的设置遵循以下规则:
规则1:不传递发货日期时
如果不传递 shipDate 参数,系统会根据仓库截单时间和订单推送日期自动设置发货日期:
- 情况A:如果推送时间早于当日仓库截单时间
- 发货日期 = 仓库所在地的当前日期
- 情况B:如果推送时间晚于或等于当日仓库截单时间
- 发货日期 = 仓库所在地当前日期的下一天
示例:
- 假设仓库截单时间为 17:00:00(下午5点)
- 如果订单在 2025-11-13 14:00:00 推送(早于截单时间)
- 发货日期 = 2025-11-13(当天)
- 如果订单在 2025-11-13 18:00:00 推送(晚于截单时间)
- 发货日期 = 2025-11-14(下一天)
规则2:传递发货日期时
如果传递了 shipDate 参数,系统会根据传递的发货日期和订单推送时间进行判断:
- 情况A:传递的发货日期为仓库所在地的当前日期
- 子情况A1:如果推送时间早于当日仓库截单时间
- 发货日期 = 传递的发货日期(保持不变)
- 子情况A2:如果推送时间晚于或等于当日仓库截单时间
- 发货日期 = 仓库所在地当前日期的下一天(自动变更)
- 情况B:传递的发货日期不是仓库所在地的当前日期
- 发货日期 = 传递的发货日期(保持不变)
示例:
- 假设仓库截单时间为 17:00:00(下午5点)
- 当前日期为 2025-11-13
- 如果传递
shipDate = "11/13/2025"(当前日期) - 订单在 14:00:00 推送(早于截单时间)→ 发货日期 = 11/13/2025(保持不变)
- 订单在 18:00:00 推送(晚于截单时间)→ 发货日期 = 11/14/2025(自动变更为下一天)
- 如果传递
shipDate = "11/15/2025"(未来日期) - 无论何时推送 → 发货日期 = 11/15/2025(保持不变)
重要说明
1. 时区:所有时间判断均基于仓库所在地的时区(可通过仓库信息接口获取 timeZone 字段)
2. 截单时间:每个仓库的截单时间可能不同,可通过仓库信息接口获取 cutoffTime 字段
3. 自动调整:系统会自动根据规则调整发货日期,无需调用方额外处理
4. 建议:如果对发货日期有明确要求,建议传递 shipDate 参数,并确保传递的日期符合业务需求
12.2 出库订单更新
12.2.1 接口说明
更新出库订单信息,仅支持 Pending 和 Special 状态下的出库订单更新。订单状态变更为 Working 后,订单信息将无法修改。
收货地址支持:支持美国(US)和加拿大(CA)地址。更新订单时,请根据收货国家填写相应的地址格式,详见地址格式说明。
12.2.2 请求信息
- 接口地址:
PUT /onixport/api/wms/outbound/update/{orderNo} - 请求方式:PUT
- Content-Type:application/json
12.2.3 路径参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| orderNo | String | 是 | IWIN出库订单号,示例:POT13424424 |
12.2.4 请求参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| warehouseCode | String | 是 | 发货仓库编码,可以从获取仓库信息接口获取 |
| referenceNo | String | 是 | 客户自定义出库订单号,唯一,不允许重复(包括取消状态下),最大长度32,仅支持字母、数字、横线、斜线 |
| orderType | Integer | 是 | 出库订单类型编码:1:Fulfil; 2:Replace; 3:Return |
| carrierCode | Integer | 是 | 出库订单发货渠道编码:1:LTL; 2:UPS; 3:FedEx; 4:Hold; 5:USPS; 6:Will Call Pickup; 7:Onixport; 8:Others; 9:Amazon Pickup; 10:FTL |
| shipDate | String | 否 | 发货日期,格式:MM/dd/yyyy。如果不传递,则根据仓库截单时间+订单推送日期自动设置 |
| specialInstruction | String | 否 | 特殊指令信息,最大长度1024 |
| consigneeCompany | String | 是 | 收件人企业名称,最大长度35 |
| consigneeName | String | 是 | 收件人联系人姓名,最大长度70 |
| consigneePhone | String | 是 | 收件人联系电话,最大长度20,需符合美国或加拿大电话号码格式 |
| consigneeEmail | String | 否 | 收件人联系邮箱,最大长度64 |
| consigneeAddress1 | String | 是 | 收件详细地址1,最大长度35 |
| consigneeAddress2 | String | 否 | 收件详细地址2,最大长度35 |
| consigneeZipcode | String | 是 | 收件邮编,美国或加拿大地址正常邮编,最大长度20 |
| consigneeCity | String | 是 | 收件城市,最大长度35 |
| consigneeState | String | 是 | 收件州/省,最大长度8。美国使用州代码(如:CA、NY),加拿大使用省代码(如:ON、BC) |
| consigneeCountry | String | 是 | 收件国家,最大长度2。支持:US(美国)、CA(加拿大) |
| itemList | Array | 是 | 出库订单明细列表 |
| itemList[].sku | String | 是 | SKU,SKU信息必须已经在商品库中已维护,最大长度128 |
| itemList[].inventoryType | Integer | 是 | SKU出库的库存类型:1:New; 2:Refurbished |
| itemList[].outboundQty | Integer | 是 | 出库数量,必须大于0 |
12.2.5 响应参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| success | Boolean | 是 | 请求是否成功 |
| errorCode | Integer | 否 | 错误码。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| errorMsg | String | 否 | 错误信息。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| result | Object | 否 | 更新结果 |
| result.orderNo | String | 是 | IWIN出库订单号,唯一,可以根据IWIN出库订单号拉取订单信息,或者更新订单信息 |
| result.referenceNo | String | 是 | 客户自定义出库订单号,也可以根据自定义出库订单号拉取订单信息,或者更新订单信息 |
| result.success | Boolean | 是 | 订单是否更新成功 |
| result.errorCode | Integer | 否 | 错误原因代码,当订单更新失败时才有值,可根据错误码以及错误原因定位问题。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| result.errorMsg | String | 否 | 错误原因描述,当订单更新失败时才有值,可根据错误码以及错误原因定位问题。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
12.2.6 请求示例
示例1:美国地址
PUT /onixport/api/wms/outbound/update/POT13424424
Content-Type: application/json
{
"warehouseCode": "W1",
"referenceNo": "VIBE-245662",
"orderType": 1,
"carrierCode": 2,
"shipDate": "11/16/2025",
"consigneeCompany": "ABC Company",
"consigneeName": "John Doe",
"consigneePhone": "1234567890",
"consigneeEmail": "john@example.com",
"consigneeAddress1": "123 Main St",
"consigneeAddress2": "Suite 100",
"consigneeZipcode": "90001",
"consigneeCity": "Los Angeles",
"consigneeState": "CA",
"consigneeCountry": "US",
"itemList": [
{
"sku": "SKU123456",
"inventoryType": 1,
"outboundQty": 15
}
]
}
示例2:加拿大地址
PUT /onixport/api/wms/outbound/update/POT13424425
Content-Type: application/json
{
"warehouseCode": "W1",
"referenceNo": "VIBE-245663",
"orderType": 1,
"carrierCode": 2,
"shipDate": "11/16/2025",
"consigneeCompany": "XYZ Company",
"consigneeName": "Jane Smith",
"consigneePhone": "4161234567",
"consigneeEmail": "jane@example.com",
"consigneeAddress1": "456 Yonge Street",
"consigneeAddress2": "Unit 200",
"consigneeZipcode": "M5B 2H4",
"consigneeCity": "Toronto",
"consigneeState": "ON",
"consigneeCountry": "CA",
"itemList": [
{
"sku": "SKU123456",
"inventoryType": 1,
"outboundQty": 15
}
]
}
12.2.7 响应示例
成功响应
{
"success": true,
"errorCode": null,
"errorMsg": null,
"result": {
"orderNo": "POT13424424",
"referenceNo": "VIBE-245662",
"success": true,
"errorCode": null,
"errorMsg": null
}
}
失败响应
{
"success": false,
"errorCode": 2003,
"errorMsg": "当前的数据不支持此操作",
"result": null
}
12.2.8 错误码说明
| 错误码 | 说明 | 解决方案 |
|---|---|---|
| 1000 | 无效的参数 | 检查请求参数是否完整、格式正确 |
| 2003 | 当前的数据不支持此操作 | 订单状态不是 Pending 或 Special,无法更新 |
12.2.9 注意事项
1. 仅支持 Pending 和 Special 状态的订单更新
2. 订单状态变更为 Working 后,订单信息将无法修改
3. 更新订单时,需要传递完整的订单信息
4. 收货地址支持:
- 支持美国(US)和加拿大(CA)地址
- 美国地址:使用州代码(如:CA、NY),邮编为5位或9位数字(如:90001、90001-1234)
- 加拿大地址:使用省代码(如:ON、BC、QC),邮编为6位字符格式(如:M5B 2H4、K1A 0B1)
- 电话号码格式:美国为10位数字,加拿大为10位数字(可能包含区号)
12.3 拉取出库订单信息
12.3.1 接口说明
根据 IWIN 出库订单号或客户自定义出库订单号拉取出库订单信息。系统优先使用 IWIN 出库订单号查询,仅当 orderNoList 没有传递值时,才会使用 referenceNoList 查询。支持批量查询,单次请求最多允许查询200个订单。
12.3.2 请求信息
- 接口地址:
POST /onixport/api/wms/outbound/info - 请求方式:POST
- Content-Type:application/json
12.3.3 请求参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| orderNoList | Array | 否 | IWIN出库订单号列表,单次请求最多支持100个订单信息查询,超过100个则丢弃不会返回对应的订单信息 |
| referenceNoList | Array | 否 | 客户自定义出库订单号列表,仅当orderNoList没有传递值时,才会使用ReferenceNo查询订单信息。单次请求最多支持100个订单信息查询,超过100个则丢弃不会返回对应的订单信息 |
注意:orderNoList 和 referenceNoList 至少需要传递一个。
12.3.4 响应参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| success | Boolean | 是 | 请求是否成功 |
| errorCode | Integer | 否 | 错误码。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| errorMsg | String | 否 | 错误信息。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| result | Array | 否 | 出库订单信息列表 |
| result[].orderNo | String | 是 | IWIN出库订单号 |
| result[].referenceNo | String | 是 | 客户定义参考订单号 |
| result[].warehouseCode | String | 是 | 发货仓库编码 |
| result[].warehouseName | String | 是 | 发货仓库名称 |
| result[].orderType | Integer | 是 | 出库订单类型:1:Fulfil; 2:Replace; 3:Return |
| result[].orderTypeDesc | String | 是 | 出库订单类型描述 |
| result[].status | Integer | 是 | 订单状态编码:10:Pending; 20:Working; 30:Fulfiled; 40:Hold; 50:Special; 60:Cancelled |
| result[].statusDesc | String | 是 | 订单状态描述 |
| result[].truckerCode | String | 否 | 如果Carrier是LTL(carrierCode=1),卡车编码。可选值见下方TruckerCode列表 |
| result[].truckerName | String | 否 | 如果Carrier是LTL(carrierCode=1),卡车名称。可选值见下方TruckerName列表 |
| result[].trackingStatus | Integer | 是 | 运输状态:0:Label Created; 10:Picked Up; 20:In Transit; 30:Delivered; 99:Exception; 100:Unknown。Picked Up之后订单信息不会再改变 |
| result[].trackingStatusDesc | String | 是 | 运输状态描述 |
| result[].shipDate | String | 是 | 发货日期,格式:MM/dd/yyyy |
| result[].consigneeCompany | String | 是 | 收件人企业名称 |
| result[].consigneeName | String | 是 | 收件人联系人姓名 |
| result[].consigneePhone | String | 是 | 收件人联系电话 |
| result[].consigneeEmail | String | 是 | 收件人联系邮箱 |
| result[].consigneeCountry | String | 是 | 收件人地址国家 |
| result[].consigneeState | String | 是 | 收件人地址州/省二字码 |
| result[].consigneeCity | String | 是 | 收件人地址城市名称 |
| result[].consigneeZipcode | String | 是 | 收件人地址邮编 |
| result[].consigneeAddress1 | String | 是 | 收件人详细地址1 |
| result[].consigneeAddress2 | String | 否 | 收件人详细地址2 |
| result[].specialInstruction | String | 否 | 特殊指令 |
| result[].trackingNo | Array | 否 | 跟踪号列表,如果发货渠道是快递并且是多包裹的话跟踪号是多个(也是发货明细中的跟踪号汇总)。如果是卡车,则是一个 |
| result[].carrierCode | Integer | 是 | 发货渠道编码 |
| result[].carrierName | String | 是 | 发货渠道名称 |
| result[].specialReason | String | 否 | 如果订单状态是Special,说明订单在确认发货时信息出现问题,可在此处查看错误原因 |
| result[].updateAt | Long | 是 | 出库订单更新时间戳。可以根据时间戳判断出库订单数据是否存在更新,如果更新时间戳大于上一次调用API时间,则说明数据发生了改变 |
| result[].itemList | Array | 是 | 出库订单明细 |
| result[].itemList[].sku | String | 是 | SKU |
| result[].itemList[].commodityName | String | 是 | 品名 |
| result[].itemList[].inventoryType | Integer | 是 | SKU对应的出库的库存类型编码 |
| result[].itemList[].inventoryTypeDesc | String | 是 | SKU对应的出库的库存类型描述 |
| result[].itemList[].outboundQty | Integer | 是 | SKU对应的出库数量 |
| result[].shippedItemList | Array | 否 | 出库订单发货明细,当出库订单状态变更为Working后才会有发货明细的值 |
| result[].shippedItemList[].packageNo | String | 是 | 当前出库订单的发货明细的包裹编号,此订单下唯一 |
| result[].shippedItemList[].sku | String | 是 | SKU |
| result[].shippedItemList[].commodityName | String | 是 | 品名 |
| result[].shippedItemList[].inventoryType | Integer | 是 | SKU对应的出库的库存类型编码 |
| result[].shippedItemList[].inventoryTypeDesc | String | 是 | SKU对应的出库的库存类型描述 |
| result[].shippedItemList[].outboundQty | Integer | 是 | SKU对应的出库数量 |
| result[].shippedItemList[].serialNo | String | 是 | SKU对应的出库的货物序列号 |
| result[].shippedItemList[].trackingNo | String | 是 | SKU对应的出库的货物的跟踪号 |
注意:truckerCode 和 truckerName 字段仅在 carrierCode=1(LTL)时返回。
TruckerCode 列表
当 carrierCode=1(LTL)时,truckerCode 和 truckerName 的可能值如下:
| TruckerCode | TruckerName |
|---|---|
| UPGF | TForce Freight |
| ABFS | ABF Freight |
| DYLT | Daylight Transport |
| EXLA | Estes Express Lines |
| SAIA | Saia LTL Freight |
| SEFL | Southeastern Freight Lines |
| PIOT | Pilot Freight Service |
| ONIXPORT | Onixport |
12.3.5 请求示例
{
"orderNoList": ["POT13424424", "POT13424425"],
"referenceNoList": ["VIBE-245662"]
}
12.3.6 响应示例
成功响应
{
"success": true,
"errorCode": null,
"errorMsg": null,
"result": [
{
"orderNo": "POT13424424",
"referenceNo": "VIBE-245662",
"warehouseCode": "W1",
"warehouseName": "LA Warehouse",
"orderType": 1,
"orderTypeDesc": "Fulfil",
"status": 20,
"statusDesc": "Working",
"trackingStatus": 10,
"trackingStatusDesc": "Picked Up",
"shipDate": "11/15/2025",
"consigneeCompany": "ABC Company",
"consigneeName": "John Doe",
"consigneePhone": "1234567890",
"consigneeEmail": "john@example.com",
"consigneeCountry": "US",
"consigneeState": "CA",
"consigneeCity": "Los Angeles",
"consigneeZipcode": "90001",
"consigneeAddress1": "123 Main St",
"consigneeAddress2": "Suite 100",
"specialInstruction": "Handle with care",
"trackingNo": ["1Z999AA10123456784"],
"carrierCode": 1,
"carrierName": "LTL",
"truckerCode": "UPGF",
"truckerName": "TForce Freight",
"updateAt": 1699876800000,
"itemList": [
{
"sku": "SKU123456",
"commodityName": "iPhone 15 Case",
"inventoryType": 1,
"inventoryTypeDesc": "New",
"outboundQty": 10
}
],
"shippedItemList": [
{
"packageNo": "PKG001",
"sku": "SKU123456",
"commodityName": "iPhone 15 Case",
"inventoryType": 1,
"inventoryTypeDesc": "New",
"outboundQty": 10,
"serialNo": "SN123456789",
"trackingNo": "1Z999AA10123456784"
}
]
}
]
}
失败响应
{
"success": false,
"errorCode": 1000,
"errorMsg": "无效的参数",
"result": null
}
12.3.7 错误码说明
| 错误码 | 说明 | 解决方案 |
|---|---|---|
| 1000 | 无效的参数 | 检查请求参数是否完整、格式正确 |
12.3.8 注意事项
1. 系统优先使用 IWIN 出库订单号(orderNoList)查询
2. 仅当 orderNoList 没有传递值时,才会使用 referenceNoList 查询
3. 单次请求最多支持100个订单查询,超过限制的订单将被丢弃
4. shippedItemList 仅在订单状态为 Working 及之后状态时返回
5. updateAt 字段说明:updateAt 为出库订单更新时间戳(Unix 时间戳,毫秒),可用于判断订单数据是否发生变化。建议调用方记录上次查询的时间戳,如果本次返回的 updateAt 大于上次查询时间,说明订单数据已更新,需要重新处理订单信息
12.4 出库订单取消
12.4.1 接口说明
取消指定的出库订单。仅支持特定状态下的订单取消操作。
支持取消的订单状态:
- Pending(待处理)
- Working(处理中)
- Special(特殊状态)
- Fulfiled(已发货),但仅当 Tracking Status 为 Label Created(标签已创建)时可以取消
不支持取消的订单状态:
- Hold(暂停)
- Cancelled(已取消)
- Fulfiled(已发货)且 Tracking Status 不为 Label Created(已揽收、运输中、已签收或异常)
12.4.2 请求信息
- 接口地址:
PUT /onixport/api/wms/outbound/cancel - 请求方式:PUT
- Content-Type:application/json
12.4.3 请求参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| orderNo | String | 是 | IWIN出库订单号 |
12.4.4 响应参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| success | Boolean | 是 | 请求是否成功 |
| errorCode | Integer | 否 | 错误码。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| errorMsg | String | 否 | 错误信息。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| result | null | - | 无返回数据 |
12.4.5 请求示例
{
"orderNo": "POT13424424"
}
12.4.6 响应示例
成功响应
{
"success": true,
"errorCode": null,
"errorMsg": null,
"result": null
}
失败响应
{
"success": false,
"errorCode": 2003,
"errorMsg": "当前的数据不支持此操作",
"result": null
}
12.4.7 错误码说明
| 错误码 | 说明 | 解决方案 |
|---|---|---|
| 2003 | 当前的数据不支持此操作 | 订单状态不允许取消操作(Hold、Cancelled 状态不支持取消;Fulfiled 状态且 Tracking Status 不为 Label Created 时也不支持取消) |
12.4.8 注意事项
1. 支持取消的订单状态:
- Pending(待处理)
- Working(处理中)
- Special(特殊状态)
- Fulfiled(已发货)且 Tracking Status 为 Label Created(标签已创建)
2. 不支持取消的订单状态:
- Hold(暂停)
- Cancelled(已取消)
- Fulfiled(已发货)且 Tracking Status 不为 Label Created(已揽收、运输中、已签收或异常)
3. Fulfiled 状态订单取消规则:
- 当订单状态为 Fulfiled 且 Tracking Status 为 Label Created(标签已创建)时,可以取消
- 当订单状态为 Fulfiled 且 Tracking Status 为 Picked Up(已揽收)、In Transit(运输中)、Delivered(已签收)或 Exception(异常)时,无法取消
12.5 出库订单Hold
12.5.1 接口说明
对指定的出库订单执行 Hold 操作,暂停订单处理。注意:仅 Working 和 Fulfiled 状态的订单支持 Hold 操作。
12.5.2 请求信息
- 接口地址:
PUT /onixport/api/wms/outbound/hold - 请求方式:PUT
- Content-Type:application/json
12.5.3 请求参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| orderNo | String | 是 | IWIN出库订单号 |
12.5.4 响应参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| success | Boolean | 是 | 请求是否成功 |
| errorCode | Integer | 否 | 错误码。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| errorMsg | String | 否 | 错误信息。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| result | null | - | 无返回数据 |
12.5.5 请求示例
{
"orderNo": "POT13424424"
}
12.5.6 响应示例
成功响应
{
"success": true,
"errorCode": null,
"errorMsg": null,
"result": null
}
失败响应
{
"success": false,
"errorCode": 2003,
"errorMsg": "当前的数据不支持此操作",
"result": null
}
12.5.7 错误码说明
| 错误码 | 说明 | 解决方案 |
|---|---|---|
| 2003 | 当前的数据不支持此操作 | 订单状态不允许Hold操作(仅 Working 和 Fulfiled 状态支持 Hold 操作) |
12.5.8 注意事项
1. 仅 Working 和 Fulfiled 状态的订单支持 Hold 操作
2. Hold 操作会暂停订单处理
3. 其他状态的订单无法执行 Hold 操作
12.6 出库订单删除
12.6.1 接口说明
删除指定的出库订单。注意:仅 Pending 和 Special 状态下的出库订单允许删除。删除操作不可恢复,请谨慎操作。
12.6.2 请求信息
- 接口地址:
DELETE /onixport/api/wms/outbound/delete - 请求方式:DELETE
- Content-Type:application/json
12.6.3 请求参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| orderNo | String | 是 | IWIN出库订单号,示例:POT13424424 |
12.6.4 响应参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| success | Boolean | 是 | 请求是否成功 |
| errorCode | Integer | 否 | 错误码。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| errorMsg | String | 否 | 错误信息。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| result | null | - | 无返回数据 |
12.6.5 请求示例
{
"orderNo": "POT13424424"
}
12.6.6 响应示例
成功响应
{
"success": true,
"errorCode": null,
"errorMsg": null,
"result": null
}
失败响应
{
"success": false,
"errorCode": 2003,
"errorMsg": "当前的数据不支持此操作",
"result": null
}
12.6.7 错误码说明
| 错误码 | 说明 | 解决方案 |
|---|---|---|
| 1000 | 无效的参数 | 检查请求参数是否完整、格式正确 |
| 2003 | 当前的数据不支持此操作 | 订单状态不是 Pending 或 Special,无法删除 |
12.6.8 注意事项
1. 仅支持 Pending 和 Special 状态的订单删除
2. 删除操作不可恢复,请谨慎操作
3. 其他状态的订单无法删除
12.7 订单状态说明
12.7.1 订单状态
| 状态码 | 状态描述 | 说明 |
|---|---|---|
| 10 | Pending | 待处理 |
| 20 | Working | 处理中 |
| 30 | Fulfiled | 已完成 |
| 40 | Hold | 暂停 |
| 50 | Special | 异常 |
| 60 | Cancelled | 已取消 |
12.7.2 运输状态
| 状态码 | 状态描述 | 说明 |
|---|---|---|
| 0 | Label Created | 标签已创建 |
| 10 | Picked Up | 已揽收 |
| 20 | In Transit | 运输中 |
| 30 | Delivered | 已签收 |
| 99 | Exception | 异常 |
| 100 | Unknown | 未知 |
注意:Picked Up 之后订单信息不会再改变。
12.7.3 订单类型
| 类型码 | 类型描述 | 说明 |
|---|---|---|
| 1 | Fulfil | 正常履约 |
| 2 | Replace | 换货 |
| 3 | Return | 退货 |
12.7.4 发货渠道
| 渠道码 | 渠道名称 | 说明 |
|---|---|---|
| 1 | LTL | 零担运输 |
| 2 | UPS | UPS快递 |
| 3 | FedEx | FedEx快递 |
| 4 | Hold | 暂停发货 |
| 5 | USPS | 美国邮政 |
| 6 | Will Call Pickup | 客户自提 |
| 7 | Onixport | Onixport物流 |
| 8 | Others | 其他 |
| 9 | Amazon Pickup | Amazon自提 |
| 10 | FTL | 整车运输 |
12.7.5 库存类型
| 类型码 | 类型描述 | 说明 |
|---|---|---|
| 1 | New | 新品 |
| 2 | Refurbished | 翻新 |
| 3 | Recycle | 回收 |