Items and Inventory Delta
Keep authorized ordinary item-master and stock-balance mirrors current with incremental snapshots, using the same company contracts and fields as the full exports.
| Endpoint | Scope | Row identity / output |
|---|---|---|
/items/changes | items.read | (companyId, itemId): ordinary item master fields |
/inventory/changes | inventory.read | (companyId, storeId, itemId): ordinary inventory quantities and valuations |
Use the same authorized key, company and ordinary contract as the corresponding full endpoint. These operations do not use the Partner Data availability policy. Inventory rows preserve actual on-hand quantities, including zero and negative values, and financial-data permission still applies to costs. Items retain classifications and permitted purchase/cost information. See Items Delta reference and Inventory Delta reference.
Initial full synchronization
- Call the applicable changes endpoint without since. Capture its baselineSince and policyVersion before exporting the ordinary full resource.
- Read every page of
/items?page=1&pageSize=200or/inventory?page=1&pageSize=200. Do not filter out zero, inactive or damage stock if maintaining a complete authorized inventory mirror. Stage or apply the full export; reconcile removals only once the entire export succeeds. - Poll the same changes endpoint with since set to its saved baselineSince and its saved policyVersion. Omit through and continuation keys on the first poll.
- Apply every incremental page as an idempotent upsert. If fullSyncRequired arrives, restart the corresponding full synchronization using the newly supplied baseline and version.
Parameters and cursor rules
sinceandthroughare ISO offset timestamps. Use Z or a correctly URL-encoded offset; preserve full precision. Both change-time bounds are inclusive.policyVersionis opaque and must be copied exactly from the corresponding endpoint. Each client, company and endpoint has its own synchronization state.- The server chooses a safe through on the first poll. Keep since, through and policyVersion unchanged for every continuation. Do not guess or replace through with the current time.
afterItemIdis the returned item key. Inventory continuation also requiresafterStoreId. Supply both inventory keys or neither. Items Delta accepts only the item key.pageSizedefaults to 200; accepted range 1–1000. No page number, totalCount, nonZeroOnly or other ordinary resource filter is supported on these Delta routes.
Worked synchronization examples
All examples are fictional. Substitute the actual values returned by your own authorized API. The two examples illustrate separate, independent synchronization sequences.
Items Delta
Initial request:
GET https://api.example.com/api/v1/companies/1/items/changes HTTP/1.1
X-IMS-API-Key: YOUR_AUTHORIZED_TEST_API_KEY
Accept: application/json{
"companyId": 1,
"fullSyncRequired": true,
"reason": "initial_sync_required",
"baselineSince": "2026-10-01T10:00:00+00:00",
"policyVersion": "EXAMPLE_ITEMS_SERVER_VERSION",
"count": 0,
"data": []
}After the full items export succeeds, request the first incremental page:
GET https://api.example.com/api/v1/companies/1/items/changes?since=2026-10-01T10%3A00%3A00Z&policyVersion=EXAMPLE_ITEMS_SERVER_VERSION&pageSize=1 HTTP/1.1
X-IMS-API-Key: YOUR_AUTHORIZED_TEST_API_KEY
Accept: application/json{
"companyId": 1,
"companyCode": "EXAMPLE",
"currencyCode": "USD",
"fullSyncRequired": false,
"since": "2026-10-01T10:00:00+00:00",
"through": "2026-10-01T10:05:00+00:00",
"policyVersion": "EXAMPLE_ITEMS_SERVER_VERSION",
"count": 1,
"hasMore": true,
"nextAfterItemId": "DEMO-SHIRT-M",
"nextAfterStoreId": null,
"nextSince": "2026-10-01T10:00:00+00:00",
"data": [
{
"itemId": "DEMO-SHIRT-M",
"barcode": "DEMO000001",
"style": "DEMO-SHIRT",
"theme": null,
"itemName": "Example shirt",
"itemNameAr": null,
"itemType": 1,
"colorCode": null,
"colorName": null,
"size": "M",
"unit": 1,
"supplierId": 7,
"supplierName": "Example Supplier",
"brandId": null,
"brandName": "Example Supplier",
"categoryId": null,
"categoryName": null,
"subcategoryId": null,
"subcategoryName": null,
"productGroupId": null,
"productGroupName": null,
"productSubgroupId": null,
"productSubgroupName": null,
"receivedSeasonId": null,
"receivedSeason": null,
"salesPeriodId": null,
"salesPeriod": null,
"ageRangeId": null,
"ageRange": null,
"genderId": null,
"gender": null,
"countryId": null,
"countryName": null,
"itemState": 0,
"isOnline": false,
"originalPrice": 20,
"currentPrice": 18,
"averageLocalCost": null,
"lastPurchaseDate": null,
"lastPurchaseCurrencyId": null,
"lastPurchaseCurrency": null,
"lastPurchasePrice": null,
"firstDisplayDate": null
}
]
}Apply the row. Continue with exactly the same window, version and returned key:
GET https://api.example.com/api/v1/companies/1/items/changes?since=2026-10-01T10%3A00%3A00Z&policyVersion=EXAMPLE_ITEMS_SERVER_VERSION&pageSize=1&through=2026-10-01T10%3A05%3A00Z&afterItemId=DEMO-SHIRT-M HTTP/1.1
X-IMS-API-Key: YOUR_AUTHORIZED_TEST_API_KEY
Accept: application/jsonIllustrative final response:
{
"companyId": 1,
"companyCode": "EXAMPLE",
"currencyCode": "USD",
"fullSyncRequired": false,
"since": "2026-10-01T10:00:00+00:00",
"through": "2026-10-01T10:05:00+00:00",
"policyVersion": "EXAMPLE_ITEMS_SERVER_VERSION",
"count": 1,
"hasMore": false,
"nextAfterItemId": null,
"nextAfterStoreId": null,
"nextSince": "2026-10-01T10:05:00+00:00",
"data": [
{
"itemId": "DEMO-SHIRT-S",
"barcode": "DEMO000002",
"style": "DEMO-SHIRT",
"theme": null,
"itemName": "Example shirt",
"itemNameAr": null,
"itemType": 1,
"colorCode": null,
"colorName": null,
"size": "S",
"unit": 1,
"supplierId": 7,
"supplierName": "Example Supplier",
"brandId": null,
"brandName": "Example Supplier",
"categoryId": null,
"categoryName": null,
"subcategoryId": null,
"subcategoryName": null,
"productGroupId": null,
"productGroupName": null,
"productSubgroupId": null,
"productSubgroupName": null,
"receivedSeasonId": null,
"receivedSeason": null,
"salesPeriodId": null,
"salesPeriod": null,
"ageRangeId": null,
"ageRange": null,
"genderId": null,
"gender": null,
"countryId": null,
"countryName": null,
"itemState": 0,
"isOnline": false,
"originalPrice": 20,
"currentPrice": 18,
"averageLocalCost": null,
"lastPurchaseDate": null,
"lastPurchaseCurrencyId": null,
"lastPurchaseCurrency": null,
"lastPurchasePrice": null,
"firstDisplayDate": null
}
]
}After all pages are durably applied, save nextSince and policyVersion. Clear continuation keys. Poll again using nextSince as since, the same version, and no through or after key.
Inventory Delta
Initial request:
GET https://api.example.com/api/v1/companies/1/inventory/changes HTTP/1.1
X-IMS-API-Key: YOUR_AUTHORIZED_TEST_API_KEY
Accept: application/json{
"companyId": 1,
"fullSyncRequired": true,
"reason": "initial_sync_required",
"baselineSince": "2026-10-01T10:00:00+00:00",
"policyVersion": "EXAMPLE_INVENTORY_SERVER_VERSION",
"count": 0,
"data": []
}After the full inventory export succeeds, request the first incremental page:
GET https://api.example.com/api/v1/companies/1/inventory/changes?since=2026-10-01T10%3A00%3A00Z&policyVersion=EXAMPLE_INVENTORY_SERVER_VERSION&pageSize=1 HTTP/1.1
X-IMS-API-Key: YOUR_AUTHORIZED_TEST_API_KEY
Accept: application/json{
"companyId": 1,
"companyCode": "EXAMPLE",
"currencyCode": "USD",
"fullSyncRequired": false,
"since": "2026-10-01T10:00:00+00:00",
"through": "2026-10-01T10:05:00+00:00",
"policyVersion": "EXAMPLE_INVENTORY_SERVER_VERSION",
"count": 1,
"hasMore": true,
"nextAfterItemId": "DEMO-SHIRT-M",
"nextAfterStoreId": 101,
"nextSince": "2026-10-01T10:00:00+00:00",
"data": [
{
"storeId": 101,
"storeName": "Example Store",
"isMainStore": false,
"isOnlineStore": false,
"isDamageStore": false,
"isActive": true,
"itemId": "DEMO-SHIRT-M",
"onHandQty": 0,
"unitCost": null,
"stockValue": null,
"currentRetailPrice": 18,
"retailValue": 0
}
]
}Apply the row. Continue with exactly the same window, version and returned key pair:
GET https://api.example.com/api/v1/companies/1/inventory/changes?since=2026-10-01T10%3A00%3A00Z&policyVersion=EXAMPLE_INVENTORY_SERVER_VERSION&pageSize=1&through=2026-10-01T10%3A05%3A00Z&afterItemId=DEMO-SHIRT-M&afterStoreId=101 HTTP/1.1
X-IMS-API-Key: YOUR_AUTHORIZED_TEST_API_KEY
Accept: application/jsonIllustrative final response:
{
"companyId": 1,
"companyCode": "EXAMPLE",
"currencyCode": "USD",
"fullSyncRequired": false,
"since": "2026-10-01T10:00:00+00:00",
"through": "2026-10-01T10:05:00+00:00",
"policyVersion": "EXAMPLE_INVENTORY_SERVER_VERSION",
"count": 1,
"hasMore": false,
"nextAfterItemId": null,
"nextAfterStoreId": null,
"nextSince": "2026-10-01T10:05:00+00:00",
"data": [
{
"storeId": 102,
"storeName": "Example Store 2",
"isMainStore": false,
"isOnlineStore": false,
"isDamageStore": false,
"isActive": true,
"itemId": "DEMO-SHIRT-M",
"onHandQty": 7,
"unitCost": null,
"stockValue": null,
"currentRetailPrice": 18,
"retailValue": 126
}
]
}After all pages are durably applied, save nextSince and policyVersion. Clear continuation keys. Poll again using nextSince as since, the same version, and no through or after keys.
Envelope field dictionary
Fields appear only in the stated envelope shape. All fields are nonnull except the continuation keys; data is an array even for empty results.
| Field | Type / shape | Meaning |
|---|---|---|
companyId | integer; both shapes | Authorized company. |
fullSyncRequired | boolean; both shapes | True instructs a full rebuild; false is incremental. |
reason | string; full-sync only | initial_sync_required, history_not_available, policy_version_required or policy_or_catalog_changed. |
baselineSince | offset timestamp; full-sync only | Capture before exporting the full ordinary resource. |
policyVersion | string; both shapes | Opaque endpoint-, client-, company- and policy-specific synchronization version. |
companyCode / currencyCode | strings; incremental only | Company code and currency code; no companyName in Delta. |
since / through | offset timestamps; incremental only | Accepted fixed window bounds. |
count | integer; both shapes | Rows in data; zero for full-sync instruction. |
hasMore | boolean; incremental only | Whether another page is available. |
nextAfterItemId | string or null; incremental only | Last item key when hasMore; otherwise null. |
nextAfterStoreId | integer or null; incremental only | Last store key for Inventory Delta when hasMore; null otherwise and always null for Items Delta. |
nextSince | offset timestamp; incremental only | since while hasMore=true; through on completion. |
data | array; both shapes | Ordinary item or inventory rows; empty on full-sync instruction. |
Full synchronization and recovery
Initial requests, unavailable historical change coverage, missing policyVersion, and changed policy or authorized catalog membership can return fullSyncRequired=true. The policy can change when catalog members are added, removed or reassigned, when applicable permissions change, or when the inventory store catalog changes. Do not simply replace the policyVersion on an old cursor; rebuild the relevant complete mirror. No removal tombstones are emitted.
If a request or local write fails, retain the last durable cursor and replay. Persist a continuation key only together with the exact window and version and after its rows are durably applied. A completed empty incremental window still advances nextSince. Boundary rows may repeat; upsert rather than accumulate them.
During company maintenance, requests may return 503 with Retry-After. Retry the same request, without advancing the cursor. Maintenance alone does not invalidate policyVersion and does not require a full export. Follow a full-sync instruction if the actual policy or catalog has changed.
What Delta does and does not represent
Items Delta returns current item snapshots for tracked item-master or stock changes. Inventory Delta returns current balances for tracked store/item stock changes and authorized rows affected by tracked item-master changes, such as price changes. This is not a field-by-field change journal or a list of stock movements. Values are current when read and are not frozen historically at through. The safe window selects changes; each page is a separate request.
Some updates outside the supported change-tracked operations, lookup changes, cost-only background changes or direct removals of stock rows may require a deliberate full refresh. Reconcile periodically according to your integration's needs. A full export is paged, not a single frozen cross-request snapshot.
Use inventory movements for transaction flow and timestamp filters for recorded sales, purchases and movement events; these are distinct from Delta snapshots.