Skip to main content

Historical Pricing

Every change keeps the version it replaces: prices, articles, pricelists and rounding profiles. Ask for any past moment with as_of and you get the price that was in force then, on any pricelist, with the pricelist settings, article data, rounding, exchange rates and VAT rates that applied at that moment.

Use it to verify an invoice, settle a dispute, audit a change, or reproduce the price behind an old order or quote.


Querying the Past​

Add as_of to a price query:

POST /price/query
{
"skus": ["SKU-CHAIR-001"],
"pricelist_filter": { "pricelists": ["customer-acme"] },
"currency_code": "SEK",
"tax_area": "SE",
"as_of": "2026-01-15T00:00:00Z"
}

Inherited prices, bundles, scheduled changes, exchange rates and VAT rates all resolve as they were at that moment. So do the pricelists (whether each was active, its currency and VAT mode), the articles (whether each was a bundle, and its components) and the rounding profiles, including which profile was the default.


Articles, Pricelists and Rounding Profiles​

Each write of an article, pricelist or rounding profile is a new version. Read one as it stood at a moment with asOf:

WhatRead as of a moment
Articles: name, metadata, bundle componentsGET /article/{sku} and GET /article
Pricelists: currency, VAT mode, parent, rules, metadata, active windowGET /pricelist/{code} and GET /pricelist
Rounding profiles, and which profile is a defaultGET /rounding/{code} and GET /rounding

Each answer carries valid_from, the moment that version took effect. Search (/article/search, /pricelist/search) and the metadata summaries (/article/metadata, /pricelist/metadata) answer for now only.

A write takes effect now, or at a later valid_from; see Scheduled Updates. A past valid_from also means now, as a price's past start_date does, so history is never rewritten. A write that says the same as the version in force stores nothing.

An article, pricelist or rounding profile's first version applies from the beginning: an article created today is shown, with its metadata, to a query about last year. Those written before this history was kept count as first versions.


When Rules or Metadata Change​

A price is calculated with the inputs in force when it takes effect: the pricelist's rules, the article's metadata, the parent pricelist's metadata, and, for an inherited price, the parent's price. When one of those changes, the prices it affects are recalculated from that moment on, now or at a scheduled date. That covers the pricelist's own prices, the prices it inherits, and the pricelists that inherit from it. Prices before the change stay as they were.


The Changes to One Price​

To see how a price has changed, list its versions:

GET /changes/{pricelist}/{sku}?days=30

The answer lists the versions written in the last days (default 30), newest first. Each holds the price as it stood after that change: its fields, sales price and quantity breaks, when it took effect, and who wrote it. A price without changes in the period answers 404. The console shows the same list under History on a price's page.


How Long History Is Kept​

Prices​

By default, every version is kept.

If your plan includes history retention, you can limit how much is kept per SKU and pricelist with these settings:

SettingEffect
retention.enabledTurns retention on. Default false.
retention.max.versionsKeep at most this many versions. 0 means no limit.
retention.history.msKeep versions from the last N milliseconds. Default 30 days.

Your plan sets the largest values you can choose. Retention never removes the version in force or anything scheduled after it, and always keeps the most recent few versions. Versions it removes can no longer be queried with as_of, and their removal does not appear in the change log.

Set them like any other setting; see Settings.

Articles, Pricelists and Rounding Profiles​

Your plan sets how much history these keep. By default, each keeps at most 10 versions, and a version that went out of force more than a year ago is removed.

The version in force, anything scheduled after it, and the version in force when that year began are always kept, so a query within the year is exact. A query from before the oldest kept version sees that version.


Use Cases​

  • Customer invoice verification and dispute resolution
  • Regulatory compliance and pricing audits
  • Reconstructing prices for long-running orders or quotes
  • Finding when a price changed, by stepping through dates
  • Checking a scheduled price, assortment or rule change before it goes live

Summary​

Every change to prices, articles, pricelists and rounding profiles is kept as history, within your plan's retention. A query with as_of returns the prices in force at that moment, calculated as they were then.