On this page
  1. Queries
  2. Advanced Config query

GraphQL

Install mageb2b/pricesystem-graph-ql when a headless storefront or integration needs calculated Price System values through Magento GraphQL.

Queries

Query Context
pricesystemFinalPrice Explicit customer, group, quantity, date and website input
pricesystemMultiSkuPrice The same explicit context for several SKUs
pricesystemMyFinalPrice Authenticated customer's context
pricesystemMyMultiSkuPrice Authenticated customer's context for several SKUs
pricesystemContextFinalPrice Current storefront context
pricesystemContextMultiSkuPrice Current storefront context for several SKUs

Multi-SKU results include the SKU, final price and applicable quantity tiers.

Use the My queries with a customer token, or the context queries to take the customer or guest group from the storefront session. The queries with explicit context, pricesystemFinalPrice and pricesystemMultiSkuPrice, require an admin or integration token with MageB2B_PricesystemCore::main. They reject customer and guest requests.

The Advanced Config add-on has its own GraphQL package, mageb2b/pricesystem-advancedconfig-graph-ql. Each pricing product also has its own optional GraphQL package for reading stored records.

Advanced Config query

pricesystemAdvancedConfig(customerId, groupId) returns the price-selection configuration that applies to a customer or customer group. Both arguments are optional; pass the IDs you want to inspect.

The result combines the raw configured values at each level with the effective values after precedence resolution:

Field group Fields Content
Global formula formula, missing_input_behavior, fallback_strategy System-level formula and its failure handling
System system_price_select_rule, system_price_sort_order Global rule and price-type order
Customer customer_id, customer_priceselect, customer_price_formula, customer_price_sort_order Raw values stored on the customer
Group group_id, group_priceselect, group_price_formula, group_price_sort_order Raw values stored on the group
Resolved resolved_price_select_rule, resolved_price_select_source, resolved_formula, resolved_formula_source, resolved_price_sort_order, resolved_price_sort_order_source Effective values and which level supplied them

Mind the numbering: customer_priceselect and group_priceselect use the customer-form rule values, while resolved_price_select_rule is translated to the system rule (1 Lowest, 2 Highest, 3 Sort order, 4 Individual price formula). Each resolved_*_source is customer, group or system — a direct customer rule wins over the group rule, which wins over the system default. resolved_price_sort_order is only populated when the effective rule is Sort order; sort orders are returned as lists of price-type codes.

query AdvancedConfig($customerId: Int, $groupId: Int) {
  pricesystemAdvancedConfig(customerId: $customerId, groupId: $groupId) {
    formula
    missing_input_behavior
    fallback_strategy
    system_price_select_rule
    system_price_sort_order
    customer_id
    customer_priceselect
    customer_price_formula
    customer_price_sort_order
    group_id
    group_priceselect
    group_price_formula
    group_price_sort_order
    resolved_price_select_rule
    resolved_price_select_source
    resolved_formula
    resolved_formula_source
    resolved_price_sort_order
    resolved_price_sort_order_source
  }
}

This query requires an admin or integration token with MageB2B_PricesystemCoreAdvancedConfig::config. Customer and guest requests are rejected because the query exposes the pricing configuration of the supplied customer or group.

Display preferences

Adjust how this website is displayed. Changes apply immediately.

Text size
Text spacing
Reading aids

Follows the pointer. Move it with Alt + Up/Down outside input fields. Hidden while a dialog is open.

Uses the voices provided by your browser, which may use an online service. Reading starts only when you press Read aloud.

Your choices are saved in this browser for this website.