DEV Community

TrueNorth API
TrueNorth API

Posted on

Quebec's QST does not compound: the tax rule most checkout code gets wrong

Most checkout tax code applies rates one after another, each on the running total. That model is wrong in Quebec, and the error is silent: every order comes out a little too high, the customer pays it, and nobody notices until reconciliation.

Quebec charges 5% GST, same as the rest of Canada, plus 9.975% QST. The rule that breaks naive code: QST is calculated on the selling price before GST, not on the GST inclusive amount. The two taxes add, they do not compound.

The bug nobody notices

When each rate is applied to the running total, QST lands on the GST inclusive amount instead of the selling price. On a $100 sale that gives $115.47. The correct total is $114.98.

That is $0.49 of phantom tax on a $100 sale, about half a percent of revenue. On $1M of Quebec sales, that is $4,987.50 collected from customers that was never owed, sitting in your remittance where Revenu Quebec's numbers will never match yours.

Why it is so common

In most of Canada the naive model happens to work. Ontario is a flat 13% HST, Alberta is just the 5% GST, and BC is 5% GST plus 7% PST where both apply to the same base, so adding the rates gives the right answer there too. Quebec is the one province where the second tax's base explicitly excludes the first tax. If your tax engine applies each rate to the running total, Quebec is the province that breaks it.

Try it

curl "https://prsorfaeexugwkvjuwzw.supabase.co/functions/v1/canadian-api/calculate-tax?province=QC&amount=100&description=general%20merchandise" \
  -H "TRUENORTH_API_KEY: your_key_here"
Enter fullscreen mode Exit fullscreen mode

TrueNorth API returns the exact tax for a price, province, and product category, with per component breakdowns, across all 13 provinces and territories. Quebec's non compounding QST, Manitoba's $150 children's clothing cap, Ontario's $4 prepared food rebate, the federal luxury tax over $100,000: all handled, so your checkout does not have to be.

Free tier is 10 calls a day, no card required. Pro is $19 CAD a month for 10,000 calls, Scale is $49 for 100,000.

If you sell into Canada and your checkout guesses at taxes, stop guessing: https://truenorthapi.ca

Top comments (0)