Skip to main content

Change events

Quantaprice provides two ways to track changes to your data: a changelog that you poll, and webhooks that push changes to you. Both cover all entity types: articles, pricelists, prices, currencies, VAT rates, tax areas, rounding profiles and settings.

Overview​

MechanismHow it worksSuited to
ChangelogYou poll a per-entity GET /{entity}/changelog with a cursorReliable synchronisation, guaranteed order, backfilling
WebhooksYou register a URL and receive a POST request for each changeReal-time notifications, event-driven workflows

Both use the same change feed: every change recorded in the changelog also triggers the matching webhooks.

Availability

The changelog is always available. Webhook deliveries must be included in your plan and turned on with the change.events.enabled setting. Until then, registered webhooks receive nothing.

Changelog (polling)​

The changelog is an ordered, append-only record of changes. You can read it as a single feed or through one endpoint per entity type, and you poll it with a cursor.

Changelog endpoints​

EndpointEntity
GET /article/changelogArticles
GET /pricelist/changelogPricelists
GET /price/changelogPrices
GET /currency/changelogCurrencies
GET /vatclass/changelogVAT classes
GET /vatrate/changelogVAT rates
GET /taxarea/changelogTax areas
GET /fx/changelogExchange rates fetched from the ECB; rates set with POST /fx/daily are not recorded
GET /rounding/changelogRounding profiles
GET /settings/changelogSettings
GET /article-taxclass/changelogArticle VAT class assignments

To read a feed, you need permission to read what it lists: price:read for prices, article:read for articles and article VAT classes, pricelist:read for pricelists, and settings:read for the other feeds and for GET /changelog. See Key permissions.

One feed for every change​

GET /changelog returns the whole log as a single feed: every change to every entity type, in the order the changes were made, each with a sequence number that only increases. Use it when one consumer follows everything, such as a data warehouse.

GET/changelog?after_seq=1598&limit=100
json
{
"entries": [
{
"seq": 1599,
"entity_type": "price",
"entity_key": "SKU-CHAIR-001",
"composite_key": "base-sek",
"change_type": "updated",
"timestamp_ms": 1791885021461,
"content_hash": "247880b977135ff7",
"changed_by": "a1b2c3d4e5f6a1b2c3d4e5f6"
}
],
"next_cursor": 1599,
"has_more": false
}
  • To read from the oldest change held, omit after_seq. Pass each page's next_cursor as after_seq on your next request, whether has_more is true or not. next_cursor is set on every page: on an empty page it is the after_seq you sent, so polling from it returns each change once.
  • entity_type limits the feed to one type: article, pricelist, price, vat_rate, vat_class, tax_area, fx_rate, currency, rounding_profile, settings or article_tax_class.
  • composite_key is the second part of a two-part key: the pricelist of a price, the VAT class of a VAT rate, the tax area of an article VAT class assignment, or the currency of an exchange rate.
  • A position that the log no longer holds returns 410. See Cursor expiry.

The per-entity endpoints return the same changes, one entity type at a time, with an opaque cursor, as described below.

Parameters for the per-entity endpoints​

ParameterTypeDefaultDescription
cursorstring—The opaque cursor from a previous response. Omit it on the first request.
sinceISO 8601—The time to start from, as an alternative to cursor on the first request
limitinteger100The maximum number of items per page (1–1000)

Basic usage​

First request, starting from a specific time:

GET/article/changelog?since=2026-01-01T00:00:00Z&limit=100

Response:

json
{
"items": [
{
"change_type": "created",
"code": "SKU-001",
"updated_at": "2026-01-15T10:30:00Z",
"updated_by": "api-key-abc"
},
{
"change_type": "updated",
"code": "SKU-002",
"updated_at": "2026-01-15T10:31:00Z",
"updated_by": "api-key-abc"
}
],
"next_cursor": "eyJzIjogMTIzNDV9",
"has_more": true
}

Subsequent requests, with the cursor from the previous response:

GET/article/changelog?cursor=eyJzIjogMTIzNDV9&limit=100

Pass next_cursor back as cursor on every request, whether has_more is true or not. It is set on every page, the last one included, and on an empty page it is the position you sent in. To poll for new changes, request the page after the last next_cursor you received: you receive each change once, and an empty page while nothing has changed. next_cursor is null only when the feed holds no changes and you sent no position; send the same request again.

Event fields​

FieldDescription
change_typecreated, updated, or deleted
codeThe business identifier: the SKU for articles, the pricelist code for pricelists, the currency code for currencies, and so on
updated_atWhen the change was made, as an ISO 8601 timestamp
updated_byWho made the change: an API key, a user or system
vat_classVAT rate changelog only: the VAT class whose rate changed (code is the tax area)
currencyFX rate changelog only: the currency whose rate changed (code is the base currency, EUR)
tax_areaArticle VAT class changelog only: the tax area of the assignment (code is the SKU)

Price changelog format​

The price changelog (GET /price/changelog) has its own format, because a price is identified by both a SKU and a pricelist:

json
{
"items": [
{
"change_type": "updated",
"sku": "SKU-001",
"pricelist": "PL-RETAIL",
"updated_at": "2026-01-15T10:31:00Z",
"updated_by": "api-key-abc"
}
],
"next_cursor": "eyJzIjogMTIzNDZ9",
"has_more": false
}
FieldDescription
change_typecreated, updated, or deleted
skuSKU code
pricelistPricelist code
updated_atWhen the change was made, as an ISO 8601 timestamp
updated_byWho made the change

Deleting an article or a pricelist deletes its prices, and each deleted price appears here as deleted. Deleting a large pricelist therefore produces at least one entry for each of its prices.

Changelog retention​

The changelog stores price changes separately from all other changes, with limits of their own:

ChangesKeptDefault
PricesFor a limited time, up to a maximum number of changes7 days, at most 10,000,000
Everything else (articles, pricelists, tax, exchange rates, ...)Up to a maximum number of changes1,000,000

Your plan sets the limits. When a limit is reached, the oldest changes are removed.

Prices change far more often than anything else, and each price keeps its own history. Price changes are therefore kept long enough for the systems that follow them to catch up after an outage: a reader that polls at least once a week never misses a change. A large bulk load of prices can reach the limit on the number of price changes sooner, so plan to resynchronise after one. A bulk load of prices never removes changes to articles or other entities, which at their usual rate stay in the changelog for months or years.

Cursor expiry​

If your cursor is older than the oldest change held, changes you have not read have been removed, and you receive:

text
HTTP 410 Gone
json
{
"timestamp": "2026-10-11T08:00:00Z",
"status": 410,
"error": "Gone",
"message": "The cursor is older than the oldest change held (sequence 4011662): changes were missed. Resynchronise from the entities, then read on from there with since."
}

Expiry applies to each feed separately: an expired cursor on /price/changelog says nothing about /article/changelog. On GET /changelog without entity_type, your position expires when a change of any kind after it is removed.

A cursor that does not come from this tenant's changelog, or that dates from before a restore, also returns 410. A value that is not a cursor returned by this feed returns 400 Bad Request; always pass next_cursor back unchanged.

What to do when your cursor expires:

  1. Note the current time, then fetch the data you need again, for example all articles and the prices on your pricelists.
  2. Continue reading with since set to the time you noted, so that you do not miss changes made during the resynchronisation.
  3. Consider polling more often to avoid expiry.
text
position = "since=" + start_time

loop:
response = GET /{entity}/changelog?{position}&limit=1000

if response.status == 410:
started = now()
perform_full_sync()
position = "since=" + started
continue

for event in response.items:
process(event)

if response.next_cursor is not None:
position = "cursor=" + response.next_cursor
if not response.has_more:
sleep(5 seconds) # then poll for what came after

Webhooks (push)​

Webhooks deliver change events to your HTTP endpoint in near real time. Events are collected over a short window and delivered in batches, each as a single POST request signed with HMAC-SHA256.

Register a webhook​

POST/webhooks
json
{
"url": "https://your-app.com/webhook",
"secret": "your-signing-secret",
"entity_type_filter": null
}
FieldTypeRequiredDescription
urlstringYesThe endpoint that receives events. Use HTTPS.
secretstringNoThe secret used to sign deliveries with HMAC-SHA256
entity_type_filterstringNoThe entity types to receive events for, comma-separated (for example price,pricelist). null means all types.

Response (201 Created):

json
{
"id": 1,
"url": "https://your-app.com/webhook",
"entity_type_filter": null,
"active": true,
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-01-15T10:30:00Z"
}

Delivery format​

When changes are made, your endpoint receives a POST request:

text
POST https://your-app.com/webhook
Content-Type: application/json
X-Signature-256: sha256=a1b2c3d4e5f6...
json
{
"webhook_id": 1,
"delivered_at": "2026-01-15T10:30:05Z",
"events": [
{
"entity_type": "price",
"change_type": "updated",
"entity_code": "SKU-001",
"composite_key": "PL-RETAIL",
"changed_at": "2026-01-15T10:30:00Z",
"changed_by": "api-key-abc",
"content_hash": "e5f6a7b8"
},
{
"entity_type": "price",
"change_type": "updated",
"entity_code": "SKU-002",
"composite_key": "PL-RETAIL",
"changed_at": "2026-01-15T10:30:01Z",
"changed_by": "api-key-abc",
"content_hash": "c9d0e1f2"
}
]
}

A single delivery can contain several events made within a short window of about 500 ms.

Webhook event fields​

FieldDescription
entity_typeThe type of entity that changed (article, price, pricelist, currency, vat_rate, vat_class, tax_area, fx_rate, rounding_profile, settings, article_tax_class)
change_typecreated, updated, or deleted
entity_codeThe main business identifier: the SKU, the pricelist code, and so on
composite_keyThe second identifier, where one is needed: the pricelist of a price, the VAT class of a VAT rate, the tax area of an article VAT class assignment, or the currency of an exchange rate
changed_atWhen the change was made, as an ISO 8601 timestamp
changed_byWho made the change: an API key, a user or system
content_hashA hash of the entity's content. The same hash means the same content, so you can use it to detect duplicates.

Signature verification​

If you set a secret, every delivery includes an X-Signature-256 header. To verify it:

  1. Calculate the HMAC-SHA256 of the raw request body with your secret.
  2. Compare the result with the value after sha256= in the header.
python
import hmac, hashlib

expected = hmac.new(
secret.encode(),
request.body,
hashlib.sha256
).hexdigest()

signature = request.headers["X-Signature-256"].removeprefix("sha256=")
assert hmac.compare_digest(expected, signature)

Retries​

If your endpoint returns a status other than 2xx, or does not respond within 30 seconds, the delivery is retried. Each delivery is attempted up to 10 times, with waits of 1, 2, 4, 8, 16, 32, 64, 128 and 256 seconds between attempts. After the tenth failed attempt, the delivery is discarded. The webhook stays active for future events.

Filtering​

Use entity_type_filter to receive events for specific entity types only. For example, to receive only price changes:

json
{
"url": "https://your-app.com/price-webhook",
"secret": "secret",
"entity_type_filter": "price"
}

A filter can list several types, separated by commas ("price,pricelist"). To send events to different endpoints, register several webhooks with different filters.

Managing webhooks​

OperationEndpoint
List allGET /webhooks
Get oneGET /webhooks/{id}
UpdatePUT /webhooks/{id}
DeactivateDELETE /webhooks/{id}
TestPOST /webhooks/{id}/test

The test endpoint does not send anything to your URL. It returns a sample delivery, with one event of type test, in the format your endpoint receives.

Best practices​

Choosing between the changelog and webhooks​

  • Use the changelog for reliable data synchronisation. It is ordered and paginated, and you control the pace. If your consumer goes down, it resumes from its last cursor.
  • Use webhooks for immediate reactions: updating downstream systems, starting processes, sending alerts. Webhooks are faster, near real time, but less reliable than polling.
  • Use both to get the advantages of each: webhooks for a fast notification that something changed, and the changelog to catch up reliably on anything you missed.

Handling bulk imports​

A large import, such as an annual price update, produces a high volume of change events. Prepare your consumers for:

  • More events, in both the changelog and webhook deliveries
  • Cursor expiry, if you do not poll often enough during the import
  • Larger webhook deliveries, with many events per request

If you know an import is coming, consider polling more often while it runs.

Idempotent processing​

Make your event handlers idempotent. You can occasionally receive the same change more than once, for example after a cursor expires and you resynchronise, or when a webhook delivery is retried. The webhook content_hash field helps you detect duplicates.

What a changelog entry does not contain​

Changelog entries are notifications: they tell you what changed, not the new value. To get the current state, fetch the entity from its endpoint:

EntityEndpoint for the current state
ArticleGET /article/{sku}
PricelistGET /pricelist/{code}
PriceGET /price/{sku}/{pricelist}
CurrencyGET /currency/{code}
VAT rateGET /vatrate/{tax_area}/{vat_class}
VAT classGET /vatclass/{code}
Tax areaGET /taxarea/{code}

This keeps changelog entries small.