问题
I'm building a Magento store with US and UK storefronts using UPS for shipping. UPS rates, as returned by the API, are fine in the US, but extremely high for the UK -- £20+ for a 2.5 KG package shipping from and to fairly approximate addresses in the UK. I get the feeling it's returning rates for shipping from the UK to the US so maybe I need to make a UK-specific account, or use a different access URL, I'm not really sure. Here's my request:
<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
<AccessLicenseNumber>(my license number)</AccessLicenseNumber>
<UserId>(my username)</UserId>
<Password>(my password)</Password>
</AccessRequest>
<?xml version="1.0"?>
<RatingServiceSelectionRequest xml:lang="en-US">
<Request>
<TransactionReference>
<CustomerContext>Rating and Service</CustomerContext>
<XpciVersion>1.0</XpciVersion>
</TransactionReference>
<RequestAction>Rate</RequestAction>
<RequestOption>Shop</RequestOption>
</Request>
<PickupType>
<Code>01</Code>
<Description>Regular Daily Pickup</Description>
</PickupType>
<Shipment>
<Shipper>
<ShipperNumber>(shipper number)</ShipperNumber>
<Address>
<City>Lambourn Woodlands</City>
<PostalCode>RG177TJ</PostalCode>
<CountryCode>GB</CountryCode>
<StateProvinceCode>Berkshire</StateProvinceCode>
</Address>
</Shipper>
<ShipTo>
<Address>
<PostalCode>W1F 7SD</PostalCode>
<CountryCode>GB</CountryCode>
<ResidentialAddress>01</ResidentialAddress>
<StateProvinceCode></StateProvinceCode><ResidentialAddressIndicator>01</ResidentialAddressIndicator>
</Address>
</ShipTo>
<ShipFrom>
<Address>
<PostalCode>RG177TJ</PostalCode>
<CountryCode>GB</CountryCode>
<StateProvinceCode>Berkshire</StateProvinceCode>
</Address>
</ShipFrom>
<Package>
<PackagingType><Code>00</Code></PackagingType>
<PackageWeight>
<UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement>
<Weight>2.5</Weight>
</PackageWeight>
</Package>
<RateInformation><NegotiatedRatesIndicator/></RateInformation>
</Shipment>
</RatingServiceSelectionRequest>
... and here's the response:
<?xml version="1.0"?>
<RatingServiceSelectionResponse>
<Response>
<TransactionReference>
<CustomerContext>Rating and Service</CustomerContext>
<XpciVersion>1.0</XpciVersion>
</TransactionReference>
<ResponseStatusCode>1</ResponseStatusCode>
<ResponseStatusDescription>Success</ResponseStatusDescription>
</Response>
<RatedShipment>
<Service>
<Code>11</Code>
</Service>
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
<BillingWeight>
<UnitOfMeasurement>
<Code>KGS</Code>
</UnitOfMeasurement>
<Weight>3.0</Weight>
</BillingWeight>
<TransportationCharges>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>22.63</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>22.63</MonetaryValue>
</TotalCharges>
<GuaranteedDaysToDelivery/>
<ScheduledDeliveryTime/>
<RatedPackage>
<TransportationCharges>
<CurrencyCode/>
<MonetaryValue/>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode/>
<MonetaryValue/>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode/>
<MonetaryValue/>
</TotalCharges>
<Weight>2.5</Weight>
<BillingWeight>
<UnitOfMeasurement>
<Code/>
</UnitOfMeasurement>
<Weight/>
</BillingWeight>
</RatedPackage>
</RatedShipment>
<RatedShipment>
<Service>
<Code>65</Code>
</Service>
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
<BillingWeight>
<UnitOfMeasurement>
<Code>KGS</Code>
</UnitOfMeasurement>
<Weight>2.5</Weight>
</BillingWeight>
<TransportationCharges>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>42.01</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>42.01</MonetaryValue>
</TotalCharges>
<GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
<ScheduledDeliveryTime>12:00 Noon</ScheduledDeliveryTime>
<RatedPackage>
<TransportationCharges>
<CurrencyCode/>
<MonetaryValue/>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode/>
<MonetaryValue/>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode/>
<MonetaryValue/>
</TotalCharges>
<Weight>2.5</Weight>
<BillingWeight>
<UnitOfMeasurement>
<Code/>
</UnitOfMeasurement>
<Weight/>
</BillingWeight>
</RatedPackage>
</RatedShipment>
<RatedShipment>
<Service>
<Code>54</Code>
</Service>
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
<BillingWeight>
<UnitOfMeasurement>
<Code>KGS</Code>
</UnitOfMeasurement>
<Weight>2.5</Weight>
</BillingWeight>
<TransportationCharges>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>73.02</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>73.02</MonetaryValue>
</TotalCharges>
<GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
<ScheduledDeliveryTime>9:00 A.M.</ScheduledDeliveryTime>
<RatedPackage>
<TransportationCharges>
<CurrencyCode/>
<MonetaryValue/>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode/>
<MonetaryValue/>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode/>
<MonetaryValue/>
</TotalCharges>
<Weight>2.5</Weight>
<BillingWeight>
<UnitOfMeasurement>
<Code/>
</UnitOfMeasurement>
<Weight/>
</BillingWeight>
</RatedPackage>
</RatedShipment>
<RatedShipment>
<Service>
<Code>07</Code>
</Service>
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
<BillingWeight>
<UnitOfMeasurement>
<Code>KGS</Code>
</UnitOfMeasurement>
<Weight>2.5</Weight>
</BillingWeight>
<TransportationCharges>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>43.26</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>43.26</MonetaryValue>
</TotalCharges>
<GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
<ScheduledDeliveryTime>10:30 A.M.</ScheduledDeliveryTime>
<RatedPackage>
<TransportationCharges>
<CurrencyCode/>
<MonetaryValue/>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode/>
<MonetaryValue/>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode/>
<MonetaryValue/>
</TotalCharges>
<Weight>2.5</Weight>
<BillingWeight>
<UnitOfMeasurement>
<Code/>
</UnitOfMeasurement>
<Weight/>
</BillingWeight>
</RatedPackage>
</RatedShipment>
</RatingServiceSelectionResponse>
Does anyone know what I'm doing wrong?
来源:https://stackoverflow.com/questions/4812135/ups-api-shipping-rates-in-the-uk-returning-way-too-high