DotNetShipping icon indicating copy to clipboard operation
DotNetShipping copied to clipboard

Canadian UPS Shipping

Open OpacityKelly opened this issue 9 years ago • 1 comments

Hi guys! I can't seem to get Canadian addresses with postal codes to work. Please let me know if I'm missing something. Also, I need to get rates for Canada to US. US to US works great though. Any help would be great - Much appreciated!

            var packages = new List<Package>();
            foreach (var item in dovm.OrderItems.ToList())
                foreach (var box in item.Boxes)
                    packages.Add(new Package(box.Length, box.Width, box.Height, box.Weight, item.Price));

            var origin = new Address("", "", "V3S8E5", "CA");
            var destination = new Address("", "", "T8E2C7", "CA"); // US Address

            var rateManager = new RateManager();

            rateManager.AddProvider(new UPSProvider(upsLicenseNumber, upsUserId, upsPassword));
            Shipment shipment = rateManager.GetRates(origin, destination, packages);

OpacityKelly avatar Apr 19 '16 23:04 OpacityKelly

I just tried this in the same app with my account login and your addresses and it worked.

screen shot 2016-04-20 at 12 59 36 am

  • Are you sure packages.Count() > 0?
  • Does your UPS account have access to the Canadian rates (I'm not sure you can get an account without access to those rates, but something to consider).

Kyle

kylewest avatar Apr 20 '16 05:04 kylewest