# Product type


A product: the parent of its variants. Requires the `item.read` permission.

## Fields

### id

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

The product's MAX id.

### code

`String!`

The product's code in MAX.

### name

`String!`

The product's name, as the catalogue keeps it, not translated.

### baseUnit

`String!`

The product's base unit: its smallest stock unit, the unit its stock is counted in.

### vatRateCode

`String!`

The code of the product's VAT rate.

### setMode

[`ProductSetMode`](/chameleoon-max/type/product-set-mode)

How the product is stocked and sold when it is a set. Null when it is not a set.

### archivedAt

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

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

### updatedAt

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

When the product last changed.

- It moves when the product's own fields change (archiving too), or when one of its
  variants, their pack units or their codes change.
- It does not move when a price changes (prices live on price lists), or when an attribute
  or one of its values is renamed.
- It is the start time of the transaction that wrote the change, so a change committed later
  can carry an earlier `updatedAt` than one you already read. Resume an incremental sync from
  the last `updatedAt` you saw minus 10 minutes, and remove duplicates by id.
- A sync passes `includeArchived: true`. `archivedAt` then tells you that a product is gone.

### variants

[`ProductVariantConnection`](/chameleoon-max/type/product-variant-connection)

Arguments:

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

Every variant of the product, archived ones included.

- The default variant comes first, then the rest by SKU (compared by bytes) and id.
- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page.
- Its cursors belong to this product's variants 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.

### externalRefs

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

Arguments:

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

The ids that external sources know the product 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 product's references and are refused anywhere else.
- It is read with the product, 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.

## Used by

- [`product`](/chameleoon-max/query/product) (query)
- [`IssueLine`](/chameleoon-max/type/issue-line)
- [`ProductConnection`](/chameleoon-max/type/product-connection)
- [`ProductEdge`](/chameleoon-max/type/product-edge)
- [`ProductVariant`](/chameleoon-max/type/product-variant)
- [`ReceiptLine`](/chameleoon-max/type/receipt-line)
- [`SalesOrderItem`](/chameleoon-max/type/sales-order-item)
- [`TransferLine`](/chameleoon-max/type/transfer-line)
