Carrier updates can be delivered more than once. If each delivery appends a new status row, a tracking timeline may imply that a parcel moved twice. Keep the raw event ID, apply each event once, and retain duplicates as observable input rather than silently changing the shipment state.

The example uses a SQLite unique key and a transaction. It is a local data-ingestion pattern, not a claim about a production carrier or store connector. It is relevant when a Shopify 3PL workflow receives retried status events; drop shipping and shopify fulfillment can share the same event boundary even when their order sources differ.

const Database = require('node:sqlite').DatabaseSync; const db = new Database(':memory:'); db.exec('CREATE TABLE shipment_event(event_id TEXT PRIMARY KEY, tracking_ref TEXT NOT NULL, status TEXT NOT NULL, observed_at TEXT NOT NULL)'); const insert = db.prepare('INSERT INTO shipment_event VALUES (?, ?, ?, ?) ON CONFLICT(event_id) DO NOTHING'); function ingest(event) { if (!event.id || !event.trackingRef || !event.status || !event.observedAt) { throw new TypeError('event fields are required'); } db.exec('BEGIN IMMEDIATE'); try { const changes = insert.run(event.id, event.trackingRef, event.status, event.observedAt).changes; db.exec('COMMIT'); return changes === 1 ? 'inserted' : 'duplicate'; } catch (error) { db.exec('ROLLBACK'); throw error; } } const e = {id:'evt-7',trackingRef:'T-1',status:'in_transit',observedAt:'2026-11-24T06:00:00Z'}; console.log(ingest(e), ingest(e), db.prepare('SELECT count(*) AS n FROM shipment_event').get().n); 

Run it with Node 24: expected output is inserted duplicate 1. A second test should reject an empty event ID and confirm that no row was inserted. Keep the source event ID for audits; a later correction should be a new event, not a destructive overwrite.

For china fulfillment, the practical question is how a tracking update is tied to a parcel and how a correction is represented. An International Fulfillment for Folligen event contract would need to be specified before implementation; this is a hypothetical requirement, not a YX relationship. A china 3PL integration should document its event identity and retry window. See the integration support scope for the account-specific inputs that need agreement.
Packing tables and parcel-handling equipment in a warehouse.

Packing tables and parcel-handling equipment in a warehouse.