Using IP to calculate Tax

I understand that if I sell things online, I need to calculate Taxes based on customer location. Can I use IP to locate customer or should I ask them explicitly?

If it is fine to use IP to identify customer’s Country, is it fine to locate customer State/Province.

I need it because Canada has different taxes in different Provinces.