Identity Reconciliation
Identity reconciliation service for linking customer contacts across multiple purchases — resolves contact chains using linked-list style deduplication.
TypeScriptNode.jsExpressPostgreSQLPrismaREST APIRender
About
A production REST API that solves a real e-commerce problem: the same customer uses different email/phone combinations at checkout, creating duplicate contact records. This service reconciles them into a single identity.
How It Works
- New contact — creates a primary record
- Returning contact — finds the oldest primary, creates a secondary record linked to it
- Merging chains — when new data bridges two existing contact groups, the younger primary is demoted to secondary and all records are consolidated
Architecture
- Node.js + TypeScript with Express
- PostgreSQL database with Prisma ORM
- Single POST /identify endpoint that returns a fully consolidated contact object with all known emails, phones, and secondary IDs
- Deployed and live at https://identity.musavirchukkan.in
Database Schema Contacts table with linked_id (self-referencing FK) and link_precedence enum (primary / secondary) — effectively a linked-list resolved at query time.
API POST /identify — accepts email and/or phoneNumber, returns { primaryContactId, emails[], phoneNumbers[], secondaryContactIds[] }