Price update made easier

We have enhanced endpoint Pricelist update PATCH /api/pricelists/{id} in several ways to make updates easier and more powerfull.

The request now accepts items data.vatRate (effectively changes the VAT rate of the product/variant) and data.includingVat (if the price for the product/variant is primarily saved as including/excluding VAT). These are kind of settings affecting the internal storage of each price. They can be provided for each pricelist and each variant (or product) independently. When changed, the actual prices will be recalculated to match the new settings.

In addition to the current price object, which requires input prices as internally stored (with or without VAT – see includingVat attribute), it is now alternatively possible to provide priceWithVat or priceWithoutVat objects. These two new objects share the same structure as price object, but also signalize the VAT status of the given price explicitly. API will convert the price if necessary. The internal flag includingVat will not be modified in this case (unless data.includingVat is also part of the request).

For example assume current settings are includingVat = true and vatRate = 21.00. If you provide priceWithoutVat.price = 100.00, the price will be recalculated and stored as 121.00. If you provide priceWithVat.price = 100.00, the price will be stored as 100.00. For the price.price = 100 there is no recalculation, the prices is stored as provided (we assume you respect the internal includingVat setting).

Post navigation