Variants Queries

Query product variants including stock levels, pricing, attributes, and barcode data.

Variant — Returns a single variant by id

query GetVariant($id: ID!) {
  Variant(id: $id) {
    id
    label
    sku
    barcode
    active
    track_inventory
    unit_cost
    on_hand
    product { id label }
    attributes {
      attribute { id label }
    }
  }
}

Variants — Returns a paginated list of variants with sorting and filters

query Variants(
  $where: QueryVariantsWhereWhereConditions,
  $orderBy: [QueryVariantsOrderByOrderByClause!],
  $search: String,
  $first: Int,
  $page: Int,
  $trashed: Trashed
) {
  Variants(
    where: $where,
    orderBy: $orderBy,
    search: $search,
    first: $first,
    page: $page,
    trashed: $trashed
  ) {
    paginatorInfo {
      total
      currentPage
    }
    data {
      id
      sku
      label
      available
      product { label }
    }
  }
}

Available fields

FieldTypeDescription
idIntUnique identifier.
labelStringVariant name (Product Parent + Attributes).
skuStringStock Keeping Unit (unique identifier for the variant).
barcodeStringEAN/UPC or internal barcode.
activeBooleanTrue if the variant is active.
track_inventoryBooleanTrue if stock levels are tracked.
typeVariantTypeVariant classification (Normal, Kit, Assembly, etc.).
initial_costFloatCost set during creation.
unit_costFloatMoving Average Cost (MAC).
last_costFloatPrice from the most recent purchase.
last_purchased_priceFloatPrice from the last purchase order.
last_purchased_atStringDate of the last purchase.
unit_manufacturing_costFloatCost associated with assembly/production.
charge_taxBooleanTrue if sales tax applies.
ecotaxFloatEnvironmental tax amount.
minimum_quantityFloatMinimum order quantity.
kit_discountFloatDiscount percentage for kit components.
weight_amountFloatPhysical weight value.
weight_unitStringUnit for weight (kg, g, lbs, etc.).
weightFloatCalculated total weight.
has_batch_numbersBooleanTrue if variant uses batch/lot tracking.
shipped_this_monthFloatQuantity sold/shipped in the current month (filtered by location).
shipped_this_month_all_locationsFloatGlobal quantity sold/shipped this month.
last_sold_dateStringDate of last registered sale.
on_handFloatAggregate physical stock (takes location_ids argument).
availableFloatAggregate sellable stock (takes location_ids argument).
incomingFloatAggregate pending stock from purchases.
reservedFloatAggregate committed stock from sales.
bin_locationStringPrimary storage bin (filtered by location).
reorder_pointFloatLow stock alert threshold.
location_labelStringName of the primary warehouse.
valuationFloatMonetary value of current stock.
productProductParent product link.
attributes[AttributeVariant]List of attributes (Size, Color, etc.).
stock_levels[StockLevel]Inventory details by location.
batch_numbers[BatchNumber]Linked batch/lot history.
pricePriceDynamic sell price (takes filters as arguments).
recommended_pricePriceMSRP or suggested price.
variant_prices[VariantPrice]Price list entries.
suppliers[SupplierSku]Supplier associations and SKUs.
tax_codes[TaxCode]Applied tax configurations.
integrations[Integration]Platform synchronization data.
bill_of_materials[BillOfMaterial]Manufacturing recipe for assemblies.
components[VariantComponent]Parts list for kits/assemblies.
component_parent_counts[ComponentParentCounts]Number of kits and bills of materials using this variant as a component.
component_parents[ComponentParentPaginator]Paginated list of kits and bills of materials using this variant as a component.
imageFilePrimary variant image.
cover_imageStringURL to primary image.
variant_images[File]List of images specific to this variant.
accounting_familyAccountingFamilyLinked accounting category.
custom_fields[EntityCustomField]Custom fields for this entity.

Filters

The following fields can be used in the where parameter:

id, on_hand, label, sku, type, barcode, batch_number_barcode, active, available, incoming, reserved, created_at, updated_at, track_inventory, has_batch_numbers, location_id, bin_location, supplier_id, product_supplier_id, supplier_sku, product_id, shipped_this_month, last_sold_date, attribute_id.

Example Filters:

FieldExample
sku{ "column": "SKU", "operator": "EQ", "value": "TSH-RED-XL" }
available{ "column": "AVAILABLE", "operator": "GT", "value": 0 }
product_id{ "column": "PRODUCT_ID", "operator": "EQ", "value": 100050 }
trashedFilter by trashed status. Accepts ALL, TRASHED, or NOT_TRASHED.

Sorting

You can sort results using the orderBy parameter:

  • id, label, sku, product_id, barcode, track_inventory, initial_cost, unit_cost, weight_amount, weight_unit, active, created_at, updated_at, shipped_this_month, on_hand, available, incoming, reserved, last_sold_date, bin_location.

DocumentLineItemPrices

Returns calculated prices for line items in a document context (considering customer, price level, season, etc.).

Parameters:

ParameterTypeDescription
inputDocumentLineItemPricesInput!Pricing context.

Example Query:

query GetDocumentLineItemPrices($input: DocumentLineItemPricesInput!) {
  DocumentLineItemPrices(input: $input) {
    line_item_id
    variant_id
    amount
    computed
    supplier_price_tiers {
      from_quantity
      amount
    }
  }
}

Example Variables:

{
  "input": {
    "customer_id": 1001,
    "dated_at": "2026-01-15",
    "line_items": [
      { "variant_id": 5001, "quantity": 10 },
      { "variant_id": 5002, "quantity": 5 }
    ]
  }
}
FieldTypeDescription
line_item_idIDID of the line item.
variant_idInt!ID of the product variant.
amountFloatCalculated price.
computedBooleanWhether the price was computed by the system.
supplier_price_tiers[SupplierVariantPriceTier]Supplier price tiers for the variant.

Data Types

Price

FieldTypeDescription
amountFloatRaw price before discount.
discounted_amountFloatFinal price after discount.
computedBooleanTrue if logic was successful.

SupplierSku

FieldTypeDescription
supplier_skuStringSKU used by the supplier.
minimum_quantityFloatBulk order requirement.
supplierSupplierSupplier link.

SupplierVariantPriceTier

FieldTypeDescription
idIntPrice tier ID.
from_quantityFloatMinimum quantity for this tier.
amountFloatPrice per unit at this tier.

DocumentLineItemPricesInput

FieldTypeDescription
currencyStringCurrency code.
exchange_rateFloatExchange rate.
customer_idIntCustomer ID for pricing.
supplier_idIntSupplier ID for pricing.
price_level_idIntPrice level ID.

DocumentLineItemPrice

FieldTypeDescription
line_item_idIDID of the linked line item.
variant_idInt!ID of the product variant.
amountFloatCalculated price amount.
computedBooleanWhether the price was auto-computed.
supplier_price_tiers[SupplierVariantPriceTier]Supplier price tiers for this variant.
location_ids[Int]Location IDs for stock pricing.
dated_atDateDate for pricing context.
season_idIntSeason ID for seasonal pricing.
discountFloatDiscount percentage.
line_items[DocumentLineItemPriceInput!]!Line items to price.

DocumentLineItemPriceInput

FieldTypeDescription
line_item_idIDExisting line item ID (for updates).
variant_idInt!Product variant ID.
quantityFloatQuantity.

VariantComponent

FieldTypeDescription
idIntComponent ID.
variant_idIntParent variant ID.
component_idIntComponent variant ID.
quantityFloatRequired quantity.

ComponentParentCounts

Number of parent documents that use this variant as a component.

FieldTypeDescription
kitsInt!Number of kits using this variant as a component.
bill_of_materialsInt!Number of bills of materials using this variant as a component.

ComponentParent

A kit or bill of material using this variant as a component.

FieldTypeDescription
idString!Unique identifier, prefixed by kind (kit-<id> or bom-<id>).
kindString!Parent kind: kit or bill_of_material.
typeString!Parent variant type: kit or assembly.
labelString!Parent label.
skuString!Parent variant SKU.
bill_of_material_labelString!Bill of material label (empty for kits).
quantityFloatQuantity of this variant required by the parent.
product_idInt!Parent product ID.
variant_idInt!Parent variant ID.
bill_of_material_idIntBill of material ID (null for kits).
has_variantsBoolean!True if the parent product has other variants.

ComponentParentPaginator

Paginated list of ComponentParent entries.

FieldTypeDescription
paginatorInfoPaginatorInfo!Pagination metadata.
data[ComponentParent!]!Parents using this variant as a component.

Arguments on component_parents:

ArgumentTypeDescription
searchStringSearch on label, SKU, or product label.
pageIntPage number.
firstIntItems per page (max 200, default 50).
orderByStringField to sort on: TYPE, LABEL, SKU, BILLOFMATERIALLABEL or QUANTITY.
orderStringSort direction (asc or desc).

Note: Kits are only returned if the profile has the kits permission. Bills of materials require the assemblies permission plus bom.view or bom.update.


Enums

VariantType

ValueDescription
normalPhysical item.
kitVirtual bundle.
assemblyManufactured product.
packagingLogistics material.
serviceNon-tangible service.

StockFromLocationsType

ValueDescription
ALLStock from all locations.
ACTIVEStock from active locations only.
INACTIVEStock from inactive locations only.