简体   繁体   English

Fedex API提供费率错误值

[英]Fedex API giving error value for rates

why I'm getting this response from FedEx API? 为什么我从FedEx API收到此响应? when searched everywhere I'm getting response like you wrongly entered your shipper number but i entered it right. 当到处搜索时,我收到的答复就像您错误输入了您的托运人编号,但我输入的是正确的。 I got the response in 我得到了回应

$response = $client ->getRates($request); $ 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
    )
)

I requested shipment like below 我要求如下运输

[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
                                )

                        )

                )

        )

Two things caught my attention with your request: 我的两件事引起了您的注意:

  1. The recipient address doesn't contain a state value. 收件人地址不包含状态值。 I'm not completely sure whether it's required by FedEx, but many carriers do require the state code. 我不确定FedEx是否需要它,但是许多运营商确实需要州代码。
  2. The package dimensions are 100x100x100. 包装尺寸为100x100x100。 According to http://images.fedex.com/us/services/pdf/packaging/GrlPkgGuidelines_fxcom.pdf , this exceeds the max. 根据http://images.fedex.com/us/services/pdf/packaging/GrlPkgGuidelines_fxcom.pdf ,这超出了最大值。 girth restriction and thus you would need to use FedEx Freight, which is a different API. 腰围限制,因此您需要使用FedEx Freight,这是一个不同的API。 This would explain the "no valid services" error. 这将解释“没有有效的服务”错误。

For me, issue was that the FedexRateServiceRequest requires Zip, CountryCode AND State. 对我来说,问题在于FedexRateServiceRequest需要Zip,CountryCode和State。 Without state I got the same error. 没有状态,我会遇到同样的错误。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM