Total a set of line items with tax
calculate_totalsAdds up line items, applies discounts, and applies the tax for a country — the same arithmetic QuoteBill uses, rounded to the currency and with each tax component rounded separately.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | Canadian province or territory code (for example QC, ON). Only accepted when country is CA. | |
| country | Yes | Two-letter ISO country code of the place of supply, for example KR, JP, DE, GB. | |
| taxRate | No | Tax rate as a percentage, for example 10 for 10%. Overrides the published rate. Use it where the country has no single rate, such as the United States. | |
| lineItems | Yes | Line items. A row with type "header" is a section heading and is not charged. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| needs | No | Present when no total can be given until the person supplies a rate. | |
| total | Yes | Null until a rate is known; never a guessed zero. | |
| region | Yes | ||
| source | Yes | Where the rate was read from, and when. Null where no official source was verified. | |
| status | Yes | How far the rate can be relied on, for example standard-rate-estimate or jurisdiction-required. | |
| taxName | Yes | ||
| taxRate | Yes | Combined rate as a fraction, for example 0.1 for 10%. Null where the country has no single rate. | |
| currency | Yes | ||
| rounding | Yes | ||
| subtotal | Yes | ||
| checkedOn | Yes | ||
| lineItems | Yes | ||
| taxAmount | Yes | ||
| components | Yes | ||
| countryCode | Yes | ||
| needsReview | Yes | ||
| effectiveFrom | Yes | ||
| reviewReasons | Yes | ||
| currencyDigits | Yes | ||
| referenceSource | Yes | Where the rate was read from, and when. Null where no official source was verified. | |
| calculationAvailable | Yes |