【问题标题】:Fedex API giving error value for ratesFedex API 为费率提供错误值
【发布时间】:2015-04-15 07:56:05
【问题描述】:

为什么我会收到 FedEx API 的回复?当到处搜索时,我得到的回复就像您错误地输入了您的托运人编号但我输入正确。我收到了回复

$response = $client ->getRates($request);

stdClass Object
(
[HighestSeverity] => WARNING
[Notifications] => Array
    (
        [0] => stdClass Object
            (
                [Severity] => WARNING
                [Source] => crs
                [Code] => 556
                [Message] => There are no valid services available. 
                [LocalizedMessage] => There are no valid services available. 
            )

        [1] => stdClass Object
            (
                [Severity] => NOTE
                [Source] => crs
                [Code] => 820
                [Message] => The destination state/province code has been changed.  
                [LocalizedMessage] => The destination state/province code has been changed.  
            )

    )

[TransactionDetail] => stdClass Object
    (
        [CustomerTransactionId] =>  *** Rate Available Services Request v7 using PHP ***
    )

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

我要求像下面这样发货

[RequestedShipment] => Array
        (
            [DropoffType] => REGULAR_PICKUP
            [ShipTimestamp] => 2015-04-15T13:19:32+05:30
            [Shipper] => Array
                (
                    [Address] => Array
                        (
                            [StreetLines] => Array
                                (
                                    [0] => 1202 Chalet Ln
                                )

                            [City] => 
                            [StateOrProvinceCode] => AR
                            [PostalCode] => 72601
                            [CountryCode] => US
                        )

                )

            [Recipient] => Array
                (
                    [Address] => Array
                        (
                            [PostalCode] => 97005
                            [CountryCode] => US
                        )

                )

            [ShippingChargesPayment] => Array
                (
                    [PaymentType] => SENDER
                    [Payor] => Array
                        (
                            [AccountNumber] => 510087623
                            [CountryCode] => US
                        )

                )

            [RateRequestTypes] => LIST
            [PackageCount] => 1
            [PackageDetail] => INDIVIDUAL_PACKAGES
            [RequestedPackageLineItems] => Array
                (
                    [0] => Array
                        (
                            [Weight] => Array
                                (
                                    [Value] => 1.25
                                    [Units] => LB
                                )

                            [Dimensions] => Array
                                (
                                    [Length] => 100
                                    [Width] => 100
                                    [Height] => 100
                                    [Units] => IN
                                )

                        )

                )

        )

【问题讨论】:

    标签: php fedex


    【解决方案1】:

    您的请求引起了我的注意,有两点:

    1. 收件人地址不包含状态值。我不完全确定 FedEx 是否需要,但许多运营商确实需要州代码。
    2. 包装尺寸为 100x100x100。根据http://images.fedex.com/us/services/pdf/packaging/GrlPkgGuidelines_fxcom.pdf,这超过了最大值。周长限制,因此您需要使用 FedEx Freight,这是一个不同的 API。这可以解释“无有效服务”错误。

    【讨论】:

    • 谢谢西蒙。这就是问题所在,我给出的维度是错误的
    【解决方案2】:

    对我来说,问题是 FedexRateServiceRequest 需要 Zip、CountryCode 和 State。没有状态我得到了同样的错误。

    rate_request.RequestedShipment.Recipient.Address.StateOrProvinceCode = 'CA'
    

    【讨论】:

      猜你喜欢
      • 2023-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多