Skip to main content

Querying prices

This guide describes how to query prices: the GET and POST endpoints, pricelist filters, currency and VAT, quantity breaks, historical queries and the response.

Every request requires a bearer token from the authorisation server; see Authentication.

Base URL: https://YOUR_TENANT.quantaprice.com/api, where YOUR_TENANT is your tenant's name as shown in the account dashboard.


Query endpoints​

GET: one SKU on one pricelist​

text
GET /price/{sku}/{pricelist}
GET /price/{sku}/{pricelist}/{tax_area}

Use these endpoints when you already know the SKU and the pricelist code. No pricelist selection takes place; the endpoint returns that one price.

  • GET /price/{sku}/{pricelist} returns the stored price: its fields, its sales price and its quantity breaks as they were written. See Reading a price.
  • GET /price/{sku}/{pricelist}/{tax_area} returns a result in the same form as a price query, with the price excluding and including VAT, in the pricelist's own currency; no currency conversion takes place. It accepts rounding_profile and asOf, and the response includes an ETag; see Caching.

Both return 404 when the pricelist has no price for the SKU.

bash
# The stored price
curl "https://YOUR_TENANT.quantaprice.com/api/price/SKU-CHAIR-001/retail-sek" \
-H "Authorization: Bearer $TOKEN"

# The price with VAT for a tax area
curl "https://YOUR_TENANT.quantaprice.com/api/price/SKU-CHAIR-001/retail-sek/SE" \
-H "Authorization: Bearer $TOKEN"

Use the GET endpoints for:

  • Server-side rendering of a single product page where the pricelist is already known
  • Admin tooling and internal dashboards
  • Audit scripts that check known combinations of SKU and pricelist

Do not use them when you need to match a customer to the right pricelist, price several SKUs in one request, or get the best price across several pricelists. Use POST /price/query for all of those.


POST: product listings and carts​

POST /price/query prices many SKUs in one request, across the pricelists that a pricelist filter selects. Use it for storefront listings, cart pricing and any case where Quantaprice should determine which pricelists apply.

bash
curl -X POST "https://YOUR_TENANT.quantaprice.com/api/price/query" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"skus": ["SKU-CHAIR-001", "SKU-DESK-042", "SKU-LAMP-007"],
"pricelist_filter": {
"pricelists": ["customer-acme"]
},
"currency_code": "SEK",
"tax_area": "SE"
}'

Request fields​

FieldRequiredDescription
skusyesThe SKUs to price. Must not be empty.
pricelist_filteryesThe pricelists to consider; see Building a pricelist filter.
currency_codeyesThe currency of the returned prices.
tax_areayesThe tax area whose VAT rates apply, for example SE.
as_ofnoThe time to price at, with a time zone: 2026-01-15T00:00:00Z or 2026-01-15T01:00:00+01:00. Defaults to now. See Historical queries.
rounding_profilenoThe rounding profile to apply; see Rounding.
sort_ordernoASC or DESC sorts the results by price excluding VAT. By default, results follow the order of skus.

A request that omits a required field, or sends an empty value for one, returns 400 Bad Request. So does an as_of without a time zone, or a sort_order other than ASC or DESC.

The response contains one result for each SKU that has a price. SKUs without a price on any selected pricelist are omitted, so compare count with the number of SKUs you sent.

Some errors cause the whole query to fail with 400, not only the result for one SKU: a SKU that has a price on a selected pricelist but no VAT rate in the tax area (MISSING_VAT_RATE), or no exchange rate into the requested currency.


Building a pricelist filter​

pricelist_filter determines which pricelists are considered. It has three keys, and you must set at least one:

  • pricelists: pricelist codes. Every listed pricelist is used. A code that does not exist is ignored, and so is a listed pricelist that is not active at as_of (it is deleted, has not started or has ended): the SKUs are priced on the listed pricelists that are active. A campaign pricelist can therefore stay in the filter after it ends.
  • metadata: every pricelist whose metadata matches is used, in addition to the pricelists listed in pricelists.
  • currency_code: only pricelists in this currency are used, whether listed or matched. Used without the other keys, it selects every pricelist in the currency.

pricelists and metadata combine with OR: a pricelist is used when it is listed or its metadata matches. currency_code then applies with AND: with "currency_code": "EUR", only EUR pricelists are used, including among the listed ones. Each SKU is priced on every pricelist used, and the lowest price is returned (best-price selection).

Keys setPricelists used
pricelistsThe listed pricelists
metadataEvery pricelist whose metadata matches
pricelists and metadataThe listed pricelists and every pricelist whose metadata matches
currency_codeEvery pricelist in the currency
pricelists and currency_codeThe listed pricelists that are in the currency
metadata and currency_codeEvery pricelist in the currency whose metadata matches
All threeThe listed pricelists and every pricelist whose metadata matches, limited to those in the currency

metadata and currency_code select only pricelists that are active at as_of. POST /pricelist/query accepts the same filter and returns the pricelists it selects.

By pricelist code​

Name the pricelists by code:

bash
curl -X POST "https://YOUR_TENANT.quantaprice.com/api/price/query" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"skus": ["SKU-CHAIR-001"],
"pricelist_filter": {
"pricelists": ["customer-acme", "wholesale-tier-1"]
},
"currency_code": "SEK",
"tax_area": "SE"
}'

With a single code, the query returns that pricelist's price. Use a single code when another system, such as your CRM or the Shopify adapter, determines the customer's pricelist before the query.

By metadata​

Pricelists carry metadata that you define, as keys with values. Selecting by metadata lets you price by customer segment, region or any other classification without hard-coding pricelist codes in your application. Each key takes a list of accepted values:

bash
curl -X POST "https://YOUR_TENANT.quantaprice.com/api/price/query" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"skus": ["SKU-CHAIR-001", "SKU-DESK-042"],
"pricelist_filter": {
"metadata": {
"segment": ["wholesale"],
"region": ["nordics", "baltics"]
}
},
"currency_code": "EUR",
"tax_area": "SE"
}'

A pricelist matches when its metadata holds one of the listed values for every key: here, segment wholesale and region nordics or baltics. When several pricelists match, best-price selection applies.

Codes and metadata together​

Name the pricelists that apply to every customer, and select the customer's own pricelists by metadata. In this example, a shop sells from shop-retail, and each company with negotiated prices has a pricelist tagged with its company ID:

bash
curl -X POST "https://YOUR_TENANT.quantaprice.com/api/price/query" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"skus": ["SKU-CHAIR-001"],
"pricelist_filter": {
"pricelists": ["shop-retail"],
"metadata": {"company_id": ["powderbound"]}
},
"currency_code": "SEK",
"tax_area": "SE"
}'

The chair is priced on shop-retail and on every pricelist tagged company_id: powderbound. If the chair costs 100 SEK on shop-retail and 80 SEK on Powderbound's pricelist, a buyer from Powderbound gets 80 SEK. A buyer from a company without its own pricelist, or a visitor who is not signed in, gets the shop-retail price.

By currency​

Select the pricelists in one currency, optionally narrowed down by metadata:

bash
curl -X POST "https://YOUR_TENANT.quantaprice.com/api/price/query" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"skus": ["SKU-CHAIR-001"],
"pricelist_filter": {
"metadata": {"segment": ["retail"]},
"currency_code": "EUR"
},
"currency_code": "EUR",
"tax_area": "DE"
}'

pricelist_filter.currency_code selects pricelists, while the top-level currency_code sets the currency of the response. The two can differ; see Currency and VAT.


Currency and VAT​

Output currency​

The top-level currency_code sets the currency of the returned prices. When a selected pricelist is in another currency, its prices are converted with your tenant's exchange rates.

bash
# The pricelist is in EUR; prices come back in SEK
curl -X POST "https://YOUR_TENANT.quantaprice.com/api/price/query" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"skus": ["SKU-CHAIR-001"],
"pricelist_filter": {
"pricelists": ["wholesale-eur"]
},
"currency_code": "SEK",
"tax_area": "SE"
}'

Exchange rates are updated daily. For financial reconciliation, set as_of to a fixed time so that the result can be reproduced.

VAT​

tax_area is required. Every result contains the price both excluding and including VAT, calculated with the VAT rate of that tax area:

FieldDescription
sales_price_ex_vatPrice excluding VAT, in the requested currency
sales_price_inc_vatPrice including VAT, in the requested currency
vat_amountThe VAT, in the requested currency
vat_rateThe VAT rate applied, in percent: 25.0 for 25%

Quantity breaks​

A price query does not take a quantity. Each result contains the sales price, and price.quantity_breaks lists every quantity break of the pricelist the price comes from, converted to the requested currency, rounded and with VAT applied in the same way as the sales price. Use the break with the highest quantity_break that does not exceed your order quantity. Below the lowest break, or when the list is empty, the sales price applies. For an overview, see Multi-currency pricing and price breaks.

json
"quantity_breaks": [
{ "quantity_break": 10, "sales_price_ex_vat": 280.00, "sales_price_inc_vat": 350.00, "vat_amount": 70.00 },
{ "quantity_break": 50, "sales_price_ex_vat": 249.60, "sales_price_inc_vat": 312.00, "vat_amount": 62.40 }
]

Historical queries​

Set as_of to get prices as they were at a past time. Give the time with a time zone:

bash
curl -X POST "https://YOUR_TENANT.quantaprice.com/api/price/query" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"skus": ["SKU-CHAIR-001"],
"pricelist_filter": {
"pricelists": ["customer-acme"]
},
"currency_code": "SEK",
"tax_area": "SE",
"as_of": "2025-01-15T00:00:00Z"
}'

Use cases for as_of:

  • Audit trails: reproduce the exact price a customer was quoted on a given date.
  • Dispute resolution: confirm which price was active when an order was placed.
  • Investigating price changes: find out when a price changed by querying successive dates.

You can query a past time as long as its history is kept; see How long history is kept.


Best-price selection​

When the filter selects more than one pricelist with a price for the same SKU, the query returns one result for the SKU, not one per pricelist:

  1. Every candidate price is converted to a price excluding VAT in the requested currency.
  2. The lowest price is returned.

price.pricelist in the result shows which pricelist the price comes from. This is the intended behaviour for B2B, where a customer who qualifies for several discounts or price tiers should always get the best price. For how customer pricelists are set up for this, see Customer-specific pricing.

bash
# The customer qualifies for both wholesale-tier-1 and promo-summer-2025;
# the engine returns whichever is cheaper.
curl -X POST "https://YOUR_TENANT.quantaprice.com/api/price/query" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"skus": ["SKU-CHAIR-001"],
"pricelist_filter": {
"pricelists": ["wholesale-tier-1", "promo-summer-2025"]
},
"currency_code": "SEK",
"tax_area": "SE"
}'

To turn off best-price selection, pass exactly one pricelist code.


Response​

json
{
"count": 1,
"results": [
{
"sku": "SKU-CHAIR-001",
"is_bundle": false,
"sales_price_ex_vat": 311.20,
"sales_price_inc_vat": 389.00,
"vat_amount": 77.80,
"vat_rate": 25.0,
"price": {
"pricelist": "customer-acme",
"currency_code": "SEK",
"sales": 311.20,
"fields": { "fixed": 311.20 },
"quantity_breaks": [],
"meta": {
"inherited": false,
"start_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z",
"updated_by": "erp-sync"
}
}
}
]
}
FieldTypeDescription
countnumberThe number of results: the SKUs that have a price.
results[].skustringThe SKU as sent in the request.
results[].is_bundlebooleantrue when the SKU is a bundle article; see Bundles.
results[].sales_price_ex_vatnumberPrice excluding VAT, in the requested currency.
results[].sales_price_inc_vatnumberPrice including VAT, in the requested currency.
results[].vat_amountnumberThe VAT, in the requested currency.
results[].vat_ratenumberThe VAT rate in percent, for example 25.0.
results[].price.priceliststringThe pricelist the price comes from; with several candidates, the one chosen by best-price selection.
results[].price.currency_codestringThe currency of price.sales and price.fields.
results[].price.salesnumberThe pricelist's own price, after price rules and before conversion, in the pricelist's currency. It excludes VAT on a NET pricelist and includes it on a GROSS pricelist.
results[].price.fieldsobjectThe price's stored fields.
results[].price.quantity_breaksarrayThe pricelist's quantity breaks, calculated in the same way as the sales price; see Quantity breaks.
results[].price.metaobjectWhen the price took effect, when it was last updated and by whom, and whether it was inherited from a parent pricelist.
results[].bundlearrayBundles only: the price and VAT of each component; see Bundles.

See also​

  • VAT: how tax areas and VAT classes are configured.
  • Bundles: how bundle prices appear in query responses.
  • Rounding: rounding profiles and the rounding_profile field.
  • Rate limits: how much of your query limit a price query uses.
  • API reference: every endpoint.