# SalesOrderItem type


One goods line of an order.

On a set (a line with components), the stock figures `reserved`, `picked`, `outstanding` and
`warehouses` are the components' pieces divided by the pieces of one set, rounded to six decimals.
The sums between these figures therefore hold to within 0.000001 per term. Treat a shortage under
0.00001 as none.

## Fields

### id

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

The line's MAX id.

### externalId

`String`

The line's id in the external source.

### productVariantId

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

The MAX id of the product variant. Null while the line is not linked to one.

### productVariant

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

The product variant the line is linked to. Null while the line is not linked. Requires the
`item.read` permission. Without it, the field is null with a `FORBIDDEN_ROLE` error at its
path (`extensions.permission`), and the rest of the response is returned.

### product

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

The variant's parent product. Null while the line is not linked. Requires the `item.read`
permission. Without it, the field is null with a `FORBIDDEN_ROLE` error at its path
(`extensions.permission`), and the rest of the response is returned.

### sku

`String`

The SKU as the external source sent it. For a line whose EAN several products carry and that
was sent without a SKU, the EAN.

### name

`String`

The product's name as the customer saw it.

### variantName

`String`

The variant's name as the customer saw it.

### productExternalId

`String`

Arguments:

- `source`: `String!`

The id that the external source `source` knows the line's product variant by: the variant's
single external reference in that source, such as an e-shop's product code. Also returned for a
line that a user added in MAX. Read together with the order, without the `item.read`
permission. Null while the line is not linked, or when its variant has no reference in that
source or more than one.

### quantity

[`Decimal!`](/chameleoon-max/type/decimal)

The quantity, in `unit`.

### cancelledQuantity

[`Decimal!`](/chameleoon-max/type/decimal)

The cancelled quantity, in `unit`. `quantity` minus this is what the order still asks for.

### unit

`String`

The unit code. Null means the product's base unit.

### unitFactor

[`Decimal!`](/chameleoon-max/type/decimal)

The number of base units per `unit`, fixed when the line was written. To compare line
quantities with stock cards, use this value, not the catalogue's current factor.

### unitPrice

[`Decimal`](/chameleoon-max/type/decimal)

The final price of one unit, after the line's discount. Null while the line has no price.

### originalUnitPrice

[`Decimal`](/chameleoon-max/type/decimal)

The price of one unit before the discount. Null when there is none.

### vatPercent

[`Decimal`](/chameleoon-max/type/decimal)

The VAT rate in percent.

### pricesIncludeVat

`Boolean`

Whether `unitPrice` includes VAT. A line may differ from the order's `pricesIncludeVat`. Null
while the line has no price.

### lineTotal

[`Decimal`](/chameleoon-max/type/decimal)

The line's total for its live quantity, net or gross as the order's `pricesIncludeVat` says.
Null while the line has no price.

### attributes

[`ItemAttributeConnection`](/chameleoon-max/type/item-attribute-connection)

Arguments:

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

What the customer chose about the line, in the order it was sent. Empty once the customer is
erased.

- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page.
- 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.

### reserved

[`Decimal`](/chameleoon-max/type/decimal)

The stock reserved for the line now, in `unit`. Requires the `reservation.read` permission.
Without it, null with `FORBIDDEN_ROLE`.

On a set, the components' reserved pieces divided by the pieces of one set. For example, when
one of a set's two pieces is reserved, the value is 0.5. See [`SalesOrderItem`](/chameleoon-max/type/sales-order-item) for the
rounding.

### picked

[`Decimal`](/chameleoon-max/type/decimal)

The quantity picked for live consignments but not yet shipped, in `unit`. Picking uses up the
reservation. Requires the `reservation.read` permission. Without it, null with
`FORBIDDEN_ROLE`.

On a set, weighted by pieces as in `reserved`. See [`SalesOrderItem`](/chameleoon-max/type/sales-order-item) for the rounding.

### outstanding

[`Decimal!`](/chameleoon-max/type/decimal)

The quantity still to ship, in `unit`: ordered minus shipped and cancelled.
`outstanding - reserved - picked` is the shortage, on a set too.

On a set, what its components still owe, weighted by pieces as in `reserved`. For example, when
one of two pieces has shipped, the value is 0.5. It is exactly 0 when every piece has shipped or
was cancelled. See [`SalesOrderItem`](/chameleoon-max/type/sales-order-item) for the rounding.

### warehouses

[`SalesOrderItemWarehouseConnection`](/chameleoon-max/type/sales-order-item-warehouse-connection)

Arguments:

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

The line's figures per warehouse, by warehouse id: what each warehouse's consignments hold
(reserved, picked) and have shipped, in `unit`. The figures add up to `reserved` and `picked`.

- Warehouses outside your API key's scope are left out.
- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page.
- Requires the `reservation.read` permission. Without it, null with `FORBIDDEN_ROLE` at its
  path.

On a set, the components' figures in each warehouse, weighted by pieces as in `reserved`. See
[`SalesOrderItem`](/chameleoon-max/type/sales-order-item) for the rounding.

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

### components

[`SalesOrderItemConnection`](/chameleoon-max/type/sales-order-item-connection)

Arguments:

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

A set's components: the lines of the pieces the set is sold as, which are what is reserved,
picked and shipped. Sorted by line number, then id. Empty for any other line, including a
component itself.

- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page. Its
  cursors belong to this item's components; any other connection refuses them.
- A component is an item like any other, but without a price: `unitPrice`,
  `originalUnitPrice` and `lineTotal` are null, and the set carries the money. Its `quantity`
  is in the component's base unit.
- Its `sku`, `name` and `variantName` are the component's own: its variant's SKU, its product's
  name, and its option values joined by `", "` (null without options). They are fixed when the
  order took the set, so later catalogue changes do not reach them. They never come from the
  external source, which named only the set.
- They are read with the `order.read` permission, as any line's are, and need no `item.read`.
  Its figures (`reserved`, `picked`, `warehouses`) need `reservation.read`, as the set's do.
- 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.

### quantityPerSet

[`Decimal`](/chameleoon-max/type/decimal)

On a set's component, how many of the component one set contains, in its base unit, as the
set's contents were when the line was written. A later change to the set does not change the
order. Null on every other line.

### linked

`Boolean!`

Whether the line is linked to a MAX product, so it can be reserved and shipped.

### externalRefs

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

Arguments:

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

The ids that other systems know the line by, sorted by external source code, then parent id
(none first), external id and the reference's own id. `externalId` above is the oldest of them
under the order's external source.

- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page. Its
  cursors belong to this item's references; any other connection refuses them.
- Read together with the order: requires the `order.read` permission, not `integration.read`.
  Without it, null with `FORBIDDEN_ROLE` at its path.
- When your API key is limited to partners other than the order's customer, null with
  `FORBIDDEN_SCOPE` (`extensions.scope` `PARTNER`).
- 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.

### externallyIssued

[`Decimal!`](/chameleoon-max/type/decimal)

The quantity that externally managed warehouses reported they issued of the item
([`reportExternalIssue`](/chameleoon-max/mutation/report-external-issue), or `externalIssue` in [`createSalesOrder`](/chameleoon-max/mutation/create-sales-order)), net
of their credit notes, in `unit`. 0 when none did. A set's own item reads 0, because its
components carry the quantity. When a user closes the open external issue by hand in MAX, the
value stays as it is.

### externallyIssuedOpen

[`Decimal!`](/chameleoon-max/type/decimal)

The part of `externallyIssued` that MAX has not issued itself, in `unit`. Never below 0. When
it is above 0 on an order that MAX will issue nothing more of, the order has the exception
`EXTERNAL_ISSUE_OPEN` until a credit note is reported or a user in MAX closes it. 0 on a set's own
item.

## Used by

- [`SalesOrderItemConnection`](/chameleoon-max/type/sales-order-item-connection)
- [`SalesOrderItemEdge`](/chameleoon-max/type/sales-order-item-edge)
