# ProductVariant type


One sellable variant of a product: what a document line moves. Requires the `item.read`
permission.

## Fields

### id

[`UUID!`](/chameleoon-max/type/uuid)

The variant's MAX id.

### sku

`String!`

The variant's SKU. It is unique in the organisation, archived variants included.

### selectedOptions

[`[SelectedOption!]!`](/chameleoon-max/type/selected-option)

The variant's values on the product's axes, for example "Colour: black", in the product's
axis order. Empty for a product without variants.

Priced as 3 values, however many it holds.

Costs 3 points plus 3 × one value's selection.

### isDefault

`Boolean!`

Whether it is the product's default variant.

### archivedAt

[`Time`](/chameleoon-max/type/time)

When the variant was archived. Null while it is in use.

### ean

`String`

The base unit's code of the GTIN family: the primary code, or else the oldest one. Null when
the variant has none.

### weightG

`Int`

The variant's weight in grams: its own weight, or else its product's. Null when neither has
one.

### lengthMm

`Int`

The length of the variant's box in millimetres. The three dimensions are one block: the
variant's own when it has any of the three, or else all three of its product's. Null when
neither has one.

### widthMm

`Int`

The width of the variant's box in millimetres. See `lengthMm`.

### heightMm

`Int`

The height of the variant's box in millimetres. See `lengthMm`.

### tracking

[`ProductTracking!`](/chameleoon-max/type/product-tracking)

How the variant's pieces are told apart, taken from its product. Anything but `NONE` keeps
stock by lot, so a stock write without a lot is refused ([`syncStockLevels`](/chameleoon-max/mutation/sync-stock-levels):
`LOT_REQUIRED`).

### codes

[`ProductCodeConnection`](/chameleoon-max/type/product-code-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

The variant's codes: EAN, GTIN, manufacturer's, customs and internal codes.

- The primary code comes first, then the rest by kind, value and id.
- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page.
- Its cursors belong to this variant's codes and are refused anywhere else.

Null, with an error at its path, when its page cannot be read, for example because of a
cursor of another parent. The rest of the response is returned.

A page costs 2 + first (or last) × the cost of one node.

### units

[`ProductUnitConnection`](/chameleoon-max/type/product-unit-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

The variant's alternate units (packs), sorted by code.

- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page.
- Its cursors belong to this variant's units and are refused anywhere else.

Null, with an error at its path, when its page cannot be read, for example because of a
cursor of another parent. The rest of the response is returned.

A page costs 2 + first (or last) × the cost of one node.

### prices

[`ProductPriceConnection`](/chameleoon-max/type/product-price-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

The variant's price on every live price list that has one.

- The company's default list comes first, then the other default lists, then the rest by
  list code and id.
- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page.
- Its cursors belong to this variant's prices and are refused anywhere else.
- Requires the `price.read` permission. Without it, the field is null, with
  `FORBIDDEN_ROLE` at its path.

Null, with an error at its path, when its page cannot be read, for example because of a
cursor of another parent. The rest of the response is returned.

A page costs 2 + first (or last) × the cost of one node.

### externalRefs

[`ExternalRefConnection`](/chameleoon-max/type/external-ref-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

The ids that external sources know the variant by.

- Sorted by external source code, then by parent id (references without a parent first), external id
  and the reference's own id.
- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page.
- Its cursors belong to this variant's references and are refused anywhere else.
- It is read with the variant, so it requires the `item.read` permission, not
  `integration.read`. Without `item.read` it is null, with `FORBIDDEN_ROLE` at its path.

Null, with an error at its path, when its page cannot be read, for example because of a
cursor of another parent. The rest of the response is returned.

A page costs 2 + first (or last) × the cost of one node.

### setComponents

[`ProductSetComponentConnection`](/chameleoon-max/type/product-set-component-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

What one piece of the variant holds when its product is a set (see `Product.setMode`).

- Sorted in the set's own order of its components, then by SKU (compared by bytes) and the
  component's variant id.
- Only stocked components are listed. A component that is a service or a non-stock item is
  left out, as an order of the set and a stock movement of it leave it out (it has no
  stock). A set's availability is therefore the fewest whole sets that these components'
  stock makes.
- Empty for a variant of a product that is not a set.
- Empty for a set none of whose components is stocked. Such a set has no parts to reserve or
  ship, and an order cannot take it as its pieces.
- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page.
- Its cursors belong to this variant's components and are refused anywhere else.

Null, with an error at its path, when its page cannot be read, for example because of a
cursor of another parent. The rest of the response is returned.

A page costs 2 + first (or last) × the cost of one node.

### product

[`Product!`](/chameleoon-max/type/product)

The product that this is a variant of.

### stockCards

[`ProductVariantStockCardConnection`](/chameleoon-max/type/product-variant-stock-card-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

The variant's stock cards in every warehouse your API key may read, by warehouse. Requires the
`stockCard.read` permission.

- Archived warehouses are included, as in [`stockCards`](/chameleoon-max/query/stock-cards).
- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page. Its cursors
  belong to this variant's cards; any other connection refuses them.
- Null, with an error at its path, without the `stockCard.read` permission or when its page
  cannot be read, for example because of a cursor of another parent. The rest of the response
  is returned.
- A page costs 2 + first (or last) × the cost of one node.

## Used by

- [`IssueLine`](/chameleoon-max/type/issue-line)
- [`PlanningCard`](/chameleoon-max/type/planning-card)
- [`ProductSetComponent`](/chameleoon-max/type/product-set-component)
- [`ProductVariantConnection`](/chameleoon-max/type/product-variant-connection)
- [`ProductVariantEdge`](/chameleoon-max/type/product-variant-edge)
- [`ProductVariantExternalRefResult`](/chameleoon-max/type/product-variant-external-ref-result)
- [`ReceiptLine`](/chameleoon-max/type/receipt-line)
- [`SalesOrderItem`](/chameleoon-max/type/sales-order-item)
- [`StockCard`](/chameleoon-max/type/stock-card)
- [`StockCardChange`](/chameleoon-max/type/stock-card-change)
- [`StockDemand`](/chameleoon-max/type/stock-demand)
- [`StockQuant`](/chameleoon-max/type/stock-quant)
- [`StocktakeCountedLine`](/chameleoon-max/type/stocktake-counted-line)
- [`TransferLine`](/chameleoon-max/type/transfer-line)
