【问题标题】:FedEx - Rates API - Invalid piece countFedEx - Rates API - 件数无效
【发布时间】:2019-05-20 18:24:43
【问题描述】:

我正在尝试获取两个地点之间的包裹的运费。 在请求数组中,我创建了正确的结构并在正确的位置提供了 NumberOfPieces。

stdClass Object
(
    //OTHER ELEMENTS REDACTED HERE
    [RequestedShipment] => stdClass Object
    (
         [Commodities] => Array
                    (
                        [NumberOfPieces] => 1
                        [Description] => Dog Meat
                        [CountryOfManufacture] => US
                        [Weight] => Array
                            (
                                [Units] => LB
                                [Value] => 20
                            )

                        [Quantity] => 1
                        [QuantityUnits] => EA
                        [UnitPrice] => Array
                            (
                                [Currency] => USD
                                [Amount] => 20
                            )

                        [CustomsValue] => Array
                            (
                                [Currency] => USD
                                [Amount] => 100
                            )

                    )

现在,问题是,API 的响应说我输入了无效的计件数。

stdClass Object
(
    [HighestSeverity] => ERROR
    [Notifications] => stdClass Object
        (
            [Severity] => ERROR
            [Source] => crs
            [Code] => 546
            [Message] => Invalid piece count. 
            [LocalizedMessage] => Invalid piece count. 
        )

    [Version] => stdClass Object
        (
            [ServiceId] => crs
            [Major] => 16
            [Intermediate] => 0
            [Minor] => 0
        )

)

我曾尝试在网上搜索可能的解决方案,但徒劳无功。有什么帮助吗?

【问题讨论】:

    标签: php api fedex


    【解决方案1】:

    今天终于遇到了同样的问题。运输结构需要在 RequestedShipment 中定义 Shipper 和 Recipient。以下使我能够成功获得费率:

    Array
    (
        [WebAuthenticationDetail] => Array(...)
        [ClientDetail] => Array(...)
        [Version] => Array(...)
        [RequestedShipment] => Array
            (
                [Shipper] => Array(...)
                [Recipient] => Array(...)
                [PackageCount] => 1
                [RequestedPackageLineItems] => Array(...)
            )
    )
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-07-23
      • 1970-01-01
      • 2014-05-21
      • 1970-01-01
      • 2023-04-07
      • 1970-01-01
      • 2016-07-10
      • 1970-01-01
      相关资源
      最近更新 更多