<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: TrueNorth API</title>
    <description>The latest articles on DEV Community by TrueNorth API (@m1s4gh).</description>
    <link>https://dev.to/m1s4gh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4148181%2F1041fa07-87f9-4ced-8560-3f91626c5af1.png</url>
      <title>DEV Community: TrueNorth API</title>
      <link>https://dev.to/m1s4gh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/m1s4gh"/>
    <language>en</language>
    <item>
      <title>Quebec's QST does not compound: the tax rule most checkout code gets wrong</title>
      <dc:creator>TrueNorth API</dc:creator>
      <pubDate>Mon, 05 Oct 2026 17:18:16 +0000</pubDate>
      <link>https://dev.to/m1s4gh/quebecs-qst-does-not-compound-the-tax-rule-most-checkout-code-gets-wrong-21pi</link>
      <guid>https://dev.to/m1s4gh/quebecs-qst-does-not-compound-the-tax-rule-most-checkout-code-gets-wrong-21pi</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bug nobody notices
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it is so common
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"https://prsorfaeexugwkvjuwzw.supabase.co/functions/v1/canadian-api/calculate-tax?province=QC&amp;amp;amount=100&amp;amp;description=general%20merchandise"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"TRUENORTH_API_KEY: your_key_here"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;If you sell into Canada and your checkout guesses at taxes, stop guessing: &lt;a href="https://truenorthapi.ca" rel="noopener noreferrer"&gt;https://truenorthapi.ca&lt;/a&gt;&lt;/p&gt;

</description>
      <category>canada</category>
      <category>ecommerce</category>
      <category>api</category>
      <category>tax</category>
    </item>
    <item>
      <title>Private Sale vs Dealer: The Tax Bill Is Not the Same</title>
      <dc:creator>TrueNorth API</dc:creator>
      <pubDate>Sat, 03 Oct 2026 08:09:32 +0000</pubDate>
      <link>https://dev.to/m1s4gh/private-sale-vs-dealer-the-tax-bill-is-not-the-same-55h4</link>
      <guid>https://dev.to/m1s4gh/private-sale-vs-dealer-the-tax-bill-is-not-the-same-55h4</guid>
      <description>&lt;p&gt;You found the same truck twice. One is on a dealer lot for $38,000. One is in a driveway three blocks over for $35,000. The private one looks cheaper, right?&lt;/p&gt;

&lt;p&gt;Not so fast. The tax rules for private and dealer vehicle sales in Canada are different, and the gap can flip which deal is actually better. Here is how it really works.&lt;/p&gt;

&lt;h2&gt;
  
  
  GST and HST: the big split
&lt;/h2&gt;

&lt;p&gt;This is the main difference. When you buy from a licensed dealer, GST (or HST in the harmonized provinces) is charged on the sale, every time, no exceptions.&lt;/p&gt;

&lt;p&gt;Private sales between individuals are generally exempt from GST/HST. If your neighbour sells you his car, there is no GST on top. That 5% (or 13 to 15% in HST provinces) simply does not apply.&lt;/p&gt;

&lt;p&gt;So on a $35,000 private purchase in Alberta, you pay $35,000 plus registration. The same vehicle at a dealer for $35,000 costs you $36,750 after GST. That is a real $1,750 difference before we even talk about provincial tax.&lt;/p&gt;

&lt;h2&gt;
  
  
  PST: you pay it either way (mostly)
&lt;/h2&gt;

&lt;p&gt;Here is where people get tripped up. Just because there is no GST on a private sale does not mean there is no tax at all.&lt;/p&gt;

&lt;p&gt;In BC, you pay PST when you register the vehicle at ICBC, private sale or not. The rate on vehicles is 7% to 10% depending on price, and it jumps to 15% or 20% on luxury vehicles over $125,000. In Ontario, retail sales tax applies to private vehicle transfers. Quebec, Manitoba, Saskatchewan, they all have their version. The buyer pays at registration, and there is no getting around it.&lt;/p&gt;

&lt;p&gt;So that $35,000 private truck in BC still gets hit with PST at registration. The dealer truck gets PST plus GST. You save the GST portion on the private deal, not the whole tax bill.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trade in credit: dealers only
&lt;/h2&gt;

&lt;p&gt;This one is underrated. When you trade in your old vehicle at a dealership, the trade value comes off the taxable amount in most provinces. Trading in a $12,000 car against a $38,000 purchase means you pay tax on $26,000, not $38,000.&lt;/p&gt;

&lt;p&gt;In BC at 12% combined tax, that is $1,440 back in your pocket just from the trade in credit.&lt;/p&gt;

&lt;p&gt;Private sales have no trade in mechanism. You sell your old car separately, you buy the new one separately, and you pay full tax on the full purchase price. If you have a trade in, the dealer route often wins on tax alone, even at a higher sticker price.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fees get taxed too
&lt;/h2&gt;

&lt;p&gt;Dealers add documentation fees, freight, PDI, tire levies, air conditioning tax, all the line items. Every one of those is part of the taxable amount. A $499 doc fee in BC costs you about $60 in extra tax.&lt;/p&gt;

&lt;p&gt;Private sales are simpler. The price is the price. No fees, no tax on fees.&lt;/p&gt;

&lt;h2&gt;
  
  
  The luxury wrinkle
&lt;/h2&gt;

&lt;p&gt;Over $100,000, the federal luxury tax kicks in on new vehicles, and the math gets interesting fast. BC has its own quirk where PST gets included in the GST calculation at the higher vehicle tax brackets. These are the cases where guessing the tax bill goes badly wrong, because the rules stack in ways nobody does in their head.&lt;/p&gt;

&lt;h2&gt;
  
  
  So which is cheaper?
&lt;/h2&gt;

&lt;p&gt;It depends on the numbers, and that is the whole point. A private sale saves you the GST/HST but costs you the trade in credit. A dealer sale charges full tax but the trade in credit and the ability to finance can outweigh it. The only way to know is to run both scenarios with the real rates.&lt;/p&gt;

&lt;p&gt;That is why I built the tax engine behind TrueNorthAPI.ca. It handles all 13 provinces and territories, the GST/PST/HST splits, the luxury tax, the ZEV reductions in BC, the trade in math, all of it, through one API call. If you are building anything that touches vehicle pricing in Canada, a checkout, a calculator, a listing site, you should not be hardcoding these rates. They change, they have quirks, and getting them wrong is expensive.&lt;/p&gt;

&lt;p&gt;And if you just want the answer for your own deal, the DealerSpace deal calculator runs the full breakdown live. Punch in the price, the fees, the trade in, pick new or used, and it shows every tax line plus the true all in price before you sign anything. No account, no signup, just the numbers.&lt;/p&gt;

&lt;p&gt;Run both scenarios before you decide. The cheaper sticker price is not always the cheaper deal.&lt;/p&gt;

</description>
      <category>canada</category>
      <category>taxes</category>
      <category>ecommerce</category>
      <category>api</category>
    </item>
    <item>
      <title>I built a Canadian sales tax API that handles all 13 provinces and territories</title>
      <dc:creator>TrueNorth API</dc:creator>
      <pubDate>Mon, 28 Sep 2026 23:18:10 +0000</pubDate>
      <link>https://dev.to/m1s4gh/i-built-a-canadian-sales-tax-api-that-handles-all-13-provinces-and-territories-3k3g</link>
      <guid>https://dev.to/m1s4gh/i-built-a-canadian-sales-tax-api-that-handles-all-13-provinces-and-territories-3k3g</guid>
      <description>

&lt;p&gt;TrueNorth API validates a Canadian address and calculates the exact tax for it in two calls: 41 product tax categories, all 13 provinces and territories, five endpoints, one API key. Whether you sell from inside Canada or from outside it, this is the whole checkout tax flow.&lt;/p&gt;

&lt;p&gt;Here is a real example of why the details matter. Taylor Swift's official store sells the "Life of a Showgirl" CD for $17.99 USD and charges a BC buyer $18.89 total, which is $0.90 of tax. The correct BC total is $20.15, which is $2.16 of tax ($0.90 GST plus $1.26 PST). The store is a US seller collecting federal GST but not BC's 7% PST, so every BC order under-collects by exactly 7%. Details like that are exactly what TrueNorth API handles.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;Five endpoints, one API key in the &lt;code&gt;TrueNorthAPI-API-KEY&lt;/code&gt; header:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;GET /calculate-tax&lt;/code&gt; — exact tax for a price, province, and product category&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GET /classify-product&lt;/code&gt; — send a plain product description, get back the tax category&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GET /tax-categories&lt;/code&gt; — list all 41 product tax categories&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;POST /validate-address&lt;/code&gt; — Canadian address validation, valid or invalid with one short reason&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GET /shipping-check&lt;/code&gt; — deliverability check, warns on remote surcharge postal codes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The classifier understands ordinary wording. "organic cotton baby onesie" lands in children's clothing, "pre owned civic" lands in private used vehicles. Unknown products fall back to fully taxable, never under-collected.&lt;/p&gt;

&lt;h2&gt;
  
  
  The quirks it knows
&lt;/h2&gt;

&lt;p&gt;A few examples from the 41 categories across all 13 provinces and territories: basic groceries, prescription drugs, and feminine hygiene are zero-rated federally. Manitoba exempts children's clothing up to a $150 per-item cap. Ontario rebates the provincial HST portion on prepared food under $4. Quebec's QST is charged on the GST-exclusive price, not compounded. Nova Scotia runs 14% HST. New vehicles over $100,000 attract the federal luxury tax. These are the details that generic rate tables miss.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"https://prsorfaeexugwkvjuwzw.supabase.co/functions/v1/canadian-api/calculate-tax?province=BC&amp;amp;amount=17.99&amp;amp;description=compact%20disc"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"TrueNorthAPI-API-KEY: your_key_here"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Tax plus address, one flow
&lt;/h2&gt;

&lt;p&gt;Tax depends on the province, and the province comes from the address. Whether you sell from inside Canada or from outside it, the flow is the same: validate the customer's address, take the province code from the response, and calculate the tax.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. validate the address, get back the province&lt;/span&gt;
curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"https://prsorfaeexugwkvjuwzw.supabase.co/functions/v1/canadian-api/validate-address"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"TrueNorthAPI-API-KEY: your_key_here"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"address": "123 Main St, Vancouver, BC V6A 1A1"}'&lt;/span&gt;

&lt;span class="c"&gt;# 2. calculate tax for that province&lt;/span&gt;
curl &lt;span class="s2"&gt;"https://prsorfaeexugwkvjuwzw.supabase.co/functions/v1/canadian-api/calculate-tax?province=BC&amp;amp;amount=17.99&amp;amp;description=compact%20disc"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"TrueNorthAPI-API-KEY: your_key_here"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The address endpoint returns &lt;code&gt;valid&lt;/code&gt;, one short &lt;code&gt;reason&lt;/code&gt; when it is not, plus the &lt;code&gt;province_code&lt;/code&gt; and a &lt;code&gt;remote&lt;/code&gt; flag when the postal code checks out. That is the whole checkout tax flow in two calls.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;If you sell into Canada and your checkout guesses at taxes, stop guessing: &lt;a href="https://truenorthapi.ca" rel="noopener noreferrer"&gt;https://truenorthapi.ca&lt;/a&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>canada</category>
      <category>taxes</category>
      <category>ecommerce</category>
    </item>
  </channel>
</rss>
