Skip to main content

First Price Query

This guide walks through your first live API calls against Quantaprice. By the end you'll have queried a price for a single SKU, read every field in the response, seen pricelist inheritance in action, and run a batch query across multiple SKUs.

You'll need your Client ID and Client Secret from the Account & Tenant Setup step before continuing.


Get a Token

Every Quantaprice API call requires a JWT bearer token. Tokens are obtained from the authorization server using your key pair and expire after 3,600 seconds (one hour). Your service should cache the token and refresh it before expiry rather than fetching a new one per request.

curl -s -X POST "https://login.quantaprice.com/oauth2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=a1b2c3d4e5f6a1b2c3d4e5f6" \
-d "client_secret=9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e"

Response:

{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}

Export the token to an environment variable so you can paste the remaining examples directly:

export QP_TOKEN="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."

Query Your First Price

POST /price/query is the primary endpoint. Pass a list of SKUs, a pricelist filter, a currency, and a tax area. Quantaprice returns the resolved price for each SKU.

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

Response:

{
"results": [
{
"sku": "SKU-CHAIR-001",
"price": 2390.00,
"sales_price_inc_vat": 2987.50,
"sales_price_ex_vat": 2390.00,
"vat_rate": 0.25,
"vat_amount": 597.50,
"is_bundle": false
}
],
"count": 1,
"took": 3
}

Read the Response

Each result object in the results array maps to one SKU. Here is what each field means:

FieldTypeDescription
skustringThe SKU you queried. Returned as-is so you can correlate batch results.
pricenumberBase price before VAT, used internally for best-price comparison across pricelists.
sales_price_inc_vatnumberTax-inclusive price in the requested currency. This is the consumer-facing price.
sales_price_ex_vatnumberNet price before tax.
vat_ratenumberVAT rate applied, expressed as a decimal (0.25 = 25%). Determined by the tax_area you supplied.
vat_amountnumberAbsolute VAT amount in the requested currency.
is_bundlebooleanWhether the SKU is a bundle product.

If a SKU is not found in the matched pricelists, it is omitted from the results rather than returned with a null price. Check that the count of results matches the count of SKUs you sent if your application needs to detect missing prices.


Try Inheritance

Quantaprice pricelists can inherit from parent pricelists. When a customer-specific pricelist (customer-acme) inherits from a base pricelist (wholesale-eur), querying customer-acme returns prices defined on customer-acme first; any SKU not priced directly on customer-acme falls back to wholesale-eur.

The meta.inherited flag tells you which happened.

Query SKU-DESK-002 via the customer-acme pricelist, which has a customer-specific price for that SKU, and SKU-CHAIR-001, which it inherits from wholesale-eur:

curl -s -X POST "https://api.quantaprice.com/price/query" \
-H "Authorization: Bearer $QP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"skus": ["SKU-DESK-002", "SKU-CHAIR-001"],
"pricelist_filter": {
"pricelists": ["customer-acme"]
},
"currency_code": "EUR",
"tax_area": "DE"
}'

Response:

{
"results": [
{
"sku": "SKU-DESK-002",
"price": 649.70,
"sales_price_inc_vat": 773.15,
"sales_price_ex_vat": 649.70,
"vat_rate": 0.19,
"vat_amount": 123.45,
"is_bundle": false
},
{
"sku": "SKU-CHAIR-001",
"price": 270.00,
"sales_price_inc_vat": 321.30,
"sales_price_ex_vat": 270.00,
"vat_rate": 0.19,
"vat_amount": 51.30,
"is_bundle": false
}
],
"count": 2,
"took": 4
}

SKU-DESK-002 is priced directly on customer-acme. SKU-CHAIR-001 resolves from wholesale-eur up the inheritance chain.


Try a Batch Query

Pass multiple SKUs in a single request. Quantaprice resolves all of them in one round trip:

curl -s -X POST "https://api.quantaprice.com/price/query" \
-H "Authorization: Bearer $QP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"skus": [
"SKU-CHAIR-001",
"SKU-DESK-002",
"SKU-LAMP-010",
"SKU-SHELF-034"
],
"pricelist_filter": {
"pricelists": ["retail-sek"]
},
"currency_code": "SEK",
"tax_area": "SE"
}'

Response:

{
"results": [
{
"sku": "SKU-CHAIR-001",
"price": 2390.00,
"sales_price_inc_vat": 2987.50,
"sales_price_ex_vat": 2390.00,
"vat_rate": 0.25,
"vat_amount": 597.50,
"is_bundle": false
},
{
"sku": "SKU-DESK-002",
"price": 4490.00,
"sales_price_inc_vat": 5612.50,
"sales_price_ex_vat": 4490.00,
"vat_rate": 0.25,
"vat_amount": 1122.50,
"is_bundle": false
},
{
"sku": "SKU-LAMP-010",
"price": 950.00,
"sales_price_inc_vat": 1187.50,
"sales_price_ex_vat": 950.00,
"vat_rate": 0.25,
"vat_amount": 237.50,
"is_bundle": false
},
{
"sku": "SKU-SHELF-034",
"price": 2990.00,
"sales_price_inc_vat": 3737.50,
"sales_price_ex_vat": 2990.00,
"vat_rate": 0.25,
"vat_amount": 747.50,
"is_bundle": false
}
],
"count": 4,
"took": 5
}

The results array preserves the order of your skus input. There is no documented upper limit on batch size for the Developer tier, but keep batches under 500 SKUs for predictable latency. For catalog-scale queries, use the bulk export API instead.


Next Steps

  • The Pricing Model — understand pricelists, inheritance chains, quantity breaks, and how best-price selection works across multiple matched pricelists.
  • API & Integration — authentication token lifecycle, error codes, rate limits, and language-specific SDK examples.
  • Querying Prices — full reference for query parameters, pricelist filters, VAT, quantity breaks, and best-price selection.
  • OpenAPI Reference — machine-readable spec for all endpoints.