Skip to main content

Loading data

Your catalogue, pricelists and prices come from your own systems, usually a PIM or an ERP. This page describes how to load them into Quantaprice: the first full load, the changes that follow, and deletes.


Load order​

OrderEntityEndpointIdentified by
1ArticlesPOST /article/batchsku
2Pricelists, parents before childrenPOST /pricelist/batchcode
3PricesPOST /price/batchsku + pricelist
4VAT classes of articles that are not standard-ratedPOST /article-taxclasssku_code + tax_area_code

A new tenant already contains currencies, exchange rates, tax areas and VAT rates; see Account and tenant setup.

Every entity also has a single-item endpoint (POST /article, POST /pricelist, POST /price). Use the batch endpoints for more than a few items.


Articles​

json
POST /article/batch
[
{ "sku": "SKU-CHAIR-001", "name": "Office chair", "metadata": { "category": ["chairs"], "brand": ["ergo"] } },
{ "sku": "KIT-OFFICE", "name": "Office kit", "type": "bundle",
"components": [ { "sku": "SKU-CHAIR-001", "quantity": 1 }, { "sku": "SKU-DESK-002", "quantity": 1 } ] }
]
  • sku is required.
  • metadata holds a list of values for each key. A price rule's filter selects the articles it applies to by their metadata; see Metadata.
  • A bundle has "type": "bundle" and lists its components. Each component must be an existing article that is not itself a bundle, so write the components in an earlier request, not in the same batch. See Bundles.
  • Writing an article again replaces it, including its metadata, from its valid_from. Without valid_from, the change applies immediately; set a later time to schedule it. You can still read the replaced version with asOf. See Historical pricing.

When strict.article.validation is on, as it is in a new tenant, a price for a SKU without an article is rejected. When it is off, the price is written and returned by queries, but price rules do not apply to it and its VAT class is STANDARD in every tax area.


Pricelists​

json
POST /pricelist/batch
[
{ "code": "base-sek", "name": "Base SEK", "currency_code": "SEK", "vat_mode": "NET" },
{ "code": "wholesale-sek", "currency_code": "SEK", "vat_mode": "NET", "parent_code": "base-sek",
"price_rules": [ { "code": "wholesale", "filter": "", "expression": "sales * 0.85" } ] }
]
  • code, currency_code and vat_mode (NET or GROSS) are required. The currency must exist and be active.
  • parent_code must name an existing pricelist or one that appears earlier in the same batch. A child that appears before its parent fails.
  • start_date and end_date set when the pricelist applies. Outside that period, the pricelist prices nothing, and a price query that names it skips it: the SKUs are priced on the other listed pricelists that are active. See Building a pricelist filter.
  • price_rules replaces all of the pricelist's rules, and a write without it leaves the pricelist with no rules. A rule whose expression does not compile causes the item to fail. See Price rules.
  • A pricelist's currency cannot be changed while the pricelist exists. A write with a different currency fails.
  • Writing a pricelist again replaces it from its valid_from. Without valid_from, the change applies immediately; set a later time to schedule it. Prices affected by its rules or metadata are recalculated from that time. You can still read the replaced version with asOf.

Prices​

json
POST /price/batch
[
{ "sku": "SKU-CHAIR-001", "pricelist": "base-sek", "price": { "fields": { "fixed": 2390, "cost": 1400 } } },
{ "sku": "SKU-CHAIR-001", "pricelist": "base-sek", "start_date": "2026-12-01T00:00:00+01:00",
"price": { "fields": { "fixed": 2490, "cost": 1400 } },
"quantity_breaks": [ { "quantity_break": 10, "fixed_price": 2290 } ] }
]
  • Send the price fields in price.fields. On a pricelist without rules, fixed is the sales price; on a pricelist with rules, the rules calculate the sales price from the fields. See The price record.
  • Every write creates a new version that applies from its start_date, or from now if it has none. A start date in the past is replaced with the current time, so history is never rewritten.
  • remove_future_changes: true also removes the versions already scheduled after this one.
  • A version identical to the current one is accepted, but nothing is stored and no change is recorded.
  • You cannot send price.sales, because the sales price is calculated.
  • You cannot write a price for a bundle. Its price is calculated from its components and its bundle rule.

When strict.pricelist.validation is on, as it is in a new tenant, a price for a pricelist code that does not exist yet, or whose pricelist is deleted, is rejected. When it is off, the price is accepted and appears once a pricelist with that code exists.


Batch results​

A batch validates each item separately and writes all valid items together:

json
{
"accepted": 1,
"failed": [
{ "code": "child", "message": "Unknown parent_code: later" }
]
}

Each entry in failed identifies the item and gives the reason. The keys depend on the endpoint:

EndpointFailed item
POST /article/batch{"sku": ..., "error": ...}
POST /pricelist/batch{"code": ..., "message": ...}
POST /price/batch, DELETE /price/batch{"sku": ..., "pricelist": ..., "message": ...}
StatusMeaning
202At least one item was written, or the batch was empty. failed lists the items that were not written, with the reason.
400Every item failed.
413The batch contains more items than your plan allows in one request, or its body is too large. Split it into smaller batches.
422Your plan's article, pricelist or price quota has already been reached. Nothing was written. A batch sent while the tenant is below the quota is written in full, even if it takes the tenant over the quota.
429You have reached your ingest rate limit. Wait the number of seconds in Retry-After, then send the batch again.

A batch is not atomic: when some items fail, the others are still written. Correct the failed items and send only those again. Sending an accepted item again does no harm.

Each item costs one unit of your ingest rate limit. See Rate limits and Plan and limits.


Keeping data in sync​

After the first load, send changes as they happen in your source system, either one batch per set of changes or one batch every few seconds or minutes. An unchanged price costs one unit of your rate limit but stores nothing, so you can also re-send a whole pricelist periodically, although it uses more of your rate limit.

To follow changes in the other direction, from Quantaprice to your systems, see Change events.


Deleting data​

Deletes are soft: from the time of the delete, the entity no longer takes part in pricing, and you can still read its history with as_of. A delete takes effect immediately, or at a later time that you specify.

To deleteEndpointTo schedule the delete
A priceDELETE /price with {"sku": ..., "pricelist": ...}, or DELETE /price/batch with a list"asOf" in each item
A pricelistDELETE /pricelist/{code}?asOf=
An articleDELETE /article/{sku}?when=

Deleting a price also removes the prices that other pricelists inherited from it. Deleting a pricelist deletes its prices. If you create the pricelist again, its prices do not come back; send them again. Deleting an article deletes its prices on every pricelist, and a bundle that contains it can no longer be priced. If you write the article again, its prices do not come back; send them again. A price sent for a deleted article is never returned, and when strict.article.validation is on, it is rejected.


Large first loads​

  • Send batches of a few thousand items, and run a few requests in parallel. Once you reach your ingest rate limit, more parallel requests do not make the load faster.
  • On a 429 response, wait the number of seconds in Retry-After and retry the same batch.
  • For a load of millions of prices, turn on ingest.skip.dedup for the duration of the load and turn it off afterwards, or send POST /price/batch?skip_dedup=true for a single batch. Both skip the check for unchanged prices, so re-sending an identical price stores a new version.
  • A large load records one change per price in the change log and sends each change to your webhooks. Systems that follow the changes should be prepared for the volume, or resynchronise after the load; see Change events.