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
| Mechanism | How it works | Suited to |
|---|---|---|
| Changelog | You poll a per-entity GET /{entity}/changelog with a cursor | Reliable synchronisation, guaranteed order, backfilling |
| Webhooks | You register a URL and receive a POST request for each change | Real-time notifications, event-driven workflows |
Both use the same change feed: every change recorded in the changelog also triggers the matching webhooks.
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
| Endpoint | Entity |
|---|---|
GET /article/changelog | Articles |
GET /pricelist/changelog | Pricelists |
GET /price/changelog | Prices |
GET /currency/changelog | Currencies |
GET /vatclass/changelog | VAT classes |
GET /vatrate/changelog | VAT rates |
GET /taxarea/changelog | Tax areas |
GET /fx/changelog | Exchange rates fetched from the ECB; rates set with POST /fx/daily are not recorded |
GET /rounding/changelog | Rounding profiles |
GET /settings/changelog | Settings |
GET /article-taxclass/changelog | Article 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.
{
"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'snext_cursorasafter_seqon your next request, whetherhas_moreistrueor not.next_cursoris set on every page: on an empty page it is theafter_seqyou sent, so polling from it returns each change once. entity_typelimits the feed to one type:article,pricelist,price,vat_rate,vat_class,tax_area,fx_rate,currency,rounding_profile,settingsorarticle_tax_class.composite_keyis 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
| Parameter | Type | Default | Description |
|---|---|---|---|
cursor | string | — | The opaque cursor from a previous response. Omit it on the first request. |
since | ISO 8601 | — | The time to start from, as an alternative to cursor on the first request |
limit | integer | 100 | The maximum number of items per page (1–1000) |
Basic usage
First request, starting from a specific time:
Response:
{
"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:
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
| Field | Description |
|---|---|
change_type | created, updated, or deleted |
code | The business identifier: the SKU for articles, the pricelist code for pricelists, the currency code for currencies, and so on |
updated_at | When the change was made, as an ISO 8601 timestamp |
updated_by | Who made the change: an API key, a user or system |
vat_class | VAT rate changelog only: the VAT class whose rate changed (code is the tax area) |
currency | FX rate changelog only: the currency whose rate changed (code is the base currency, EUR) |
tax_area | Article 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:
{
"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
}
| Field | Description |
|---|---|
change_type | created, updated, or deleted |
sku | SKU code |
pricelist | Pricelist code |
updated_at | When the change was made, as an ISO 8601 timestamp |
updated_by | Who 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:
| Changes | Kept | Default |
|---|---|---|
| Prices | For a limited time, up to a maximum number of changes | 7 days, at most 10,000,000 |
| Everything else (articles, pricelists, tax, exchange rates, ...) | Up to a maximum number of changes | 1,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:
HTTP 410 Gone
{
"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:
- Note the current time, then fetch the data you need again, for example all articles and the prices on your pricelists.
- Continue reading with
sinceset to the time you noted, so that you do not miss changes made during the resynchronisation. - Consider polling more often to avoid expiry.
Recommended polling pattern
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
{
"url": "https://your-app.com/webhook",
"secret": "your-signing-secret",
"entity_type_filter": null
}
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The endpoint that receives events. Use HTTPS. |
secret | string | No | The secret used to sign deliveries with HMAC-SHA256 |
entity_type_filter | string | No | The entity types to receive events for, comma-separated (for example price,pricelist). null means all types. |
Response (201 Created):
{
"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:
POST https://your-app.com/webhook
Content-Type: application/json
X-Signature-256: sha256=a1b2c3d4e5f6...
{
"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
| Field | Description |
|---|---|
entity_type | The type of entity that changed (article, price, pricelist, currency, vat_rate, vat_class, tax_area, fx_rate, rounding_profile, settings, article_tax_class) |
change_type | created, updated, or deleted |
entity_code | The main business identifier: the SKU, the pricelist code, and so on |
composite_key | The 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_at | When the change was made, as an ISO 8601 timestamp |
changed_by | Who made the change: an API key, a user or system |
content_hash | A 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:
- Calculate the HMAC-SHA256 of the raw request body with your secret.
- Compare the result with the value after
sha256=in the header.
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:
{
"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
| Operation | Endpoint |
|---|---|
| List all | GET /webhooks |
| Get one | GET /webhooks/{id} |
| Update | PUT /webhooks/{id} |
| Deactivate | DELETE /webhooks/{id} |
| Test | POST /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:
| Entity | Endpoint for the current state |
|---|---|
| Article | GET /article/{sku} |
| Pricelist | GET /pricelist/{code} |
| Price | GET /price/{sku}/{pricelist} |
| Currency | GET /currency/{code} |
| VAT rate | GET /vatrate/{tax_area}/{vat_class} |
| VAT class | GET /vatclass/{code} |
| Tax area | GET /taxarea/{code} |
This keeps changelog entries small.