PricingService class (accessed via client.pricing) provides high-performance price calculations. It acts as a single source of truth, enriching product data with real-time regional discounts, segment/volume pricing rules, and multi-currency conversion.
Customer-specific prices need the shopper’s own credential. Pricing rules that target a customer segment, a customer tier or first-time buyers apply when a call carries
customerId together with that shopper’s xAuthToken (a session token), xExternalAuth (a bring-your-own-auth assertion) or xIdpToken (a token from the store’s own identity provider) resolving to the same customer. The segment and tier are then read from the customer’s record, and the response is private to that shopper. A customerId without a matching credential returns the public price rather than an error.Integration Highlights
- Consistent with the catalog: Returns the same product and variant data structures as the Products API, so you can use one shape across discovery and checkout.
- Media included: Returns
thumbnail_urlandmedia(including variant-level media) alongside pricing. - Multi-Variant Support: Automatically calculates prices, discounts, and breakdowns for every variant in a product.
- Geographic Detection: Accurate currency selection based on the customer’s location, worldwide.
Methods
getProductPrices
Retrieve resolved prices for a list of products. Optimized for catalog browsing, this returns a flat structure using the default variant for each product. Includes thumbnail_url for fast rendering.
Response
placeName like 'London, UK') and applies the exchange rate:
display_price converted,
display_currency and currency_symbol changed, and pricing_context.exchange_rate showing the
rate applied.
getProductPrice
Retrieve an ultra-detailed price breakdown for a single item. Handles both simple and multi-variant products with hierarchical responses. Each priced product already includes media gallery arrays.
- Aggregate Pricing: For products with variants, it provides an accurate
price_range(min/max) in the customer’s currency. - Per-Variant Breakdown: Each item in the
variantsarray contains its ownbase_price,resolved_price, anddisplay_price. - Media Resolution: Includes both root-level gallery
mediaand variant-specific media proxies.
getProductPriceBySlug
Retrieve pricing using an SEO-friendly slug. Identical to getProductPrice but uses slugs for cleaner URL routing in frontend applications.
🎨 Advanced Field Filtering
The Pricing Service supports dot notation for filtering variant pricing data, enabling significant bandwidth savings for complex product pages.Pricing Engine Logic
Tybrite calculates prices in a specific waterfall priority:- Direct Overrides: Manual price overrides set on specific product variants.
- Customer Segments: Price rules targeting customer groups (Champions, Loyal, VIP, etc.), applied when the call identifies the shopper as described at the top of this page.
- Regional Rules: Region-specific discounts or markups (e.g., a UK promotional discount, an EU regional rule). These match on the shopper’s country and region, which Galactic Core reads from the network edge when you don’t pass a location — a browser calling directly is located without you sending anything. Send
placeNameor coordinates to override that, which is what a server-rendered storefront and a market preview both need. - Volume Tiers: Price reductions triggered by the
quantityparameter. - Order Value Rules: Discounts that depend on what the shopper is spending overall, such as “5% off orders over $100”, triggered by the
orderTotalparameter.
orderTotal is present, so send the shopper’s current
cart subtotal on pricing calls made once there is a cart. Without it those rules are skipped and the
shopper sees the undiscounted price — the request still succeeds, which is why a missing orderTotal
shows up as a discount that silently never applies rather than as an error.
display_price is the field to render as the shopper-facing price. It has already passed through the pricing engine, been converted to the detected currency, and been rounded according to that currency’s rules.Response Codes
All pricing endpoints areGET and accept both publishable and secret keys.

