DEV Community
Follow
Quebec's QST does not compound: the tax rule most checkout code gets wrong
Most checkout tax systems apply rates sequentially to the running total, a method that is incorrect for Quebec. This common error results in customers overpaying slightly without immediate detection. Quebec imposes a 5% GST and a 9.975% QST, but the QST is calculated on the price before GST, not on the GST-inclusive amount. This means the two taxes should add together, not compound.A naive approach to calculating tax on a $100 sale in Quebec might incorrectly add QST to the GST-inclusive price, leading to a total of $115.47. The correct calculation, however, yields a total of $114.98. This difference of $0.49 per $100 sale, or approximately half a percent of revenue, accumulates significantly on larger sales volumes. Inaccurate tax calculations can cause discrepancies between a business's records and government remittances.The simplified sequential tax model works in most of Canada because provinces like Ontario, Alberta, and British Columbia have tax structures where rates can be added or applied to the same base. Quebec's tax system uniquely requires QST to be calculated on a base that excludes GST. A more accurate model distinguishes per-component bases, where each tax component has its own rate and base.Adopting a correct tax calculation model ensures accurate tax collection across all Canadian provinces and territories. This also accounts for specific provincial tax rules, such as Quebec's non-compounding QST or Manitoba's children's clothing cap. Businesses selling into Canada are advised to implement accurate tax calculation methods rather than relying on approximations. For assistance, services like TrueNorth API offer precise tax calculations across Canada.