沙盒访问令牌不起作用 [Easyship]

问题描述 投票:0回答:1

我们必须尝试集成 Easyship 快递 API。我们面临以下问题。

{
    "rates": [],
    "messages": [
        "Sorry, we couldn't find any shipping solutions based on the information provided."
    ]
}

更多信息,我分享了请求参数和API响应。

API URL:- https://api.easyship.com/v2/rates

请求参数:

{
  "origin_address": {
    "postal_code": "91601",
    "city": "Los Ángeles",
    "state": "CA",
    "country_alpha2": "US"
  },
  "destination_address": {
    "postal_code": "95140",
    "city": "Mount Hamilton",
    "state": "CA",
    "country_alpha2": "US"
  },
  "parcels": [
    {
      "total_actual_weight": 5,
      "items": [
        {
          "quantity": 1,
          "category": "mobile_phones",
          "dimensions": {
            "width": 10,
            "height": 10,
            "length": 25
          },
          "description": "Apple iPad",
          "actual_weight": 5,
          "declared_currency": "USD",
          "declared_customs_value": 49500.55
        }
      ]
    }
  ]
}

响应参数:

{
  "status": "failure",
  "errors": [
    "Sorry, we couldn't find any shipping solutions based on the information provided."
  ],
  "request_id": "545b5f76a41e2994a13f384559dee625",
  "timestamp": "2022-10-12T10:09:21.272Z"
}

注:

  • 此请求参数与生产访问令牌一起使用。
  • 我们已针对此问题应用了所有可能的解决方案,但没有找到任何结果。
  • 此外,我们不想使用生产访问令牌,因为我们正处于开发阶段。所以请提供使用沙盒解决方案。
api httprequest sandbox
1个回答
0
投票

确保你使用了正确的令牌,我将身体结构切换到了这个,它对我有用

{
  "origin_address": {
    "line_1": "Kennedy Town",
    "line_2": "Block 3",
    "state": "Yuen Long",
    "city": "Hong Kong",
    "postal_code": "0000",
    "country_alpha2": "HK",
    "contact_name": "Foo Bar",
    "company_name": null,
    "contact_phone": null,
    "contact_email": "[email protected]"
  },
  "destination_address": {
    "country_alpha2": "HK",
    "line_1": "Kennedy Town",
    "line_2": "Block 3",
    "state": "Yuen Long",
    "city": "Hong Kong",
    "postal_code": "0000",
    "contact_name": "Foo Bar",
    "company_name": null,
    "contact_phone": null,
    "contact_email": "[email protected]"
  },
  "incoterms": "DDU",
  "insurance": {
    "is_insured": false
  },
  "courier_selection": {
    "show_courier_logo_url": false,
    "apply_shipping_rules": true
  },
  "shipping_settings": {
    "units": {
      "weight": "kg",
      "dimensions": "cm"
    }
  },
  "parcels": [
    {
      "box": null,
      "items": [
        {
          "quantity": 2,
          "dimensions": {
            "length": 1,
            "width": 2,
            "height": 3
          },
          "description": "item",
          "category": "fashion",
          "sku": "sku",
          "origin_country_alpha2": "HK",
          "actual_weight": 10,
          "declared_currency": "USD",
          "declared_customs_value": 20
        }
      ],
      "total_actual_weight": 1
    }
  ]
}
© www.soinside.com 2019 - 2024. All rights reserved.