Get started
Quickstart
Send a sales tax calculation from your server and read the result.
- Create an API key
Open API keys in your dashboard to create one. New here? Create an account and API key. Keep the key on your server.
- Choose an example
Use cURL, or install the Node.js or Python SDK. This example calculates a CAD 100 SaaS sale in Ontario.
- Send the request
Keep the calculation ID and request ID with your record. Check
outcomebefore using the amounts.
Set your API key
Set SALESTAX_API_KEY in your server environment. Keep secret keys out of browser and mobile code.
export SALESTAX_API_KEY="stca_your_key"Send a calculation
This example uses a CAD 100 transaction in Ontario. Replace its details with the facts for your transaction.
curl --request POST \
--url "https://api.salestaxcalculatorapi.com/v1/calculations" \
--header "Authorization: Bearer $SALESTAX_API_KEY"
--header "Content-Type: application/json" \
--header "Idempotency-Key: order-1001-calc" \
--data '{"reference":"order-1001","transaction_date":"2026-08-29","currency":"CAD","tax_behavior":"exclusive","billing_event":"subscription_start","seller":{"country":"CA","channel_role":"direct_legal_supplier","registrations":[{"country":"CA","state":"ON","type":"gst_hst","effective_from":"2026-01-01"}]},"customer":{"type":"consumer","address":{"country":"CA","state":"ON","postal_code":"M5V 2T6"}},"lines":[{"reference":"subscription","amount":"100.00","quantity":"1","tax_code":"saas"}]}'Read the response
HTTP 201 means the API saved the calculation. Check outcome before using tax or total.
{
"id": "calc_01J6A3S8Z6K4M6T2Y2W9M5X8Q0",
"object": "calculation",
"reference": "order-1001",
"outcome": "calculated",
"currency": "CAD",
"subtotal": "100.00",
"taxable_amount": "100.00",
"tax": "13.00",
"total": "113.00",
"lines": [
{
"id": "line_01J6A3T26X8BS4Y8XJKZ0H8F3P",
"reference": "subscription",
"outcome": "calculated",
"subtotal": "100.00",
"taxable_amount": "100.00",
"tax": "13.00",
"total": "113.00",
"explanation": "Tax was calculated for this sale."
}
],
"explanation": "Tax was calculated for this sale.",
"request_id": "req_01J6A3RZ1HT2K3W2X8R7P1J4C9",
"created_at": "2026-08-29T12:00:00Z"
}For this example, outcome is calculated, tax is CAD 13.00, and total is CAD 113.00.
