Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPS - UseNegotiatedRates not working because of StateProvinceCode #80

Open
elcapitanandres opened this issue Nov 10, 2017 · 0 comments
Open

Comments

@elcapitanandres
Copy link

When use UPS and UseNegotiatedRates = true with valid account and ShipperNumber, the server response doesn't contains the "NegotiatedRates" node. In the response details there is a Warning node "RatedShipmentWarning" = Invalid Origin State/Province.
Current code is not setting the Shipper province as you can see:

writer.WriteStartElement("Address");
writer.WriteElementString("PostalCode", Shipment.OriginAddress.PostalCode);
writer.WriteElementString("CountryCode", Shipment.OriginAddress.CountryCode);
writer.WriteEndElement(); // </Address>

Seems UPS needs the StateProvinceCode node in the Shipper Address if UseNegotiatedRates=true
If change code to:

writer.WriteStartElement("Address");
writer.WriteElementString("PostalCode", Shipment.OriginAddress.PostalCode);
writer.WriteElementString("CountryCode", Shipment.OriginAddress.CountryCode);
if (!string.IsNullOrWhiteSpace(Shipment.OriginAddress.State))//<RatedShipmentWarning>Invalid Origin State/Province</RatedShipmentWarning>
{
	writer.WriteElementString("StateProvinceCode", Shipment.OriginAddress.State);
}
writer.WriteEndElement(); // </Address>

I receive the NegotiatedRates node completed.
There is any reason why the origin "StateProvinceCode" is not set?
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant