TW-API
  1. V2
TW-API
  • 文档说明
  • 请求
  • 响应
  • V2
    • 获取派送产品列表
      POST
    • 订单试算
      POST
    • 订单预报
      POST
    • 订单状态查询
      POST
    • 订单详情
      POST
    • 面单下载
      POST
    • 订单删除
      POST
    • 预扣费查询
      POST
    • 打单余额
      POST
    • 查询账单
      POST
    • 查询账单明细
      POST
    • 审核包袋
      POST
    • 创建合包
      POST
    • 删除合包
      POST
    • 查询包袋信息
      POST
  1. V2

订单预报

POST
/api/v2/orderForecast
最后修改时间:2026-01-01 01:13:15
1.
禁止存在相同单号不同产品

状态说明#

-1:失败

10:成功

此时需要停止轮询。

其他状态需要轮询查询结果#

请求参数

Header 参数

Body 参数application/json

示例
{
    "tickets": [
        {
            "no": "test20240625001",
            "product": "UA",
            "freightClass": "",
            "isSignatureService": 0,
            "signatureType": "INDIRECT",
            "is_insurance": false,
            "note": "",
            "consignee": "MSP1",
            "boxes": [
                {
                    "number": 2,
                    "weight": 20,
                    "length": 20,
                    "width": 20,
                    "height": 20,
                    "declaredValue": 0,
                    "referenceNumbers": []
                }
            ]
        },
        {
            "no": "test20240625002",
            "product": "UW",
            "freightClass": "",
            "isSignatureService": 0,
            "note": "",
            "consignee": {
                "countryCode": "US",
                "stateProvince": "MN",
                "city": "Shakopee",
                "postcode": "2601 4th Avenue East",
                "address": "55379",
                "address2": "55379",
                "name": "MSP1",
                "companyName": "Amazon.com Services, Inc.",
                "phone": "8-888-8888888"
            },
            "boxes": [
                {
                    "number": 1,
                    "weight": 10,
                    "length": 10,
                    "width": 10,
                    "height": 10,
                    "declaredValue": 0,
                    "referenceNumbers": []
                }
            ],
            "sender": "MSP1"
        }
    ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://prod-cn.your-api-server.com/api/v2/orderForecast' \
--header 'key;' \
--header 't;' \
--header 'username;' \
--header 'sign;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "tickets": [
        {
            "no": "test20240625001",
            "product": "UA",
            "freightClass": "",
            "isSignatureService": 0,
            "signatureType": "INDIRECT",
            "is_insurance": false,
            "note": "",
            "consignee": "MSP1",
            "boxes": [
                {
                    "number": 2,
                    "weight": 20,
                    "length": 20,
                    "width": 20,
                    "height": 20,
                    "declaredValue": 0,
                    "referenceNumbers": []
                }
            ]
        },
        {
            "no": "test20240625002",
            "product": "UW",
            "freightClass": "",
            "isSignatureService": 0,
            "note": "",
            "consignee": {
                "countryCode": "US",
                "stateProvince": "MN",
                "city": "Shakopee",
                "postcode": "2601 4th Avenue East",
                "address": "55379",
                "address2": "55379",
                "name": "MSP1",
                "companyName": "Amazon.com Services, Inc.",
                "phone": "8-888-8888888"
            },
            "boxes": [
                {
                    "number": 1,
                    "weight": 10,
                    "length": 10,
                    "width": 10,
                    "height": 10,
                    "declaredValue": 0,
                    "referenceNumbers": []
                }
            ],
            "sender": "MSP1"
        }
    ]
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "code": 200,
    "message": "OK",
    "data": [
        {
            "request_id": "1f40e5f7-f3a5-4e3c-bfc5-f821f2bf849c",
            "no": "test20240625001",
            "status": 1,
            "errors": []
        }
    ]
}
🟠404失败
修改于 2026-01-01 01:13:15
上一页
订单试算
下一页
订单状态查询
Built with