Why is POST /order/ or POST /invoice/ giving the error “Enhetspris må være med mva siden enhetspris på ordre er med mva.” / “Enhetspris må være uten mva siden enhetspris på ordre er uten mva.”?
This error usually means that you have defined
unitPriceExcludingVatCurrency on the order lines where the order is set to show price including VAT, or
unitPriceIncludingVatCurrency on the order lines where the order has been set to show prices excluding VAT. It may also happen if you define both unitPrice attributes on the order lines.
The default setting is determined by the invoice settings of the account. You need to override the default in the order-object if you post values that do not match the Tripletex account configuration.
To solve this you can use the attribute
"isPrioritizeAmountsIncludingVat" to TRUE or FALSE.
isPrioritizeAmountsIncludingVat"=TRUE then you define
"unitPriceIncludingVatCurrency" on the orderlines.
"isPrioritizeAmountsIncludingVat"=FALSE then you define
"unitPriceExcludingVatCurrency" on the orderlines.
How do I set the income account that order lines are posted to?
This is determined one of two ways. If you specify a product then the products income account will be used (if set) as long as the VAT-type on the product matches the VAT-type on the order line as well as on the income account it has been set to. Otherwise, if any of these conditions are not met, the default will be used. If you use only description (do not define a product order lines will be posted to the default account for the VAT-type. You can however use description + product to add a description to the orderline as well as the product without it impacting the posting.
We use the default setting (set in Tripletex via Accounts -> Settings -> Accounting rules -> Posting rules) in case any of the above is missing. The end user can change what account is default if they wish.
You can not set an income account directly on the orderLine/override this.
To use an example:
Product A has VAT type 3, income account 3620 (25% output VAT, high rate). Income account 3620 is also set to VAT type 3.
We produce an order line with Product A and VAT type 3
The income posting is set to account 3620
We produce another order line with the same product, but set VAT type 33 (12% output VAT, low rate)
The income posting is now set to whatever the default for orderlines with VAT type 33 (default 3002)
How is the invoice send method determined?
The customer object of the order/invoice determines the send method for invoices. This value can be fetched via GET customer (invoiceSendMethod)
How do I check if an invoice has been paid?
GET invoice(/id) returns a value for amountOutstanding, if this is 0 then the invoice is paid/credited. If you need more details see “How can I find payment information for specific invoices via the API?” below.
Is it possible to stop Tripletex from sending the invoice I create?
sendToCustomer=FALSE (default TRUE) in both
PUT order/id/:invoice and
POST /invoice/ to create an invoice without Tripletex sending it to the customer automatically.
How can I correct the validation message “The unit price must be exclusive VAT since the unit price on the order is exclusive VAT.”
The order object can be set to either accept orderlines including VAT or excluding VAT with the optional boolean value isPrioritizeAmountsIncludingVat. If you encounter this issue it would be a good idea to provide the value directly when creating an order and then using the appropriate price value on orderlines for the order.
Example: if order is set to isPrioritizeAmountsIncludingVat = true then you should provide orderlines with only unitPriceIncludingVatCurrency.
You can always check the value of amountOutstanding on any given invoice object (anything above 0 means there is an amount outstanding). If you need more details this method should work:
- find Invoice.customerId and invoice.number
- get all postings where customerId = Invoice.customerId
- locally find where invoiceNumber = invoice.number
- if any has closegroupId, then everything is paid or credited in full
- but you can sum all posts where invoiceNumber = invoice.number (betalinger)
- and if you have a closegroupId, you will have to get other postings with closegroupId to find related credit notes
We fetch currency data at 06:10 and 18:10 every day from https://data.norges-bank.no/api/data/EXR/B..NOK.SP?format=csv&lastNObservations=14&locale=en