Skip to main content
The API stores the amounts you send; it does not calculate them or check that they are consistent. This page describes how Noyax calculates them, so that quotes created through the API look and add up like quotes created in Noyax. Amounts are rounded to 2 decimals.

Line

Discount rate. The discounts of a line are applied one after another, so the line’s DiscountRate is the combined rate: DiscountRate = 100 × (1 − (1 − rate₁/100) × (1 − rate₂/100) × …) 10, 10 and 10 give 27.1. If the user entered a discount amount instead of rates, the rate is derived from it: DiscountAmount / (Quantity × UnitPrice) × 100. Discount amount. DiscountAmount = Quantity × UnitPrice × DiscountRate / 100, calculated on the price as entered (the gross price when VatIncluded is true). Amount excluding tax (AmountExcludingTax):
  • VatIncluded = false: Quantity × UnitPrice − DiscountAmount.
  • VatIncluded = true: the price contains VAT (and additional taxes added on top of the price), so (Quantity × UnitPrice − DiscountAmount) is divided by (1 + additional tax rate/100) × (1 + VatRate/100). For withholding-type additional taxes (such as income tax or corporate tax withholding) the divisor is 1 + additional tax rate/100 + VatRate/100.
Additional taxes. AdditionalTaxAmountN = AmountExcludingTax × AdditionalTaxRateN / 100. AdditionalTaxBaseN is the amount the tax was calculated on. VAT base (VatBase): AmountExcludingTax plus the additional tax amounts that are taxed with VAT, such as special consumption tax. Withholding-type additional taxes are not part of the VAT base. VAT amount: VatAmount = VatBase × VatRate / 100. Withholding (tevkifat): WithheldVatAmount = VatAmount × WithholdingNumerator / WithholdingDenominator. Withholding does not reduce the line amount including tax. Amount including tax (AmountIncludingTax): VatBase + VatAmount; when withholding-type additional taxes are not part of the VAT base, their amounts are added as well.

Quote totals

Totals are the sums of the line values:
  • SubTotal = sum of the lines’ AmountExcludingTax.
  • DiscountTotal = sum of the line discounts on a tax-excluded basis (for VatIncluded lines the line discount is divided by the same divisor as above).
  • VatTotal = sum of (VatAmountWithheldVatAmount). It is net of withholding.
  • AdditionalTaxTotal = sum of the additional tax amounts of all lines.
  • WithholdingTotal = sum of the lines’ WithheldVatAmount.
  • GrandTotal = SubTotal + VatTotal + AdditionalTaxTotal. Withholding is not subtracted again, because VatTotal is already net.
Totals can differ by a few cents from the sum of the rounded line values, because Noyax calculates the quote VAT from unrounded values.

Currencies

Line amounts are in the line’s own currency.
  • Quote in the company’s default currency, lines in another currency: each line amount is multiplied by the line’s ExchangeRate before it is added to the totals.
  • Quote in a foreign currency and lines in the same currency: the totals are the plain sums of the lines (no multiplication), and each line’s ExchangeRate is the rate against the default currency.
AverageExchangeRate is the amount-weighted average of the line exchange rates: the sum of AmountExcludingTax × ExchangeRate divided by the sum of AmountExcludingTax, where an exchange rate of 0 counts as 1. It is 1 when everything is in the default currency.