Engineering notes / Quoting

Designing a multi-currency quoting engine: data model notes

The data model decisions that matter when a quoting engine has to price in several currencies.

Short answer: separate the catalogue, the price rules, the rates and the quotes. Store money as an amount plus a currency. Freeze everything a quote used when you create a version, and keep every version. These choices keep quotes reproducible and easy to explain.

These notes are kept general on purpose. For a real project with a quoting engine, see Maika, tour quoting.

Four columns: catalogue, price rules, rates, and quotes with versions.
Figure 1Four groups of data. Prices and rates change, so a quote keeps its own copy.

Money is an amount and a currency

A price without a currency is a bug waiting to happen. Store the amount and the currency together everywhere. Keep amounts in the lowest unit of the currency when you calculate, and round only at the end, in one place.

Catalogue and price rules

The catalogue holds items, options and supplier prices. The price rules say how a customer price follows from them. Keep rules as data with a clear order, so you can explain why a price came out the way it did.

Rates and dates

Decide which rate a quote uses and when it is fixed. Store the rate with its date. A quote then shows exactly which conversion it used, even months later.

Quote versions are immutable

When a quote is sent, freeze it. A change creates a new version, with its own frozen prices and rates. The customer and your team can always see which version was sent, and nothing shifts underneath an accepted quote.

Hand over to the CRM

A quote belongs to a customer and moves through statuses such as draft, sent, accepted and expired. Even a light CRM needs these links, so link customer, quote and status from the start. The article on what a quoting tool needs covers the wider picture.

Frequently asked questions

How should I store prices in several currencies?

As an amount plus a currency code, always together. Never store a bare number.

When should I fix the exchange rate?

Pick a rule, for example at the time of quoting, and store the rate with its date. The important part is that the rule is clear.

Why keep every quote version?

So you can always explain what the customer saw. A quote that changes after it is sent causes disputes.

Where do rounding errors come from?

From rounding at many steps. Calculate in the lowest unit and round once at the end.

Do I need a CRM inside the quoting tool?

A light one helps. It links the customer, the quote and the status, so nothing is lost between steps.

Where can I read about a real project?

See the case study on Maika and the Custom Software service.