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
The line's MAX id.
externalId
String
The line's id in the external source.
productVariantId
The MAX id of the product variant. Null while the line is not linked to one.
productVariant
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
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
The quantity, in unit.
cancelledQuantity
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
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
The final price of one unit, after the line's discount. Null while the line has no price.
originalUnitPrice
The price of one unit before the discount. Null when there is none.
vatPercent
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
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
Arguments:
first:Intafter:Stringlast:Intbefore: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/afterorlast/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
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 for the
rounding.
picked
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 for the rounding.
outstanding
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 for the rounding.
warehouses
SalesOrderItemWarehouseConnection
Arguments:
first:Intafter:Stringlast:Intbefore: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/afterorlast/before, at most 250 a page. - Requires the
reservation.readpermission. Without it, null withFORBIDDEN_ROLEat its path.
On a set, the components' figures in each warehouse, weighted by pieces as in reserved. See
SalesOrderItem for the rounding.
A page costs 2 + first (or last) × the cost of one node.
components
Arguments:
first:Intafter:Stringlast:Intbefore: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/afterorlast/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,originalUnitPriceandlineTotalare null, and the set carries the money. Itsquantityis in the component's base unit. - Its
sku,nameandvariantNameare 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.readpermission, as any line's are, and need noitem.read. Its figures (reserved,picked,warehouses) needreservation.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
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
Arguments:
first:Intafter:Stringlast:Intbefore: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/afterorlast/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.readpermission, notintegration.read. Without it, null withFORBIDDEN_ROLEat its path. - When your API key is limited to partners other than the order's customer, null with
FORBIDDEN_SCOPE(extensions.scopePARTNER). - 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
The quantity that externally managed warehouses reported they issued of the item
(reportExternalIssue, or externalIssue in createSalesOrder), 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
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.