Skip to main content

Your first prices

This guide loads three products into a new tenant, prices them on a pricelist and queries them. It then adds a wholesale pricelist with a discount rule and a customer pricelist with one negotiated price, and shows the resulting prices for the customer. It takes about ten minutes with curl.

You need an API key from Account and tenant setup. In every URL, replace YOUR_TENANT with your tenant's name.

See it first without an API key

In a new tenant, the console can load an example wholesaler with five pricelists, bundles and currency conversion, and run ready-made price queries on it. See Example data.


1. Get a token​

Exchange the API key for an access token:

bash
curl -s -X POST "https://login.quantaprice.com/oauth2/token" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"
json
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 900
}

The token is valid for 15 minutes. Store it in a variable for the steps below:

bash
export QP_TOKEN="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
export QP="https://YOUR_TENANT.quantaprice.com/api"

In an integration, cache the token and request a new one shortly before it expires; see Authentication.


2. Create articles​

An article is a product in your catalogue, identified by its SKU. You define its metadata, and price rules can select articles by it.

bash
curl -s -X POST "$QP/article/batch" \
-H "Authorization: Bearer $QP_TOKEN" -H "Content-Type: application/json" \
-d '[
{"sku": "SKU-CHAIR-001", "name": "Office chair", "metadata": {"category": ["chairs"]}},
{"sku": "SKU-DESK-002", "name": "Standing desk", "metadata": {"category": ["desks"]}},
{"sku": "SKU-LAMP-010", "name": "Desk lamp", "metadata": {"category": ["lighting"]}}
]'
json
{"accepted": 3, "failed": []}

3. Create a pricelist​

A pricelist holds prices in one currency. NET means that its prices exclude VAT.

bash
curl -s -X POST "$QP/pricelist" \
-H "Authorization: Bearer $QP_TOKEN" -H "Content-Type: application/json" \
-d '{"code": "base-sek", "name": "Base SEK", "currency_code": "SEK", "vat_mode": "NET"}'

The response is 202 Accepted with an empty body.


4. Load prices​

A price is a SKU on a pricelist. If the pricelist has no price rules, the price's fixed field is the sales price.

bash
curl -s -X POST "$QP/price/batch" \
-H "Authorization: Bearer $QP_TOKEN" -H "Content-Type: application/json" \
-d '[
{"sku": "SKU-CHAIR-001", "pricelist": "base-sek", "price": {"fields": {"fixed": 2390}}},
{"sku": "SKU-DESK-002", "pricelist": "base-sek", "price": {"fields": {"fixed": 4490}}},
{"sku": "SKU-LAMP-010", "pricelist": "base-sek", "price": {"fields": {"fixed": 950}}}
]'
json
{"accepted": 3, "failed": []}

The prices take effect now. To schedule a price for later, send a start_date; see Scheduled updates.


5. Query a price​

Request the price of the chair on base-sek, in SEK, with Swedish VAT:

bash
curl -s -X POST "$QP/price/query" \
-H "Authorization: Bearer $QP_TOKEN" -H "Content-Type: application/json" \
-d '{
"skus": ["SKU-CHAIR-001"],
"pricelist_filter": {"pricelists": ["base-sek"]},
"currency_code": "SEK",
"tax_area": "SE"
}'
json
{
"count": 1,
"results": [
{
"sku": "SKU-CHAIR-001",
"is_bundle": false,
"sales_price_ex_vat": 2390.0,
"sales_price_inc_vat": 2987.5,
"vat_amount": 597.5,
"vat_rate": 25.0,
"price": {
"pricelist": "base-sek",
"currency_code": "SEK",
"sales": 2390.0,
"fields": {"fixed": 2390.0},
"quantity_breaks": [],
"meta": {
"inherited": false,
"start_at": "2026-10-13T09:50:21.461Z",
"updated_at": "2026-10-13T09:50:21.461Z",
"updated_by": "a1b2c3d4e5f6a1b2c3d4e5f6"
}
}
}
]
}
FieldDescription
sales_price_ex_vat, sales_price_inc_vatThe price to show, excluding and including VAT, in the currency you requested
vat_amount, vat_rateThe VAT amount, and the rate as a percentage. The chair has no VAT class in SE, so the standard rate applies: 25 %
price.pricelistThe pricelist the price comes from
price.salesThe sales price on that pricelist, in the pricelist's currency and as the pricelist holds it: here excluding VAT, because base-sek is NET
price.fieldsThe price fields you stored
price.quantity_breaksLower unit prices from a given quantity, excluding and including VAT, in the currency you requested; see Quantity breaks
price.meta.inheritedtrue if the pricelist inherited the price from its parent
price.meta.start_atWhen this version of the price took effect

6. Add a segment and a customer​

Wholesale customers get 15 % off the base prices. Create wholesale-sek under base-sek, with a rule that calculates its price from its parent's price:

bash
curl -s -X POST "$QP/pricelist" \
-H "Authorization: Bearer $QP_TOKEN" -H "Content-Type: application/json" \
-d '{
"code": "wholesale-sek", "name": "Wholesale SEK", "currency_code": "SEK", "vat_mode": "NET",
"parent_code": "base-sek",
"price_rules": [{"code": "wholesale", "filter": "", "expression": "sales * 0.85", "description": "15 % off base"}]
}'

ACME AB is a wholesale customer with a negotiated price for the desk. Create a pricelist for ACME under wholesale-sek, and write that one price on it:

bash
curl -s -X POST "$QP/pricelist" \
-H "Authorization: Bearer $QP_TOKEN" -H "Content-Type: application/json" \
-d '{"code": "customer-acme", "name": "ACME AB", "currency_code": "SEK", "vat_mode": "NET", "parent_code": "wholesale-sek"}'

curl -s -X POST "$QP/price" \
-H "Authorization: Bearer $QP_TOKEN" -H "Content-Type: application/json" \
-d '{"sku": "SKU-DESK-002", "pricelist": "customer-acme", "price": {"fields": {"fixed": 3600}}}'

Query both SKUs for ACME:

bash
curl -s -X POST "$QP/price/query" \
-H "Authorization: Bearer $QP_TOKEN" -H "Content-Type: application/json" \
-d '{
"skus": ["SKU-CHAIR-001", "SKU-DESK-002"],
"pricelist_filter": {"pricelists": ["customer-acme"]},
"currency_code": "SEK",
"tax_area": "SE"
}'
SKUsales_price_ex_vatsales_price_inc_vatinheritedWhy
SKU-CHAIR-0012031.502539.38true2390 on base-sek, 15 % off on wholesale-sek, inherited unchanged by customer-acme
SKU-DESK-0023600.004500.00falseACME's own price

If you change the chair's base price, ACME's price follows. If you change the wholesale rule, the inherited prices of every wholesale customer follow. ACME's own price for the desk stays until you change it. See Inheritance.

Inherited prices on a new or changed pricelist are filled in shortly afterwards. If a price is missing immediately after the change, query again.


Next steps​

  • Example data: an example catalogue in the console, with inheritance on two levels, customer prices, a campaign, bundles, quantity breaks and currency conversion.
  • Loading data: bulk loads, updates, deletes, and what is validated.
  • Querying prices: pricelist filters, the best price across pricelists, other currencies, and as_of.
  • Price rules: markups on cost, and discounts by brand or category.
  • Platform overview: every building block, and how a price is calculated.
  • Pricing page: the free 90-day Evaluation, and the plans after it.