Key Takeaways
- ONDC is a Data Goldmine: The Open Network for Digital Commerce (ONDC) is not just a transaction protocol; it's a rich source of first-party customer intent and behavior data that traditional CDPs are ill-equipped to handle.
- Unified Stack is Essential: A unified frontend stack using Kotlin Multiplatform (KMP) for mobile and Next.js 15 for web is the optimal approach to ensure consistent, high-fidelity data collection across all customer touchpoints.
- The Architectural Core: The ONDC-Native CDP relies on an event-driven, serverless architecture for ingestion, a sophisticated identity resolution engine to create a "golden record," and a flexible data model for ONDC-specific segmentation.
- Activation is the Goal: The unified customer profile is not a passive asset. It's designed for real-time activation, powering hyper-personalization in Next.js 15 frontends, feeding targeted audiences to ad platforms, and enriching ERP data for superior customer service.
- DPDP-Compliance by Design: This architecture provides a centralized framework for managing user consent, a critical requirement for compliance with India's Digital Personal Data Protection (DPDP) Act.
The Paradigm Shift: From ONDC Transactions to ONDC Data Assets
The rise of the Open Network for Digital Commerce (ONDC) represents the most significant architectural evolution in India's digital economy since UPI. For enterprises, the initial focus has been on compliance and integration—becoming a certified Buyer App Provider (BAP) or Seller App Provider (BPP). However, this tactical view misses the colossal strategic opportunity: ONDC is creating an unprecedented, network-level stream of customer data.
Every search, select, init, and confirm call is more than a step in a transaction; it's a granular signal of customer intent, preference, and behavior. Legacy Customer Data Platforms (CDPs), built for the monolithic world of websites and siloed mobile apps, are fundamentally unprepared for the decentralized, protocol-driven nature of ONDC. They lack the context to interpret ONDC-specific event flows and struggle to unify identities across different network participants.
To win in the ONDC era, enterprises must move beyond merely participating in the network to building a strategic data asset from it. This requires a new architectural blueprint: an ONDC-Native Customer Data Platform (CDP). This guide details how to build such a system using a forward-looking, unified technology stack featuring Kotlin Multiplatform and Next.js 15, creating a powerful engine for growth in 2026 and beyond.
Deconstructing the ONDC Data Opportunity
Before designing the architecture, we must understand the unique characteristics of "ONDC-native" data. It's far richer than a standard ecommerce event stream.
- Pre-Purchase Intent Signals: On ONDC, a user might initiate a
search via a Buyer App like Paytm, discover your products served by your Seller App, but not immediately purchase. This interaction, captured via your BPP adapter, is a high-value intent signal that is often lost in traditional analytics.
- Cross-Domain Behavior: A single user could search for groceries, electronics, and mobility services across different Buyer Apps within a short period. An enterprise participating in multiple ONDC domains can start building a holistic, 360-degree view of a customer's lifestyle and needs.
- Contextual Fulfillment Data: The entire fulfillment journey (
on_status, on_track) provides rich post-purchase data, including delivery preferences, location patterns, and service satisfaction signals that can be used for segmentation and churn prediction.
However, harnessing this data presents significant technical challenges:
- Identity Fragmentation: How do you connect an anonymous user browsing on your Next.js 15 web portal, a logged-in user on your Kotlin Multiplatform mobile app, and their transaction records flowing through the ONDC gateway?
- Data Silos: Data originates from multiple sources—your BAP/BPP adapter, your frontends, your ERP, and your logistics partners. Unifying this in real-time is a complex data engineering problem.
- Protocol-Specific Logic: Standard event tracking schemas don't understand the stateful, asynchronous nature of ONDC's call-and-response protocol.
A purpose-built architecture is not a luxury; it's a necessity.
To build a robust ONDC-Native CDP, the foundation must be a cohesive data collection strategy. Fragmented data collection leads to fragmented customer profiles. This is why we advocate for a unified stack where the web and mobile frontends are architected in concert.

The Data Collection Layer: KMP and Next.js 15 as Unified Frontends
The primary goal of the collection layer is to capture every relevant user interaction with high fidelity and a consistent data schema, regardless of the platform.
Kotlin Multiplatform (KMP) for Native Mobile Supremacy
For your enterprise mobile app (acting as a BAP or a brand-specific shopping app), KMP is the definitive choice for 2026. It allows you to write the core application logic, including data models and analytics tracking, once in Kotlin and share it across both iOS and Android.
- Shared Event Schema: Define your ONDC analytics events (e.g.,
OndcProductSearched, ItemAddedToCart, CheckoutInitiated) in a shared KMP module. This eliminates discrepancies between iOS and Android tracking implementation, a common source of data corruption.
- Resilient Offline Tracking: For users in low-bandwidth areas—a key consideration in the Indian market—KMP's shared logic can easily implement a robust offline event queueing system that syncs with the CDP backend once connectivity is restored.
- Access to Native APIs: Capture rich device-level context like location, network type, and device model to enrich the customer profile, all orchestrated from the shared Kotlin codebase.
// In your shared KMP module
@Serializable
data class OndcAnalyticsEvent(
val eventName: String,
val transactionId: String?, // Key for stitching ONDC journey
val screenName: String,
val userProperties: Map<String, String>,
val eventParams: Map<String, String>
)
// This single `track` function can be called from both
// Android (JVM) and iOS (Native) UI code.
class AnalyticsTracker {
fun track(event: OndcAnalyticsEvent) {
// 1. Add to local queue (e.g., SQLDelight)
// 2. Attempt to send to CDP ingestion endpoint
}
}
Next.js 15 for a High-Performance Web Experience
Your web portal or storefront, built with Next.js 15, is the other critical data collection endpoint. The latest features of Next.js are perfectly suited for this task.
- Server Actions for Reliable Tracking: Instead of relying on client-side API calls that can be blocked by ad-blockers, use Next.js 15 Server Actions to send tracking events directly from the server. This dramatically increases data collection reliability.
- Partial Prerendering (PPR) & Streaming: Capture user interactions on dynamic, personalized components without sacrificing initial page load performance. As a user interacts with a server-rendered component, you can stream analytics events to your CDP backend in parallel.
- The "Unified SDK" Concept: The truly revolutionary step is to achieve schema consistency between your KMP app and your Next.js app. By compiling your KMP shared module (containing the
OndcAnalyticsEvent data class) to JavaScript, you can use the exact same data models and validation logic within your Next.js Server Actions. This guarantees end-to-end data integrity across your entire digital footprint.
Architecting the ONDC-Native CDP Core
Once the data flows from the unified frontends, the CDP core is responsible for ingestion, processing, unification, and storage. An event-driven, serverless architecture is ideal for handling the spiky, real-time nature of this data.
Ingestion & Processing Layer (Serverless & Event-Driven)
- API Gateway & Ingestion Functions: An API Gateway (e.g., Amazon API Gateway) provides a single, secure endpoint for all incoming events from your KMP apps and Next.js frontends. This gateway triggers a serverless function (e.g., AWS Lambda).
- Event Bus for Decoupling: The ingestion function's sole job is to validate the event against your schema and publish it to an event bus (e.g., AWS EventBridge or Google Pub/Sub). This decouples ingestion from processing, creating a resilient and scalable system.
- Downstream Processors: Multiple serverless functions can subscribe to the event bus to perform tasks in parallel:
- Enrichment: A function can enrich the event with IP-based geolocation, user-agent parsing, or data from other internal APIs.
- Archiving: A function can dump the raw, immutable event into a data lake (e.g., Amazon S3) for long-term storage and future analysis.
- Real-time Processing: A function can forward the event to the Identity Resolution engine.
Identity Resolution & Profile Unification Engine
This is the heart of the CDP. Its purpose is to create and maintain a single, persistent "Golden Customer Record" for each user.
- Identifier Hierarchy: The engine processes events and extracts identifiers: anonymous browser IDs, mobile device IDs, logged-in user IDs, email addresses, phone numbers, and crucially, ONDC
transaction_ids.
- Stitching Logic: It uses a rules-based and probabilistic approach to merge profiles. For example, if an event with a known
device_id also contains a transaction_id that was previously associated with a logged-in user_id, the two profiles are merged. The ONDC transaction ID becomes the most powerful anchor for connecting anonymous browsing sessions with authenticated purchases.
- The Golden Record: The unified profile is stored in a structured database (e.g., PostgreSQL or a managed service like Amazon RDS) or a data warehouse (e.g., BigQuery, Redshift). It contains not only traits (name, email) but also a complete, time-series log of all events associated with that user.
Data Storage & ONDC-Specific Segmentation
- Polyglot Persistence: Use the right tool for the job. Raw events live in a data lake (S3). Unified profiles are in a data warehouse (BigQuery). And for real-time personalization, user segments can be cached in a fast key-value store like Redis.
- Segmentation Engine: The real power of the ONDC-Native CDP comes from building segments that were previously impossible. The segmentation engine should allow business users to create dynamic cohorts based on ONDC journey data:
- "High-Value Logistics Seekers": Users who frequently
search for logistics services with specific pincode-to-pincode combinations.
- "Abandoned Cart (ONDC
init state)": Users who initiated an ONDC order (init) but never completed it (confirm).
- "Cross-Category Explorers": Users who have made purchases in both the F&B and Fashion domains on the network.
The Activation Layer: Putting ONDC Data to Work
A data platform is useless without an activation layer. The goal is to push the unified profiles and segments to downstream systems to drive business outcomes.

Hyper-Personalization on Next.js 15
With the unified profile accessible via an internal API, your Next.js 15 application can transform into a hyper-personalization engine. Using React Server Components (RSCs), you can fetch a user's segment data on the server and render a completely personalized UI. For example, if the CDP identifies a user as belonging to the "Cross-Category Explorer" segment, the homepage can feature a component that showcases products from a category they haven't purchased from yet.
Powering Data-Driven Marketing Engines
This is where the CDP directly impacts your bottom line.
- Audience Syndication: The platform can automatically sync your custom segments (e.g., "High-Value Logistics Seekers") with Google Ads Customer Match and Meta Ads Custom Audiences. This allows you to run highly targeted and efficient acquisition and retargeting campaigns.
- Informing Predictive Models: The rich, unified data stream is the perfect fuel for machine learning models that predict Customer Lifetime Value (pLTV), churn risk, or the next best product to recommend.
Enhancing Customer Support (ERP Integration)
When a customer contacts your support team, the agent often lacks context. By integrating the ONDC-Native CDP with your ERP (like ERPNext), you can push the entire customer journey log into the ERP's CRM module. Your support agent can see every ONDC search, every interaction, and every order, enabling them to provide faster, more empathetic, and more effective support.
DPDP Compliance and Future-Proofing the Architecture
In the age of data privacy, compliance is non-negotiable. The DPDP Act, 2023, requires clear user consent for data processing. An ONDC-Native CDP, with its centralized architecture, is the perfect platform to manage this.

- Centralized Consent Ledger: Each unified customer profile should have a corresponding consent object that records granular permissions (e.g., "consent for marketing," "consent for analytics").
- Enforcement at the Activation Layer: Before any data is pushed to a marketing platform or used for personalization, the activation service must check the consent ledger. This "compliance-by-design" approach is far more robust than managing consent in multiple siloed applications.
- Scalability for the Future: ONDC is expanding into new domains like financial services, agriculture, and mobility. A well-architected CDP can easily be extended to ingest and model data from these new protocols, making your data asset more valuable over time.
Frequently Asked Questions (FAQ)
Q1: Why not just use an off-the-shelf CDP like Segment or Twilio?
Off-the-shelf CDPs are excellent for standard web and mobile event tracking. However, they lack the native understanding of the ONDC protocol. Customizing them to interpret the search -> on_search -> select -> on_select flow, handle ONDC-specific error codes, and use ONDC transaction IDs as a primary key for identity resolution would require significant engineering effort, defeating the purpose of a pre-built solution. An ONDC-Native CDP is purpose-built for this new ecosystem.
Q2: How does this architecture handle the real-time nature of ONDC transactions?
The event-driven, serverless architecture is key. Using a managed event bus like AWS EventBridge or Google Pub/Sub allows for massive, parallel ingestion of events with very low latency. Critical processes, like updating a user's profile upon a confirm call, can be processed in milliseconds, while less time-sensitive tasks like archiving can run asynchronously. This ensures the system is responsive without being monolithic.
Q3: What's the role of the ERP (e.g., ERPNext) in this CDP architecture?
The ERP is both a data source and a data destination. It's a source for core customer information (e.g., customer master data) and final order details. It's a destination for the enriched customer journey data from the CDP. The CDP provides the "why" (the customer's browsing and search behavior) behind the "what" (the final order recorded in the ERP), giving business teams a complete picture.
Q4: Is Kotlin Multiplatform mature enough for this kind of enterprise application?
Absolutely. As of 2024, Kotlin Multiplatform is stable and production-ready. Major companies are using it to ship complex applications. For a data-collection SDK within an enterprise app, its benefits are undeniable: it guarantees that the data you collect from your million-plus iOS users is structured and validated in exactly the same way as the data from your Android users, which is a massive win for data quality.
Build Your Future-Ready ONDC Data Strategy Today
The Open Network for Digital Commerce is a once-in-a-generation opportunity to build a deep, direct, and data-rich relationship with your customers. Simply participating is not enough. The enterprises that will dominate the next decade of digital commerce in India will be those who build a strategic capability to harness the data flowing through the network.
Architecting and building an ONDC-Native Customer Data Platform is a complex undertaking, requiring deep expertise in data engineering, cloud-native development, and the nuances of the ONDC protocol.
Induji Technologies specializes in architecting these high-impact, next-generation enterprise systems. Let our team of experts help you design and build the ONDC-Native CDP that will become the engine of your data-driven growth.
Request a Quote and Schedule a Consultation with Our ONDC Architects