Skip to content
PreviewFix
Data conversion, pricing & spare parts7 min readReviewed

Deterministic prior-price maths and VIES VAT checks.

How to compute the lowest price applied during the preceding 30 days under Directive (EU) 2019/2161 (Article 6a) in integer minor units, avoid fake strikethrough RRP traps, and validate EU/NI B2B VAT numbers via VIES.

  • Directive (EU) 2019/2161 Art. 6a
  • CJEU C-330/23
  • VIES VAT
  • Integer minor units

Key engineering takeaways

Summary
  • Under Article 6a of Directive 98/6/EC (inserted by Directive (EU) 2019/2161), any consumer price-reduction announcement in the EU must indicate the lowest price applied by the trader during the period of not less than 30 days prior to the reduction.
  • As confirmed by the Court of Justice of the European Union (Case C-330/23, Aldi Süd), advertised percentage reductions (-25%) or 'save' claims must be calculated against that 30-day lowest prior price — not against an inflated temporary spike or arbitrary RRP.
  • Store timestamped price changes per (variantId, currency, country) in integer minor units so rolling 30-day window queries remain exact across multi-currency storefronts.
  • For B2B cross-border EU sales, validate buyer VAT numbers in two steps: instant offline country/check-digit syntax validation followed by live European Commission VIES verification with logged consultation metadata.

Published by MeWeBe Limited · Factual engineering reference

1. Computing the 30-day lowest prior price accurately in code

Directive (EU) 2019/2161 (the Enforcement and Modernisation / 'Omnibus' Directive) inserted Article 6a into Price Indication Directive 98/6/EC. Whenever a merchant announces a price reduction to EU consumers — whether via a strikethrough price, a percentage badge (-20%), a banner code applied storewide or a flash-sale callout — the listing must state the prior price, defined as the lowest price applied by that trader during a period of at least 30 days prior to the application of the price reduction.

In Case C-330/23 (*Verbraucherzentrale Baden-Württemberg e.V. v Aldi Süd Dienstleistungs-SE & Co. OHG*, 26 September 2024), the CJEU clarified that a price reduction expressed as a percentage or promotional highlight in a consumer announcement must be determined on the basis of that 30-day lowest prior price, even if the last selling price immediately before the promotion was higher.

Evaluating a 30-day window via POST /api/v1/engines/omnibus/lowest-priceSpecimen
// Price history over the 30 days before announcing a €79.00 sale on 2026-11-18:
// - Sold at €99.00 from 2026-10-15
// - Weekend dip to €84.00 on 2026-11-01
// - Raised back to €109.00 on 2026-11-05
{
  "currency": "EUR",
  "locale": "de-DE",
  "observations": [
    { "at": "2026-10-15T00:00:00Z", "priceMinor": 9900 },
    { "at": "2026-11-01T00:00:00Z", "priceMinor": 8400 },
    { "at": "2026-11-05T00:00:00Z", "priceMinor": 10900 }
  ]
}
// Deterministic engine result (0 API units):
// -> lowest30dMinor: 8400 (€84.00 — NOT €109.00!)
// -> Showing "-28% off €109.00" is non-compliant; real reduction vs 30-day low is €84.00 -> €79.00 (-5.95%).

2. Progressive markdowns, new arrivals and UK vs EU differences

Article 6a(3)–(5) gives EU Member States specific regulatory choices when transposing Directive (EU) 2019/2161 into national law (which is why checking the target country in /compliance matters):

  • Progressive uninterrupted price reductions (Art. 6a(5)): Where a Member State adopted the progressive-reduction option (for example during continuous end-of-season clearance €100 → €80 → €60 without intervening price increases), the prior price may remain the lowest price in the 30 days before the first step of that uninterrupted markdown chain — but if any price hike interrupts the chain, the clock resets.
  • Perishable goods & newly listed products (Art. 6a(3)–(4)): Member States may set different rules for goods liable to deteriorate or expire rapidly, and shorter windows where a SKU has been on the market for fewer than 30 days.
  • Personalised loyalty vouchers vs general promo codes: European Commission guidance (2021/C 526/02) distinguishes genuine individualised loyalty rewards (such as a personal birthday voucher) from public banner codes ('Use WINTER20 for 20% off everything'), which count as general price-reduction announcements.
  • United Kingdom position: The UK did not transpose Directive (EU) 2019/2161 post-Brexit, instead governing price promotions through consumer protection law (Digital Markets, Competition and Consumers Act 2024 unfair commercial practices rules and CTSI Pricing Practices Guide on genuine establishment periods and honest RRP comparisons).

3. Two-stage EU & Northern Ireland (XI) VAT verification via VIES

On B2B checkouts selling across EU borders, applying zero-rated intra-Community supply or reverse-charge VAT requires verifying that the buyer holds an active VAT registration in another Member State and retaining audit evidence. Calling the European Commission's VIES (VAT Information Exchange System) live API on every keystroke causes unnecessary latency and hits Member State tax-database maintenance windows.

Instead, run vat.validate in two stages: first, strip whitespace/hyphens and validate the 2-letter prefix + national check-digit/format pattern offline (remembering Greece uses EL rather than GR, and Northern Ireland traders moving goods under the Windsor Framework carry XI prefixes, whereas Great Britain GB numbers are checked via HMRC's UK VAT API rather than EU VIES). Second, once syntax passes at checkout submission, run checkVies: true and log the consultation timestamp, validity flag and returned trader name/address against the order.

SPEC · COM-OMNI-09 · Reviewed 18 November 2026

Omnibus prior-price & B2B VAT checkout controls

Deterministic checks implemented by omnibus.lowest-price and vat.validate

Engineering checklist
Checkout scenarioInput dataEngine ruleCommon pitfall
Standard sale badge (Was / Now)30-day (at, priceMinor) log in storefront currencymin(priceMinor) across [now - 30d, now)CJEU C-330/23 aligned
RRP / UVP comparison (no sale claim)Verified manufacturer RRP vs selling priceMust label clearly as RRP/UVP, not a 'sale' reductionDistinct from Art. 6a
EU B2B VAT ID (DE, FR, ES, NL…)Country prefix + national digitsOffline syntax check → live EC VIES lookupHandle Member State downtime
Greece (EL) & Northern Ireland (XI)EL + 9 digits / XI + 9 or 12 digitsMap GR → EL prefix; allow XI in VIES goods checksPrefix edge cases

Storefront engineering checklist for EU promotions & B2B VAT

  • Append an immutable (variant_id, currency, country, price_minor, observed_at) row on every price update — never overwrite only compare_at_price.
  • Compute percentage-off badges strictly from lowest30dMinor, suppressing % off badges whenever currentPriceMinor >= lowest30dMinor.
  • Normalise Greek VAT inputs starting with GR to EL before calling VIES, and keep UK GB VAT validation on HMRC's endpoint.
  • Gracefully queue manual VAT verification (or charge VAT refundable on credit note) when an individual Member State's VIES node returns MS_UNAVAILABLE.

Technical calculation and VIES API integration notes — not legal or VAT advice; confirm national promotional rules and reverse-charge invoicing evidence with qualified counsel.

Technical questions

Common edge cases & boundaries

Does Shopify's Compare-at price field automatically satisfy the EU Omnibus Directive?
Not by itself. Compare-at price is a static number field; unless your pricing workflow updates it from an actual 30-day rolling price history per currency/market, displaying it as a sale reduction risks breaching Article 6a.
Why does VIES occasionally return MS_UNAVAILABLE even when our code is fine?
VIES is a federated gateway querying each EU Member State's national tax database in real time. Individual national databases schedule nightly or weekend maintenance windows, so B2B checkouts must handle transient MS_UNAVAILABLE responses cleanly.
How many API credits do omnibus.lowest-price and vat.validate consume?
Both POST /api/v1/engines/omnibus/lowest-price and POST /api/v1/engines/vat/validate are deterministic 0-unit operations on an active API key or plugin licence.

Run on your own input

Paired services & previews.

Every digital deliverable starts with a free preview on your own file, URL or domain; managed services lock your quote upfront and hold supplier payout until completion proof clears.

Continue reading

Related technical guides.

7 min read

Wholesale PDF to ERP & storefront CSVs

How multi-page PDF table geometry, multilingual column header normalisation and integer minor-unit arithmetic work together so wholesale catalogues and supplier bills import cleanly into Shopify, WooCommerce, Xero and NetSuite.

8 min read

EN 16931, Peppol, Veri*factu & KSeF

How the European semantic invoice model (EN 16931-1) maps into UBL 2.1, UN/CEFACT CII and national clearance/billing records across Peppol BIS 3.0, German XRechnung/ZUGFeRD, Spanish Veri*factu and Polish KSeF.

8 min read

BYOK vs prepaid credits: micro-API & licences

How our 25 HTTP engine endpoints separate zero-LLM deterministic checks from optional AI operations, how Bring-Your-Own-Key (BYOK) vs prepaid credits prevent surprise overage bills, and how AKL1 Ed25519 tokens verify offline.

Test before checkout

Inspect a free preview first.

Run our deterministic checks or live quote tool on your own file, URL, domain or postcode before paying a penny.