Access variant-specific pricing across price levels.
GraphQL
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
}
}
GraphQL
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
}
}
}
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:
Example Query:
GraphQL
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 }
}
}
Field Type Description idInt Unique identifier. amountFloat Price amount. currencyCurrency Linked currency. company_idInt Company identifier. variantVariant Linked variant. priceablePriceable Linked entity (Customer, Supplier, or PriceLevel). priceable_typeVariantPriceType Type of priceable entity (Customer, Supplier, or PriceLevel).
Field Example 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" }
The Priceable union can be one of:
Customer
Supplier
PriceLevel
Field Type Description from_quantityFloat! Minimum quantity for this price tier (required). amountFloat! Price amount for this tier (required).
Value Description CustomerCustomer entity. SupplierSupplier entity. PriceLevelPrice level entity.
Field Type Description variant_idInt! Variant being priced. customer_idInt Customer used for the simulation, if any. customer_labelString Customer name. resolved_price_level_idInt Price level actually applied. resolved_price_level_labelString Label of the applied price level. currencyString! Currency of the amounts. quantityFloat! Quantity used for the simulation. base_unit_priceFloat Unit price before discounts. net_unit_priceFloat Unit price after discounts. net_line_totalFloat Net 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.
Field Type Description step_keyString! Identifier of the step. appliedBoolean! Whether the step changed the price. statusString! Outcome of the step. rule_labelString Rule that produced the step. unit_priceFloat Unit price after the step. discount_amountFloat Discount amount applied. discount_percentageFloat Discount percentage applied.
Field Type Description from_quantityFloat! Quantity from which the tier applies. rule_labelString Rule that defines the tier. discount_amountFloat Discount amount for the tier. discount_percentageFloat Discount percentage for the tier. net_unit_priceFloat Unit price in the tier. is_current_quantityBoolean! True for the tier matching the simulated quantity.
Field Type Description variant_idInt! Variant to price. customer_idInt Customer context. price_level_idInt Price level context, when no customer is given. quantityFloat Quantity to price (defaults to 1). currencyString Currency ISO code (defaults to the company currency). exchange_rateFloat Exchange rate to apply. dated_atDate Date used to select active rules. location_ids[Int] Locations used for the price. season_idInt Season used for the price.