Fedex API дает значение ошибки для ставок

почему я получаю этот ответ от 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
                                )

                        )

                )

        )

person Anju    schedule 15.04.2015    source источник


Ответы (2)


В вашем запросе мое внимание привлекли две вещи:

  1. Адрес получателя не содержит значения состояния. Я не совсем уверен, требуется ли это FedEx, но многим перевозчикам требуется код штата.
  2. Размеры упаковки 100х100х100. Согласно http://images.fedex.com/us/services/pdf/packaging/GrlPkgGuidelines_fxcom.pdf, это превышает макс. ограничение обхвата, поэтому вам нужно будет использовать FedEx Freight, который представляет собой другой API. Это объяснило бы ошибку «нет действительных служб».
person Simon Kreuz    schedule 15.04.2015
comment
Спасибо Саймон. В этом была проблема, размер, который я дал, был неправильным - person Anju; 16.04.2015

Для меня проблема заключалась в том, что FedexRateServiceRequest требует Zip, CountryCode И State. Без состояния я получил ту же ошибку.

rate_request.RequestedShipment.Recipient.Address.StateOrProvinceCode = 'CA'
person beetree    schedule 21.12.2018