DOCS

Request a shipment rating

/

请求运输评级

探索运输评级请求中的键/值对。

请求您商店设置中配置的各种运输提供商的国际运输费用,使用Zonos。

属性 

请求正文中的 JSON 键/值对

POST | https://api.zonos.com/v1/shipment_rating

HEADER zonos-version: 2020-03-04

上述头部是此评级请求成功完成所需的输入。

字段备注
currency 必填基础货币字符串,由 三位字母 ISO 代码 表示。
items_amount 必填一个包含商品数量的小数。
packages 必填一个包含所运送包裹数量和尺寸的列表。 hash
packages.id 必填商家或出口商的唯一包裹标识符。
packages.dimensions 必填包裹的尺寸。 hash
packages.dimensions.height 必填运送箱的高度的小数。
packages.dimensions.length 必填运送箱的长度的小数。
packages.dimensions.unit 必填运送箱尺寸的计量单位。可能的值为 inch centimeter millimeter null。当为 null 时,将使用 inch
packages.dimensions.width 必填运送箱的宽度的小数。
packages.insured_amount 选填一个包含保险金额的小数。
packages.type 选填一个字符串,用于指定用于运送计算的特定承运人箱类型。可能的值包括 FEDEX_BOX
packages.weight 必填一个包含包裹重量的小数。
packages.weight_unit 必填一个包含重量计量单位的字符串。可能的值为 pound ounce kilogram null。当为 null 时,将使用 pound
pickup_date 必填包裹的请求取件日期,采用 ISO 8601 格式 YYYY-MM-DDTHH:mm:ss.sssZ。当未传递时区信息时,假定为 UTC。
service_level 选填与承运人的服务级别,例如 standardhash 常见示例包括:ups_expressups_express_saverups_expeditedups_economyups_standardups_mail_innovations_economyups_mail_innovations_prioritydhl_expressdhl_ecommerce_parcel_directfedex_priorityfedex_economyusps_first_class_mail_internationalusps_priority_mail_internationallandmark_parcelapc_parcelpoint2point_standardpoint2point_directpoint2point_packetfedex_international_ground。请参阅 承运人文档 获取承运人可用服务级别的完整列表。
ship_from 必填发货地址。 hash
ship_from.city发货地址的城市、城镇、区、郊区或村庄的字符串。
ship_from.country 必填发货国家字符串,由 两位字母 ISO 代码 表示。
ship_from.postal_code 必填发货地址的邮政编码字符串。
ship_from.state_code 必填发货地址的字符串(如有)。仅在加拿大和巴西要求。
ship_to 必填收货地址。 hash
ship_to.city 必填客户地址的城市、城镇、区、郊区或村庄的字符串。
ship_to.country 必填目的地国家的字符串,由 两位字母 ISO 代码 表示。
ship_to.postal_code 必需目的地邮政编码的字符串。根据进口国的不同,可能是可选的。
ship_to.state_code 必需目的地州代码的字符串(如果可用)。仅在加拿大和巴西要求。
ship_to.type 必需目的地地址的类型。可能的值包括 residential commercial

示例请求

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
  "currency": "USD",
  "items_amount": 168.99,
  "packages": [
    {
      "id": "1",
      "dimensions": {
        "height": 19.0,
        "length": 15.0,
        "unit": "inch",
        "width": 15.0
      },
      "insured_amount": 33.22,
      "type": null,
      "weight": 32.0,
      "weight_unit": "pound"
    }
  ],
  "pickup_date": "2020-07-06T18:47:04.629+0000",
  "service_level": null,
  "ship_from": {
    "city": "St George",
    "country": "US",
    "postal_code": "84770",
    "state_code": "UT"
  },
  "ship_to": {
    "city": "Campinas",
    "country": "BR",
    "postal_code": "75828-000",
    "state_code": "SP",
    "type": "residential"
  }
}

示例响应

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
  "id": "ship_5p67angIDnS91CyfpW55YZ",
  "currency": {
    "id": "curr_1Rp9lhXSRXvEWVs97k2PHE",
    "base": "USD",
    "date": "2020-02-04T18:47:04.629+0000",
    "rates": []
  },
  "errors": [
    {
      "details": {
        "id": "rtqt_7cz80Ny8dToSqoWlHTJJnP",
        "service_level": "FEDEX_EXPRESS_SAVER",
        "display_name": "FedEx Express Saver"
      },
      "message": "[868] Service is not allowed.  ",
      "type": "fedex_api"
    }
  ],
  "quotes": [
    {
      "id": "rtqt_4BUyxLEUeoU6zDdprCRoUV",
      "amount_subtotal": 943.18,
      "mode": {
        "delivery_date_estimate": null,
        "display_name": "UPS Expedited ",
        "rates": [
          {
            "amount": 848.31,
            "note": "UPS api: standard rate",
            "type": "retail_shipping"
          },
          {
            "amount": 64.4,
            "note": "UPS api: fuel surcharge",
            "type": "fuel_surcharge"
          },
          {
            "amount": 40.0,
            "note": "UPS api: extended area",
            "type": "carrier_fee"
          },
          {
            "amount": -9.53,
            "note": "UPS negotiated discount",
            "type": "negotiated_discount"
          }
        ],
        "service_level": "UPS_WORLDWIDE_EXPEDITED",
        "transit_business_days": null,
        "transit_days": null
      },
      "packages": [
        {
          "id": "1",
          "weight": {
            "billable": 32.0,
            "dimensional": 30.7554,
            "factor": 139,
            "weight_unit": "pound"
          }
        }
      ],
      "weight": {
        "billable": 32.0,
        "unit": "pound"
      }
    },
    {
      "id": "rtqt_1jyuPdiE5uIBcYzhO54DAb",
      "amount_subtotal": 1058.86,
      "weight": {
        "billable": 32.0,
        "unit": "pound"
      },
      "mode": {
        "delivery_date_estimate": null,
        "display_name": "UPS Saver ",
        "rates": [
          {
            "amount": 957.26,
            "note": "UPS api: standard rate",
            "type": "retail_shipping"
          },
          {
            "amount": 72.3,
            "note": "UPS api: fuel surcharge",
            "type": "fuel_surcharge"
          },
          {
            "amount": 40.0,
            "note": "UPS api: extended area",
            "type": "carrier_fee"
          },
          {
            "amount": -10.7,
            "note": "UPS negotiated discount",
            "type": "negotiated_discount"
          }
        ],
        "service_level": "UPS_SAVER",
        "transit_business_days": null,
        "transit_days": null
      },
      "packages": [
        {
          "id": "1",
          "weight": {
            "billable": 32.0,
            "dimensional": 30.7554,
            "factor": 139,
            "weight_unit": "pound"
          }
        }
      ]
    }
  ]
}

这个页面有帮助吗?


有问题吗?

联系我们。
在本页上: