IMS Documentation
IMS API 1.1.0.0 • Business API v1

Customer Delta synchronization

Maintain an authorized company customer mirror with a full catalog baseline and subsequent current customer snapshots.

GET /api/v1/companies/{companyId}/customers/changes requires customers.read, company access and a configured ordinary company contract. Complete parameters, response fields and examples. Use the same client and company throughout synchronization. The company boundary applies to both the catalog and Delta; supplier/store contract lists do not narrow the customer catalog.

Initial full synchronization

  1. Call changes with no since. It returns HTTP 200 with fullSyncRequired=true, reason=initial_sync_required, baselineSince and revision. Save these values before starting the catalog export.
  2. Read every page of /customers?page=1&pageSize=200, increasing page until totalPages is exhausted. Apply or stage the full company catalog. Never infer removals from an incomplete or failed export.
  3. After a complete export, request changes with since equal to the captured baselineSince and revision equal to the captured revision. Omit through and afterCustomerId on this first incremental request.
  4. Apply all incremental pages. If another fullSyncRequired response arrives, discard that incomplete synchronization attempt and repeat the full procedure with the new baseline and revision.

Parameters and cursor rules

Incremental rows have exactly the customer catalog fields. These are current customer snapshots, not historical events or field patches. Upsert idempotently by (companyId, id), preserving null values. The API does not emit deletion tombstones; obey every full-sync instruction and reconcile only from a complete catalog export.

Hypothetical multi-page sequence

All timestamps and IDs below are fictional. Use the actual returned values in an integration.

  1. At 10:00 the initial changes request returns baselineSince=2026-10-01T10:00:00Z, revision=4. Save both and export all customer pages.
  2. Request changes?since=2026-10-01T10%3A00%3A00Z&revision=4&pageSize=1. The response selects through=10:05, returns customer 10001, hasMore=true, nextAfterCustomerId=10001 and nextSince=10:00.
  3. Apply that row, then request changes?since=2026-10-01T10%3A00%3A00Z&through=2026-10-01T10%3A05%3A00Z&revision=4&afterCustomerId=10001&pageSize=1.
  4. The final page returns customer 10002, hasMore=false, nextAfterCustomerId=null and nextSince=10:05. After applying it, durably save 10:05 and revision 4; clear the page key.
  5. For the next poll use since=10:05, revision=4 and no through or afterCustomerId. Boundary rows may repeat because the time interval is inclusive; replacement/upsert avoids duplication.

If a page or local write fails, keep the previous durable window cursor and replay safely. Persist an in-window key only together with the exact since, through and revision and after the associated rows are durably applied. Advance since only after hasMore=false and the entire window is applied, including an empty final window.

Envelope field dictionary

FieldType / nullabilityMeaning and shape
companyIdinteger, nonnullAuthorized company; both shapes.
fullSyncRequiredboolean, nonnullSelects the full-sync or incremental shape.
reasonstring, nonnull; full-sync onlyinitial_sync_required, history_not_available or catalog_revision_changed.
baselineSinceoffset timestamp, nonnull; full-sync onlySafe server baseline to capture before exporting.
revisionint64, nonnullCatalog revision for this synchronization.
companyCodestring, nonnull; incremental onlyCompany code; no companyName in Delta.
since / throughoffset timestamps, nonnull; incremental onlyAccepted fixed window boundaries.
countinteger, nonnullNumber of rows in data; zero on a full-sync instruction.
hasMoreboolean, nonnull; incremental onlyWhether another keyset page is available.
nextAfterCustomerIdint64 or null; incremental onlyLast returned ID when hasMore=true; otherwise null.
nextSinceoffset timestamp, nonnull; incremental onlysince while hasMore; through on completion.
dataarray, nonnullCustomer rows, or an empty array on full-sync instruction.

Revision changes and recovery

A supplied revision different from the current revision produces fullSyncRequired=true with reason=catalog_revision_changed. A since older than available history produces history_not_available. Capture the new baselineSince and revision, export all customers again and reconcile stale records only after the full export succeeds. Do not respond by merely replacing revision on an old cursor.

Missing revision with since returns 400 delta_revision_required. An incomplete continuation or negative ID returns 400; future or inverted time windows return invalid_delta_window. 503 customer_delta_not_installed requires administrator assistance. Keep the last known cursor on every failed request. See error recovery.

Privacy and synchronization boundaries

Customer names, phone numbers, birth dates and email addresses are personal data. Restrict the mirror to the approved purpose and authorized personnel, protect stored data, and keep real customer payloads and API keys out of logs, examples and support tickets. Customer IDs are loyalty identifiers and do not replace ERP customer IDs on sales.

Full-catalog pages do not share one export-wide snapshot; Delta rows are latest state rather than historical snapshots frozen at through. Use the server watermark, idempotent application and explicit full-sync instructions. Hourly Footfall is an independent aggregate traffic resource, not a customer-event feed.