---
title: "Quantity"
slug: "api/basket/types/quantity"
sidebar:
  order: 253
---

<a id="ref-822bab8d41bc"></a>
<a id="ref-a0575fb70718"></a>
<a id="ref-1310ac4d91e2"></a>

## Synopsis

```text
struct Quantity : Value {
    string unit;
}
```

See also: [`Value`](/pCon/configuratorOnline/specs/api/basket/types/value#ref-8e37953d23da)

The `Quantity` structure represents either a valid quantity, a null quantity, or an invalid quantity. In case of a valid quantity, the `value` attribute inherited from the `Value` type is present, and the `unit` attribute contains a valid UNECE unit of measure. In case of a null quantity, the `value` attribute contains the value zero, and the `unit` attribute contains an empty string. Null quantities may be used if it is known that the quantity is zero but no information about a particular unit of measure is available. An invalid quantity is represented by a missing `value` attribute and an `unit` attribute containing an empty string.

```text
unit
```

This attribute contains the unit of the value inherited from the `Value` type (§[Value](/pCon/configuratorOnline/specs/api/basket/types/value#ref-8e37953d23da)). The unit attribute must be empty if the value attribute is missing. If the value attribute exists, the unit attribute must represent a valid UNECE unit of measure, unless the value is zero, in which case the unit attribute may be empty.
