ProductVariant type
One sellable variant of a product: what a document line moves. Requires the item.read
permission.
Fields
id
The variant's MAX id.
sku
String!
The variant's SKU. It is unique in the organisation, archived variants included.
selectedOptions
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
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
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:
LOT_REQUIRED).
codes
Arguments:
first:Intafter:Stringlast:Intbefore: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/afterorlast/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
Arguments:
first:Intafter:Stringlast:Intbefore:String
The variant's alternate units (packs), sorted by code.
- A connection, paged with
first/afterorlast/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
Arguments:
first:Intafter:Stringlast:Intbefore: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/afterorlast/before, at most 250 a page. - Its cursors belong to this variant's prices and are refused anywhere else.
- Requires the
price.readpermission. Without it, the field is null, withFORBIDDEN_ROLEat 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
Arguments:
first:Intafter:Stringlast:Intbefore: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/afterorlast/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.readpermission, notintegration.read. Withoutitem.readit is null, withFORBIDDEN_ROLEat 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
Arguments:
first:Intafter:Stringlast:Intbefore: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/afterorlast/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
The product that this is a variant of.
stockCards
ProductVariantStockCardConnection
Arguments:
first:Intafter:Stringlast:Intbefore: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. - A connection, paged with
first/afterorlast/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.readpermission 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.