Variants Prices Queries

Access variant-specific pricing across price levels.

VariantPrice — Returns a single variant price by id

query GetVariantPrice($id: ID!) {
  VariantPrice(id: $id) {
    id
    amount
    currency { id label }
    company_id
    variant { id label }
    priceable {
      ... on Customer { id label }
      ... on Supplier { id label }
      ... on PriceLevel { id label }
    }
    priceable_type
  }
}

VariantPrices — Returns a list of variant prices with sorting, filters, and search

query VariantPrices(
  $where: QueryVariantPricesWhereWhereConditions,
  $orderBy: [QueryVariantPricesOrderByOrderByClause!],
  $search: String,
  $first: Int,
  $page: Int
) {
  VariantPrices(
    where: $where,
    orderBy: $orderBy,
    search: $search,
    first: $first,
    page: $page
  ) {
    paginatorInfo {
      total
      currentPage
    }
    data {
      id
      amount
      currency { id label }
      priceable_type
    }
  }
}

SimulateVariantPrice — Simulates the selling price of a variant

Computes the price a variant would get in a given context (customer or price level, quantity, date, currency) without creating or changing anything. Useful to preview price rules and discount rules before quoting.

Parameters:

ParameterTypeDescription
inputSimulateVariantPriceInput!Simulation context.

Example Query:

query SimulateVariantPrice($input: SimulateVariantPriceInput!) {
  SimulateVariantPrice(input: $input) {
    variant_id
    customer_label
    resolved_price_level_label
    currency
    quantity
    base_unit_price
    net_unit_price
    net_line_total
    computed_from_components
    exclude_from_discount_rules
    steps { step_key applied status rule_label unit_price discount_amount discount_percentage }
    quantity_tiers { from_quantity rule_label discount_amount discount_percentage net_unit_price is_current_quantity }
  }
}
Return TypeDescription
SimulatedVariantPriceThe simulated price and the steps that produced it.

Available fields

FieldTypeDescription
idIntUnique identifier.
amountFloatPrice amount.
currencyCurrencyLinked currency.
company_idIntCompany identifier.
variantVariantLinked variant.
priceablePriceableLinked entity (Customer, Supplier, or PriceLevel).
priceable_typeVariantPriceTypeType of priceable entity (Customer, Supplier, or PriceLevel).

Filters

FieldExample
id{ "column": "ID", "operator": "EQ", "value": 100012 }
currency{ "column": "CURRENCY", "operator": "EQ", "value": "EUR" }
company_id{ "column": "COMPANY_ID", "operator": "EQ", "value": 100001 }
variant_id{ "column": "VARIANT_ID", "operator": "EQ", "value": 100076 }
variant_label{ "column": "VARIANT_LABEL", "operator": "LIKE", "value": "%Product%" }
variant_sku{ "column": "VARIANT_SKU", "operator": "EQ", "value": "SKU-001" }
priceable_id{ "column": "PRICEABLE_ID", "operator": "EQ", "value": 100001 }
priceable_type{ "column": "PRICEABLE_TYPE", "operator": "EQ", "value": "Customer" }

Unions

Priceable

The Priceable union can be one of:

  • Customer
  • Supplier
  • PriceLevel

Data Types

SupplierVariantPriceTierInput

FieldTypeDescription
from_quantityFloat!Minimum quantity for this price tier (required).
amountFloat!Price amount for this tier (required).

VariantPriceType

ValueDescription
CustomerCustomer entity.
SupplierSupplier entity.
PriceLevelPrice level entity.

SimulatedVariantPrice

FieldTypeDescription
variant_idInt!Variant being priced.
customer_idIntCustomer used for the simulation, if any.
customer_labelStringCustomer name.
resolved_price_level_idIntPrice level actually applied.
resolved_price_level_labelStringLabel of the applied price level.
currencyString!Currency of the amounts.
quantityFloat!Quantity used for the simulation.
base_unit_priceFloatUnit price before discounts.
net_unit_priceFloatUnit price after discounts.
net_line_totalFloatNet total for the quantity.
computed_from_componentsBoolean!True when the price is computed from kit or packaging components.
exclude_from_discount_rulesBoolean!True when discount rules do not apply.
steps[SimulatedPriceStep!]!Price rules applied, in order.
quantity_tiers[SimulatedQuantityTier!]!Quantity tiers of the applied rule.

SimulatedPriceStep

FieldTypeDescription
step_keyString!Identifier of the step.
appliedBoolean!Whether the step changed the price.
statusString!Outcome of the step.
rule_labelStringRule that produced the step.
unit_priceFloatUnit price after the step.
discount_amountFloatDiscount amount applied.
discount_percentageFloatDiscount percentage applied.

SimulatedQuantityTier

FieldTypeDescription
from_quantityFloat!Quantity from which the tier applies.
rule_labelStringRule that defines the tier.
discount_amountFloatDiscount amount for the tier.
discount_percentageFloatDiscount percentage for the tier.
net_unit_priceFloatUnit price in the tier.
is_current_quantityBoolean!True for the tier matching the simulated quantity.

SimulateVariantPriceInput

FieldTypeDescription
variant_idInt!Variant to price.
customer_idIntCustomer context.
price_level_idIntPrice level context, when no customer is given.
quantityFloatQuantity to price (defaults to 1).
currencyStringCurrency ISO code (defaults to the company currency).
exchange_rateFloatExchange rate to apply.
dated_atDateDate used to select active rules.
location_ids[Int]Locations used for the price.
season_idIntSeason used for the price.