Overview
An invoice can contain two types of adjustment:- Allowances (discounts) decrease the invoice amount.
- Charges (fees) increase the invoice amount.
- Document level: the adjustment applies to the full invoice (for example an early payment discount or a handling fee).
- Line level: the adjustment applies to one line item (for example a bulk discount on one product).
Send the request
All request bodies on this page go to the same two endpoints:POST /api/validate/json (to examine the body) and POST /api/documents/ (to create the document). Only the JSON body changes. The request below creates the basic invoice; replace its body with a body from this page.
406) if the Peppol ID of the vendor is not one of the Peppol IDs of your company.
The API returns 201 with the document in state DRAFT. The response contains the calculated totals as strings:
Response (shortened)
Validation is not a separate mandatory call.
POST /api/documents/ rejects a payload that does not pass the same rules. Use POST /api/validate/json while you develop, because it returns all rule failures and the generated UBL.items, allowances or charges part of the body. Add them to a complete document before you send them.
Document-level allowances
A document-level allowance decreases the invoice amount after the line items are added together.Early payment discount
- Line items: €1,000.00
- Allowance: -€50.00
subtotal: €950.00total_tax(21%): €199.50invoice_total: €1,149.50
More than one document-level allowance
- Volume discount: -€50.00
- Promotional discount: -€25.00
subtotal: €925.00total_tax(21%): €194.25invoice_total: €1,119.25
Document-level charges
A document-level charge increases the invoice amount.Shipping fee
- Line items: €1,000.00
- Charge: +€25.00
subtotal: €1,025.00total_tax(21%): €215.25invoice_total: €1,240.25
More than one charge
Combine allowances and charges
One invoice can contain allowances and charges:- Line items: €1,000.00
- Allowance: -€100.00
- Charge: +€30.00
subtotal: €930.00total_tax(21%): €195.30invoice_total: €1,125.30
Line-level allowances
A line-level allowance applies to one line item.The
amount of a line is the net amount of the line: quantity × unit_price, minus the allowances of the line, plus the charges of the line. The API writes amount to the UBL as the line amount, and calculates the document totals from quantity, unit_price and the line allowances and charges. Make sure that the two results are equal.Discount on one product
- Line 1: (10 × €100) - €100 = €900.00
- Line 2: 5 × €50 = €250.00
subtotal: €1,150.00total_tax(21%): €241.50invoice_total: €1,391.50
More than one allowance on one line
- Base: 20 × €100 = €2,000.00
- Volume discount: -€100.00
- Loyalty discount: -€50.00
- Line amount: €1,850.00
Line-level charges
A line-level charge applies to one line item.- Base: 1 × €500 = €500.00
- Special handling: +€50.00
- Line amount: €550.00
Complete example with the two levels
This invoice uses allowances and charges at document level and at line level:- Line 1: (20 × €100) - €200 = €1,800.00
- Line 2: 10 × €50 = €500.00
- Line 3: €1,000 + €100 = €1,100.00
- Sum of the lines: €3,400.00
- Allowance: -€150.00
- Charge: +€50.00
subtotal: €3,300.00total_discount: €150.00
total_tax(21% of €3,300.00): €693.00invoice_total: €3,993.00
Tax on allowances and charges
Each document-level allowance and charge has atax_rate (default 21.00) and a tax_code (default S). The API adds the amount to the tax base of the lines that have the same tax_rate.
Same tax rate
If all lines have one tax rate, use that rate for the allowance or charge:Different tax rates
If the invoice has more than one tax rate, give each allowance or charge the rate of the lines to which it applies:Allowances and charges without VAT
For an allowance or charge on items that are exempt from VAT, sendtax_rate 0.00 and the applicable tax category code:
tax_rate 0.00 changes subtotal but does not change total_tax.
Validation of the result
The API converts the JSON body to a Peppol BIS Billing 3.0 document. The rules of that standard depend on the content of the invoice: the country of the vendor, the document type, the tax category codes and the tax rates. For example, each document-level allowance must have a reason or a reason code, and its tax category must agree with its rate.Validation is not a separate mandatory call.
POST /api/documents/ rejects a payload that does not pass the same rules. Use POST /api/validate/json while you develop, because it returns all rule failures and the generated UBL.Recommended practices
Give a clear reason
Give a clear reason
Give each allowance and charge a reason that the customer can understand.Clear:Not clear:
Select the correct level
Select the correct level
Use the document level when the allowance or charge applies to the full order:
- Early payment discounts
- Shipping for the full order
- Promotional discounts on the full order
- Bulk discount on one product
- Special handling for a fragile item
- Promotion on one product
Round the amounts
Round the amounts
When you calculate an amount from a percentage, round the result to 2 decimals before you send it:
Use the tax category of the items
Use the tax category of the items
Give each document-level allowance and charge the tax category code and the tax rate of the items to which it applies.
State the payment terms
State the payment terms
When you give an early payment discount, state the terms in
payment_term:Frequent cases
1
Volume discounts
2
Shipping and handling
3
Loyalty programme discounts
4
Financial charges
Percentage allowances and charges
To state an allowance or a charge as a percentage, sendmultiplier_factor and base_amount together with amount. multiplier_factor is the percentage (send 10 for 10%; minimum 0, maximum 100, 2 decimals maximum).
subtotal 900.00, total_discount 100.00, total_tax 189.00, invoice_total 1089.00.
A charge accepts the same three fields (multiplier_factor, base_amount, amount).
Allowance reason codes
Thereason_code of an allowance accepts these UNCL5189 codes (send the code as a string):
The
reason_code of a charge accepts the UNCL7161 codes. The full list is in the ChargeReasonCode schema of the API reference.
Next Steps
Invoice totals and calculations
Read how the API calculates and examines the totals
Create credit notes
Create credit notes with allowances
Validation during development
Examine complex invoices while you develop
LineItem
See all fields of a line item, an allowance and a charge