About this endpoint
What it does
Calculates VAT or GST for an amount using either a provided rate, a country lookup, or line-level rates. It can also derive the net and gross amounts from a VAT amount, and it supports multi-line invoices grouped by rate.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| lines | Object Array | No | Invoice lines at different rates: returns a subtotal per rate (byRate) and a grand total. Use instead of amount. Each item must include amount; ratePct is optional and defaults to the top-level ratePct or the country's standard rate. Maximum 200 items. |
| lines[].amount | Number | Yes | The line amount (net, or gross when amountIncludesTax is true). Minimum 0. |
| lines[].ratePct | Number | No | This line's rate in percent. Minimum 0. Defaults to the top-level ratePct or the country's standard rate. |
| amount | Number | No | The amount, in any currency. Send this, or vatAmount, or lines. |
| country | String | No | Country name used to look up the standard VAT/GST rate. Examples in the schema include Germany, United Kingdom, Australia, Singapore, UAE. Canada uses province-group entries such as Canada - Ontario HST. |
| ratePct | Number | No | VAT/GST rate in percent. Required unless country is sent. Takes priority over country. |
| vatAmount | Number | No | The VAT amount shown on a receipt: returns the net and gross it implies at the rate. Requires a rate above 0. Minimum 0. Use instead of amount. |
| amountIncludesTax | Boolean | No | true when amount already includes the tax, so the tax is taken out of it. |
Response
The endpoint returns a JSON object with the result under result. Which fields appear depends on how you called it, as shown in the last column.
| Field | Type | Description | Returned |
|---|---|---|---|
| net | Number | Amount before tax. | Always |
| tax | Number | The VAT or GST, rounded to the cent. | Always |
| gross | Number | Net plus tax. | Always |
| ratePct | Number | The rate that was applied, in percent. | Single amount and vatAmount |
| rateSource | String | Where the rate came from, for example ratePct sent by the caller. | When a rate was used |
| mode | String | lines for an invoice with lines, or fromVatAmount when you sent vatAmount. | lines and vatAmount |
| amountsIncludeTax | Boolean | true if the line amounts already included tax. | lines |
| lineCount | Integer | Number of lines sent. | lines |
| byRate | Array | One row per rate, with the totals for the lines at that rate. | lines |
| byRate[].ratePct | Number | The rate for this group, in percent. | lines |
| byRate[].lines | Integer | How many lines are in this group. | lines |
| byRate[].net | Number | Net subtotal of the group. | lines |
| byRate[].tax | Number | Tax on the group, worked out once on the subtotal. | lines |
| byRate[].gross | Number | Net plus tax for the group. | lines |
| vatAmount | Number | The VAT amount you sent. | vatAmount |
| netRange | Object | The lowest (min) and highest (max) net amounts that would print this same VAT on a receipt, since receipts round VAT to the cent. | vatAmount |
| country | String | The country used to find the rate. | When country was sent |
| standardRatePct | Number | That country's standard rate. | When country was sent |
| reducedRatesPct | Number Array | That country's reduced rates. | When country was sent |
| ratesAsOf | String | The month the country rates are valid for. | When country was sent |
| taxYear | Integer | Tax year of the rates. | Always |
| dataStatus | String | Status of the rate data. caller-supplied means you sent the rate, and estimate means it came from the country table. | Always |
| sources | String | Where the rates come from. | Always |
| notes | String Array | Notes about how this result was worked out. | Always |
| disclaimer | String | Use notice. | Always |
| steps | Array | The calculation, one step at a time. | Always |
| steps[].label | String | Name of the step, for example Lines at 44%. | Always |
| steps[].formula | String | The formula used. | Always |
| steps[].inputs | Object | The numbers that went into the step. | Always |
| steps[].result | Number or String | The result of the step. | Always |



