Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 1.27 KB

catalog-measurement-unit.md

File metadata and controls

35 lines (26 loc) · 1.27 KB

Catalog Measurement Unit

Represents the unit used to measure a CatalogItemVariation and specifies the precision for decimal quantities.

Structure

Catalog Measurement Unit

Fields

Name Type Tags Description
measurement_unit Measurement Unit Optional Represents a unit of measurement to use with a quantity, such as ounces
or inches. Exactly one of the following fields are required: custom_unit,
area_unit, length_unit, volume_unit, and weight_unit.
precision int Optional An integer between 0 and 5 that represents the maximum number of
positions allowed after the decimal in quantities measured with this unit.
For example:

- if the precision is 0, the quantity can be 1, 2, 3, etc.
- if the precision is 1, the quantity can be 0.1, 0.2, etc.
- if the precision is 2, the quantity can be 0.01, 0.12, etc.

Default: 3

Example (as JSON)

{
  "measurement_unit": {
    "custom_unit": {
      "name": "name2",
      "abbreviation": "abbreviation4"
    },
    "area_unit": "IMPERIAL_ACRE",
    "length_unit": "IMPERIAL_INCH",
    "volume_unit": "METRIC_LITER",
    "weight_unit": "IMPERIAL_WEIGHT_OUNCE"
  },
  "precision": 78
}