Skip to content

Unit Conversions

Unit conversions map an alternative unit to an article's base unit via a numerator / denominator ratio — for example a carton of 6 pieces is alternative_unit = "CTN", numerator = 6, denominator = 1. Mercura uses them to normalise ordered quantities across units.

You can:

  • POST /articles/unit-conversions — bulk-upsert up to 100,000 conversions in a single call. Async — returns a JobAck; poll GET /jobs/{job_id} for status. Each row upserts the (article_number, alternative_unit) conversion.
  • GET /articles/unit-conversions — cursor-paginated list of your conversions. Pass article_number to list one article's conversions, or modified_since on the first page to fetch only what changed.

The ratio

The conversion is 1 alternative_unit = (numerator / denominator) base units. Both must be positive. The ratio is stored and returned exactly as sent — it is not collapsed to a single factor — so values like 3 pieces per pack (numerator = 1, denominator = 3) round-trip without loss.