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. Use the context queries when the storefront session should determine the customer or guest group. Explicit customer or group inputs should be protected as integration data and must not be exposed as an unrestricted public price lookup.
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
}
}
Treat this query as integration data: it accepts arbitrary customer and group IDs and exposes each target's effective pricing configuration, so it should not be reachable as an unrestricted public lookup.