pullingshots / Shipment

Perl interface into various shipping web service API's - FedEx, UPS, Purolator, Temando, Canada Post
https://metacpan.org/pod/Shipment
19 stars 19 forks source link

Can't get UPS negotiated rates #10

Closed mrmaloof closed 13 years ago

mrmaloof commented 13 years ago

When I set the negotiated_rates indicator I can not get rates.

From my debug session:

Shipment::UPS::CODE(0x105f1ca00)(/Library/Perl/5.14.1/Shipment/UPS.pm:241):
241:          my $rate = ($self->negotiated_rates) ? $service->get_NegotiatedRateCharges->get_TotalCharge->get_MonetaryValue : $service->get_TotalCharges->get_MonetaryValue;
  DB<20> x $self->negotiated_rates                                                                                      
0  1
  DB<21> x $service->get_NegotiatedRateCharges->get_TotalCharge->get_MonetaryValue                                      
Can't call method "get_TotalCharge" on an undefined value at (eval 2114)[/System/Library/Perl/5.14.1/perl5db.pl:640] line 2.

  DB<23> x $service->get_TotalCharges->get_MonetaryValue                                                                
0  SOAP::WSDL::XSD::Typelib::Builtin::string=SCALAR(0x106ecd958)
   -> 70
pullingshots commented 13 years ago

You will need to have your Account/UserID qualified to receive negotiated rates. I believe the only way to do this is by contacting UPS support.

If the account/userid is not qualified, it will be handled better now with a notice, instead of bailing out with an error.

mrmaloof commented 13 years ago

Thanks Andrew,

Thats what I figured at first be we had the UPS account reps enable negotiated rates and we have added the appropriate accounts to our account.

pullingshots commented 13 years ago

I can verify that it is an issue with your Account / User ID combination. The notice I am getting directly from the API response from UPS using the credentials you provided is the following:

<Alert xsi:type="xs:anyType" xmlns="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0"><Code xsi:type="string" xmlns="http://www.ups.com/XMLSchema/XOLTWS/Rate/v1.1">120900</Code><Description xsi:type="string" xmlns="http://www.ups.com/XMLSchema/XOLTWS/Rate/v1.1">User Id and Shipper Number combination is not qualified to receive negotiated rates</Description></Alert>

Maybe you can use the alert code - 120900 - when communicating with your UPS account rep.

Hope that helps.

mrmaloof commented 13 years ago

Ok, Thanks, Andrew.

I will get with my account rep.