我尝试实施fedex api来计算一个国家的邮政编码的运费。这对美国来说很好。它也在美国工作到其他国家(为IN和AU试过)。但当我尝试从印度或澳大利亚购买两个邮政编码作为托运人和收件人地址。它给出了以下错误: -
The transaction returned an Error.
Severity: ERROR
Source: crs
Code: 691
Message: The PurposeOfShipmentType is null, empty or invalid.
LocalizedMessage: The PurposeOfShipmentType is null, empty or invalid.
不知道是什么问题。我在wsdl文件中检查了PurposeOfShipmentType的值,它显示在xml代码下面: -
First occurrence
<xs:element name="Purpose" type="ns:PurposeOfShipmentType" minOccurs="0">
<xs:annotation>
<xs:documentation>The reason for the shipment. Note: SOLD is not a valid purpose for a Proforma Invoice.</xs:documentation>
</xs:annotation>
</xs:element>
second occurrence
<xs:simpleType name="PurposeOfShipmentType">
<xs:restriction base="xs:string">
<xs:enumeration value="GIFT"/>
<xs:enumeration value="NOT_SOLD"/>
<xs:enumeration value="PERSONAL_EFFECTS"/>
<xs:enumeration value="REPAIR_AND_RETURN"/>
<xs:enumeration value="SAMPLE"/>
<xs:enumeration value="SOLD"/>
</xs:restriction>
</xs:simpleType>
不要理解应该是什么价值。下面是我发送到$ client - &gt; getRates($ request)函数
的数组$request = Array
(
[WebAuthenticationDetail] => Array
(
[UserCredential] => Array
(
[Key] => *******
[Password] => *******
)
)
[ClientDetail] => Array
(
[AccountNumber] => *****
[MeterNumber] => *****
)
[TransactionDetail] => Array
(
[CustomerTransactionId] => *** Rate Available Services Request using PHP ***
)
[Version] => Array
(
[ServiceId] => crs
[Major] => 16
[Intermediate] => 0
[Minor] => 0
)
[ReturnTransitAndCommit] => 1
[RequestedShipment] => Array
(
[DropoffType] => REGULAR_PICKUP
[ShipTimestamp] => 2014-10-03T11:37:53+02:00
[Shipper] => Array
(
[Address] => Array
(
[StreetLines] => Array
(
[0] => 10 Fed Ex Pkwy
)
[City] => Memphis
[StateOrProvinceCode] =>
[PostalCode] => 110016
[CountryCode] => IN
)
)
[Recipient] => Array
(
[Address] => Array
(
[StreetLines] => Array
(
[0] => 13450 Farmcrest Ct
)
[City] => Herndon
[StateOrProvinceCode] =>
[PostalCode] => 302015
[CountryCode] => IN
)
)
[ShippingChargesPayment] => Array
(
[PaymentType] => SENDER
[Payor] => Array
(
[ResponsibleParty] => Array
(
[AccountNumber] => 510087500
[Contact] =>
[Address] => Array
(
[CountryCode] => IN
)
)
)
)
[PackageCount] => 2
[RequestedPackageLineItems] => Array
(
[0] => Array
(
[SequenceNumber] => 1
[GroupPackageCount] => 1
[Weight] => Array
(
[Value] => 2
[Units] => LB
)
[Dimensions] => Array
(
[Length] => 10
[Width] => 10
[Height] => 3
[Units] => IN
)
)
[1] => Array
(
[SequenceNumber] => 2
[GroupPackageCount] => 1
[Weight] => Array
(
[Value] => 5
[Units] => LB
)
[Dimensions] => Array
(
[Length] => 20
[Width] => 20
[Height] => 10
[Units] => IN
)
)
)
)
)
答案 0 :(得分:6)
为了使印度到印度的国内运输工作,您需要在请求中添加PurposeOfShipment
类型。这条线在联邦快递的Magento代码中并不标准。该行将作为CustomsClearanceDetail
下的子项添加到CommercialInvoice
标题中,然后该行下的Purpose
行可以具有PurposeOfShipment
具有的任何值。
以下是我使用的请求的示例,该请求返回了印度到印度航运的正确运费估算值。
'CustomsClearanceDetail' => array(
'CommercialInvoice' => array(
'Purpose' => "SOLD"
)
),
答案 1 :(得分:0)
如果我没有错,联邦快递的测试账户不会返回印度特定信息。除非经Fedex团队认证并且他们为您提供生产密钥,否则您可能无法获得您的帐户的费率。如果我的理解错误,请纠正我