FedEx:由于标签创建错误导致出货请求失败

时间:2013-09-23 19:06:36

标签: web-services fedex

我正在尝试使用FedEx网络服务创建运费并返回商业发票。我正在使用下面提供的请求值:

Array
(
    [WebAuthenticationDetail] => Array
        (
            [UserCredential] => Array
                (
                    [Key] => XXXXXXX
                    [Password] => XXXXXX
                )

        )

    [ClientDetail] => Array
        (
            [AccountNumber] => XXXX
            [MeterNumber] => XXXXX
        )

    [Version] => Array
        (
            [ServiceId] => ship
            [Major] => 13
            [Intermediate] => 0
            [Minor] => 0
        )

    [RequestedShipment] => Array
        (
            [DropoffType] => REGULAR_PICKUP
            [ShipTimestamp] => 2013-09-23T20:50:27+02:00
            [ServiceType] => FIRST_OVERNIGHT
            [PackagingType] => FEDEX_BOX
            [Shipper] => Array
                (
                    [Contact] => Array
                        (
                            [PersonName] => User
                            [CompanyName] => Company
                            [PhoneNumber] => 56757567456
                        )

                    [Address] => Array
                        (
                            [StreetLines] => Array
                                (
                                    [0] => 4400 test street
                                    [1] => apt 65, nro 6098
                                )

                            [City] => New York
                            [StateOrProvinceCode] => NY
                            [PostalCode] => 10018
                            [CountryCode] => US
                        )

                )

            [Recipient] => Array
                (
                    [Contact] => Array
                        (
                            [PersonName] => Test
                            [CompanyName] => Test
                            [PhoneNumber] => 4563456
                        )

                    [Address] => Array
                        (
                            [StreetLines] => Array
                                (
                                    [0] => Test
                                    [1] => 
                                )

                            [City] => New York
                            [StateOrProvinceCode] => NY
                            [PostalCode] => 10019
                            [CountryCode] => US
                        )

                )

            [ShippingChargesPayment] => Array
                (
                    [PaymentType] => SENDER
                    [Payor] => Array
                        (
                            [ResponsibleParty] => Array
                                (
                                    [AccountNumber] => XXXXXX
                                    [Contact] => 
                                    [Address] => Array
                                        (
                                            [CountryCode] => US
                                        )

                                )

                        )

                )

            [CustomsClearanceDetail] => Array
                (
                    [DutiesPayment] => Array
                        (
                            [PaymentType] => SENDER
                            [Payor] => Array
                                (
                                    [ResponsibleParty] => Array
                                        (
                                            [AccountNumber] => XXXX
                                            [Contact] => 
                                            [Address] => Array
                                                (
                                                    [CountryCode] => US
                                                )

                                        )

                                )

                        )

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

                    [Commodities] => Array
                        (
                            [0] => Array
                                (
                                    [NumberOfPieces] => 1
                                    [Description] => XXXX
                                    [CountryOfManufacture] => US
                                    [Weight] => Array
                                        (
                                            [Value] => 1
                                            [Units] => LB
                                        )

                                    [Quantity] => 3
                                    [QuantityUnits] => PCS
                                    [UnitPrice] => Array
                                        (
                                            [Currency] => USD
                                            [Amount] => 1
                                        )

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

                                )

                        )

                )

            [RateRequestTypes] => LIST
            [PackageCount] => 1
            [RequestedPackageLineItems] => Array
                (
                    [0] => Array
                        (
                            [SequenceNumber] => 1
                            [GroupPackageCount] => 1
                            [Weight] => Array
                                (
                                    [Value] => 1
                                    [Units] => LB
                                )

                            [Dimensions] => Array
                                (
                                    [Length] => 2
                                    [Width] => 3
                                    [Height] => 4
                                    [Units] => IN
                                )

                        )

                )

            [LabelSpecification] => Array
                (
                    [LabelFormatType] => COMMON2D
                    [ImageType] => PDF
                    [LabelStockType] => PAPER_7X4.75
                )

            [ShippingDocumentSpecification] => Array
                (
                    [ShippingDocumentTypes] => Array
                        (
                            [0] => COMMERCIAL_INVOICE
                        )

                )

        )

)

如果我不包含ShippingDocumentSpecification部分,它可以很好地工作。但是当我添加它时,无论如何我都会得到这样的响应:

stdClass Object
(
    [HighestSeverity] => FAILURE
    [Notifications] => stdClass Object
        (
            [Severity] => FAILURE
            [Source] => ship
            [Code] => 6050
            [Message] => Shipment request failed due to label creation error
            [LocalizedMessage] => Shipment request failed due to label creation error
            [MessageParameters] => stdClass Object
                (
                    [Id] => CAUSE
                    [Value] => General error from JCLS
                )

        )

    [Version] => stdClass Object
        (
            [ServiceId] => ship
            [Major] => 13
            [Intermediate] => 0
            [Minor] => 0
        )

)

为什么会这样?请求中哪里有错误,导致响应无助于识别它。此外,我正在使用fedex测试帐户,这与此错误有关吗?...

感谢。

1 个答案:

答案 0 :(得分:0)

您的部分要求不完整:

        [ShippingDocumentSpecification] => Array
            (
                [ShippingDocumentTypes] => Array
                    (
                        [0] => COMMERCIAL_INVOICE
                    )

                [CommercialInvoiceDetail] => Array
                    (
                        [Format] => Array
                            (
                                [StockType] => PAPER_LETTER
                                [ImageType] => PDF
                                [ImageTypeSpecified] => 1
                                [StockTypeSpecified] => 1
                            )

                    )

            )