<?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>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>
