Commerce platform patterns
Quantaprice is a specialised pricing engine, not a full commerce platform. It answers price queries and publishes change events. The patterns below describe how to connect it to the systems you already use.
Storefront (B2C and B2B self-service)
When you render a product page, a listing or a cart, call POST /price/query with the SKUs on the page, the customer's pricelist filter, the currency and the tax area. One query prices a whole page in a few milliseconds, so you do not need to keep copies of prices in the storefront. Query when you render the page: prices can change at any second, for example when a scheduled campaign starts, and a copy would show the old price.
B2B self-service storefronts follow the same pattern, but the pricelist comes from the signed-in customer's account instead of a public default. Quantaprice returns the customer's price, including segment discounts and negotiated prices, with no pricing logic in the storefront.
Key calls: POST /price/query each time a page is rendered.
ERP sync
An ERP system needs current prices, but rarely to the second. Two approaches work well:
- Push: subscribe to webhooks. On each
priceevent, fetch the new price withPOST /price/queryfor theentity_code(SKU) andcomposite_key(pricelist) in the event, and write it to the ERP. - Pull: poll
GET /price/changelogwith a cursor every few minutes, and apply the changes in batches.
You can combine the two: webhooks keep prices current during the day, and the changelog catches up reliably after downtime. See Change events.
To reconcile at the end of a period, use as_of on POST /price/query to retrieve the price at any past moment.
Key calls: GET /price/changelog (polling), webhooks, POST /price/query with as_of (reconciliation).
CPQ (configure, price, quote)
A CPQ system needs accurate prices when a quote is created, and must be able to show the same prices later. Call POST /price/query for the quote lines with the customer's pricelist. Each result includes the pricelist's quantity breaks: apply the break that matches the line quantity. Store the as_of you used with the quote.
To show the prices a quote was based on, repeat the query with the stored as_of. For as long as the price history is kept, you do not need to copy prices into the CPQ database; see How long history is kept.
Key calls: POST /price/query (line pricing); the same call with as_of (audit).
Order management and checkout
When a cart or an order is created, call POST /price/query for the order lines with the customer's pricelist and tax_area, and apply the quantity break that matches each line's quantity. Quantaprice is the authoritative source of the price. Your checkout applies promotions or discount codes on top of it; Quantaprice does not manage promotions.
When the order is submitted, store the returned price on the order line. To verify it later, use as_of to look up the price at the time of submission.
Key calls: POST /price/query with tax_area, for each order.
Data warehouse and analytics
Stream changes into your warehouse by polling GET /changelog, the single feed of all changes in order, and resume from the last processed sequence number after a restart. Price changes are kept for a limited time, 7 days by default: a consumer that stops for longer receives 410 and must resynchronise from the entities; see Change events. Changelog entries say what changed; fetch the entities to get their values. For price history, POST /price/query with as_of returns the price at any moment within the history you keep.
Key calls: GET /changelog with after_seq; POST /price/query with as_of.
Starting simple
You do not need rules, hierarchies or inheritance to benefit from Quantaprice. Start by using it as a fast, auditable price store: write prices through the API and query them. Price history, scheduling and multiple currencies are available from the start, without any pricing logic.
As your requirements grow, add customer-specific prices, quantity breaks or inheritance from a parent pricelist one step at a time. The query API stays the same, and existing integrations keep working.
Channel-agnostic design
Quantaprice handles a query in the same way whether it comes from a Shopify storefront, an ERP connector, a CPQ system or a mobile app. The same POST /price/query endpoint and the same change feed serve all of them at once. Adding a channel requires no change to Quantaprice, only a new consumer of the same API.