Amounts
Every sale has different amounts based on line items, discounts and payments. This document explains how to calculate the amounts for a sale.
Line Items
Every line item has different price levels. The price levels are:
grossTotal
: The total price of the line item including taxes and any line item discounts applied.netTotal
: The total price of the line item excluding taxes and any line item discounts applied.totalTax
: The total amount of taxes applied to the line item.baseGrossTotal
: The total price of the line item including taxes and no line item discounts applied.grossUnitPrice
: The price of a single unit of the line item including taxes and any line item discounts applied.baseGrossUnitPrice
: The price of a single unit of the line item including taxes and no line item discounts applied.
For every line item, the following formulas apply:
The grossTotal
is the grossUnitPrice
multiplied by the quantity
:
The baseGrossTotal
is the baseGrossUnitPrice
multiplied by the quantity
:
The baseGrossTotal
and grossTotal
differ by the sum of all applied discounts:
grossTotal
and netTotal
differ by the totalTax
:
totalTax
is the sum of all taxes applied to the line item:
Line Item Taxes
Every line item can have multiple taxes applied. When sending taxes the taxAmount
is required. The taxAmount
represents the tax that is due for this type of tax (e.g. VAT) for this line item.
When sending a grossAmount
and netAmount
it must hold that:
When multiple taxes are applied to a line item, the taxAmount
, netAmount
and grossAmount
per tax item refer to the application of this tax only. If taxes are stacked they can differ between entries.
For example when a line item has a grossAmount
of €100 and a netAmount
of €85 and two taxes are applied, one with a taxAmount
of €10 and one with a taxAmount
of €5 then the taxes
array look like this:
{
"taxes": [
{
"taxAmount": {
"amount": "5",
"currency": "EUR"
},
"grossAmount": {
"amount": "100",
"currency": "EUR"
},
"netAmount": {
"amount": "85",
"currency": "EUR"
}
},
{
"taxAmount": {
"amount": "10",
"currency": "EUR"
},
"grossAmount": {
"amount": "100",
"currency": "EUR"
},
"netAmount": {
"amount": "90",
"currency": "EUR"
}
}
]
}
Line Item Discounts
Every line item can have multiple discounts applied. When sending discounts the totalGrossAmount
is required. The totalGrossAmount
represents the total discount that is due for this line item by this discount.
Transaction level discounts are applied independently of line item discounts. The totalGrossAmount
of a line item discount is the total amount of the discount for this line item.
Given a sale with a single line item with a baseGrossTotal
of €100 and a line item discount of €10 and a transaction level discount of €5 the sale looks like this:
{
"lineItems": [
{
"baseGrossTotal": {
"amount": "100",
"currency": "EUR"
},
"grossTotal": {
"amount": "90",
"currency": "EUR"
},
"discounts": [
{
"totalGrossAmount": {
"amount": "10",
"currency": "EUR"
}
}
]
}
],
"discounts": [
{
"totalGrossAmount": {
"amount": "5",
"currency": "EUR"
}
}
],
"totals": {
"grossAmount": {
"amount": "85",
"currency": "EUR"
}
}
}
So the following relationships hold:
Totals
The grossAmount
is the total price of the sale including taxes and any sale level discounts applied.
netAmount
and grossAmount
differ by the taxAmount
: