
Table of Contents
Introduction
India Stack API Integration projects are becoming a priority for government agencies that need to connect ONDC, GeM, DigiLocker, Account Aggregator, and UPI through secure, scalable architectures. India Stack API Integration projects rarely fail because of APIs alone. They fail because ONDC, GeM, DigiLocker, Account Aggregator, and UPI use different authentication models, data contracts, and operational workflows. When government agencies need these platforms to work together, India Stack API Integration becomes an architecture challenge rather than a simple software development task.
A state-government procurement agency in South India asked Codelynks to solve a specific problem: 14,000 MSMEs registered under a state PLI program needed to sell on GeM and ONDC simultaneously, but neither platform shared a product catalog standard, consent model, or order management schema.
The problem is not unique. As India Stack v2 expands its API surface and ONDC scales past 630 cities and 1.16 lakh active sellers, government agencies are becoming integration operators by accident. They inherit the technical liability of bridging platforms that were never designed to speak to each other. This post lays out what a production-grade India Stack API platform looks like and why most first attempts fail.
What Government Agencies Are Actually Building
The phrase “India Stack integration” is usually shorthand for something far more complex. A procurement agency connecting MSMEs to the public e-marketplace ecosystem typically needs to touch five separate API domains: ONDC (seller onboarding, catalog sync, order events), GeM (product registration, bid submission, contract workflows), Account Aggregator (financial consent for MSME credit decisioning), DigiLocker (document verification for GST, Udyam, PAN), and UPI (payment settlement and mandate management).
Each domain has a different authentication model. ONDC uses a Beckn protocol with ED25519 key signing per request. GeM runs on OAuth 2.0 with certificate-based API gateway authentication. Account Aggregator flows require the operator to become a Financial Information User (FIU) with RBI registration. DigiLocker uses Aadhaar-linked OAuth with a 30-minute token TTL.
The point is not that these are hard. The point is that no single developer or team holds the full knowledge surface. Most integration projects understaff the auth and consent design phase, then discover the gap when staging tests begin. A successful India Stack API Integration strategy requires more than API connectivity: it requires governance, security, consent management, and event-driven processing.
Every successful India Stack API Integration project starts with a clear understanding of authentication, consent, data models, and event-driven communication across government platforms.
Why the First Integration Always Fails
India Stack is not a single API. It is a network of networks, each with different auth models, rate limits, and data contracts. Most teams treat it as a unified platform and design a single integration layer. That is the wrong model. Most India Stack API Integration failures occur because asynchronous workflows, consent states, and API version changes are not considered during the initial architecture phase.
The failure pattern is consistent. A team builds a synchronous REST wrapper over the ONDC seller node. Product catalog sync works in testing. In production, ONDC sends asynchronous order callbacks via webhook with a 5-second acknowledgment SLA. The synchronous wrapper cannot handle the callback pattern. Orders are missed. The ONDC network flags the seller node for non-compliance after 72 hours of missed callbacks, triggering a suspension workflow.
The second failure pattern is consent state management. Account Aggregator consent flows have three states that can change independently: approved, revoked, and expired. A system that only checks for approval at the point of data request fails when a consent is revoked mid-session. This is not a bug you catch in unit tests. It surfaces in production when an MSME owner revokes a consent from the AA mobile app while a credit check is in progress.
Both failures are predictable. Neither requires novel engineering to prevent. They require a clear mental model of the integration surface before a line of code is written.
The ONDC Integration Tiering Model
Codelynks uses a four-tier model to classify integration depth and set client expectations before architecture begins.
Tier 1: Catalog Bridge. The seller’s existing product database syncs to ONDC via scheduled batch jobs. No real-time order handling. Suitable for government agencies managing low-volume, high-value procurement — construction materials, uniform supply. Latency acceptable at 4-hour sync cycles. No consent flows required.
Tier 2: Live Seller Node. Real-time order handling with webhook receivers, order state machines, and seller acknowledgment logic. Requires async architecture — message queues, not REST polling. Suitable for agencies managing commodity procurement at volume. Consent flows required only for financial products.
Tier 3: Multi-Domain Integration. Live seller node plus Account Aggregator consent flows for MSME credit decisioning, DigiLocker document verification, and UPI collection mandates. This is the tier the South India procurement agency needed. Requires a dedicated integration platform, not application-layer code.
Tier 4: Agentic Delegation Layer. Built on the patterns proposed in the Doot whitepaper: an AI agent acts on behalf of a citizen or MSME, making routine procurement decisions using delegated identity and scoped consent. No production deployment of this tier exists in India as of June 2026, but the API design decisions made at Tier 3 determine whether Tier 4 is achievable later.
What a Production Integration Platform Looks Like
The South India agency’s platform has three components that most vendor proposals leave out.
First, an event ledger. Every API call, callback, consent event, and order state change is written to an immutable append-only log before any business logic runs. This is not a logging system. It is the system of record. When the ONDC network disputes an order acknowledgment timestamp, the ledger wins.
Second, a rate limit budget manager. ONDC’s production network enforces per-seller-node rate limits that differ from the sandbox. GeM’s API gateway has burst limits not published in documentation. The platform maintains per-domain token buckets with a configurable safety margin and exposes a real-time budget dashboard to the agency’s operations team.
Third, a consent lifecycle service. Every AA consent is tracked with its own state machine: requested, approved, active, expiring-soon, expired, revoked. The system sends proactive renewal requests 72 hours before expiry. Revocation events trigger immediate downstream notifications to any in-flight credit processes.
The most expensive mistake in government integration work is designing for the current API version instead of the deprecation schedule. ONDC has published three major protocol versions since 2022. GeM deprecated its v1 product registration API in March 2026 with 90 days’ notice. A platform without version management becomes a firefighting operation within 18 months.
Anti-Patterns That Appear in Every RFP
Four patterns appear in government IT RFPs that reliably predict project failure.
A single middleware layer for all integrations. Different India Stack domains have incompatible processing models. Forcing ONDC’s async callbacks through the same middleware as GeM’s synchronous RFP submission creates a reliability dependency between two unrelated workflows.
Schema mapping in application code. Product catalog field mappings between a state government database, GeM’s product schema, and ONDC’s catalog model change with every platform update. These mappings belong in a configuration layer, not embedded in application code.
Testing against sandbox only. ONDC’s production network behaves differently from its sandbox in three documented ways: callback timing, rate limits, and error response schemas. Budget for production integration testing before go-live.
Ignoring the deprecation calendar. The most experienced teams maintain a 12-month view of API version deprecation schedules across all integrated domains. Without it, a single vendor deprecation can ground an entire procurement platform.
What This Means for Government and Public Sector Leaders
An ONDC seller node that works in your staging environment and fails at 11 AM on a flash-sale day is not an integration. It is a liability. The same applies to a GeM catalog sync that silently drops SKUs when a category schema update is released without notice.
If your agency is building or procuring an India Stack integration this year, three things are worth doing before the architecture is finalized. Ask your vendor what their consent lifecycle management approach is, specifically. Ask how they handle ONDC’s asynchronous callback model under load. Ask what their protocol version migration playbook looks like. If the answers are vague, the integration will be renegotiated in six months.
More Blogs: Choosing the Right Technology for Your Web Development










