POST /tax/calculations API, which uses whichever engine the entity has.
Create a tax rule
Rules belong to a legal entity and are managed in the dashboard under Tax → Tax Rates. There is no public API for rules.- Open Tax → Tax Rates and click Create Rule.
- Configure it:
- Country — required.
- State — a state or province, for jurisdictions that tax below country level. Leave empty for a country-wide rule.
- Tax rate — the percentage to apply.
- Tax type —
vat,gst,hst,pst,qst,igst,jct,sales_tax,service_tax, orlease_tax. Printed on the invoice and used for reporting. - Taxability reason — how the line should be treated (below).
- Save.
Rule matching
A rule is matched on the customer’s billing address, from most specific to least: a rule with matching country and state wins over a country-only rule for the same country. If nothing matches, no tax is applied. Because rules are keyed on jurisdiction, every line on an invoice to a given customer gets the same treatment.Taxability reasons
The reason records why a line was taxed as it was. It appears on the invoice and on each line’stax_reason in the API.
Common setups
Standard rate
Create a rule for the country (and state, where relevant) at the applicable rate with reasonstandard_rated. Repeat for each jurisdiction where you are registered. Rates change; review them periodically — Alguna does not update them for you.
Reverse charge (EU B2B)
Reverse charge is applied by a rule, not detected automatically:- Create a rule for the customer’s country at 0%.
- Set the taxability reason to
reverse_charge. - Record the customer’s VAT ID in
tax_idon their tax settings so the treatment is defensible. See Customer Tax Settings.
Zero-rated
Create a rule for the jurisdiction at 0% with reasonzero_rated.
Exempt customer
There is no exemption toggle. A customer who should not be charged tax has their own tax settings set to a 0%tax_rate with tax_reason customer_exempt, and their tax_id recorded so the treatment can be justified. Invoice lines for that customer then carry customer_exempt. See Customer Tax Settings.
Customer tax settings
Each customer carries its own tax fields, set in the dashboard under the customer’s Tax settings and returned onGET /customers/{id}: tax_country (ISO 3166-1 alpha-2), tax_id, tax_rate (a decimal fraction, 0.20 = 20%), tax_reason, tax_type, and tax_status. They are not writable through POST or PATCH /customers. When they are set they take precedence over the entity’s rules for that customer; leave tax_rate at zero and the reason unset to let the rules decide. See Customer Tax Settings.
How tax is calculated on an invoice
- Location — the customer’s
tax_country(falling back to the billing address) gives country and state. - Customer settings — if the customer has a
tax_rateandtax_reasonof their own, those apply to every line. - Rule — otherwise, the most specific matching rule for the legal entity issuing the invoice.
- Amount —
tax_amount = amount_excluding_tax × rateper line; the invoicetaxis the sum.
POST /tax/calculations, where the address and tax IDs come from the request instead of the customer record, and tax_behavior: "inclusive" backs the tax out of amounts that already include it. See the Tax overview.
Multiple legal entities
Each legal entity has its own rule set, so a US entity can carry state-by-state sales tax while an EU entity carries VAT rules. Customers are assigned to a legal entity; the invoice is issued — and taxed — by that entity. Legal entities are managed in the dashboard.Reporting
Every invoice line records its rate, amount, type, and reason. To reconcile what you collected:- Tax → Transactions in the dashboard lists taxed documents by period and jurisdiction.
GET /tax/calculationslists API-driven calculations withtax_datefilters;GET /invoiceswith date filters plus each invoice’sline_items[].tax_rate/tax_amountcovers subscription invoices. See Data Exports.
Best practices
Keep rules current
Rates change. Put a reminder on the calendar; Alguna applies what you configured.
Record tax IDs
Reverse charge or
customer_exempt without a recorded tax_id is hard to defend in an audit.Prefer rules over per-customer rates
A per-customer
tax_rate overrides the rules and has to be maintained by hand; reserve it for genuine exceptions.Switch engines when rules sprawl
Once you have nexus in many US states or sell to consumers across the EU, an external provider is cheaper than maintaining the table.