DEV Community

DocuMantra Team
DocuMantra Team

Posted on

Developer Notes: Building Aadhaar eSign into Your Product with an eSign API

These are notes for engineers who have been handed a ticket that says "add Aadhaar signing to the loan agreement step" or "let landlords and tenants sign with Aadhaar in the app". They focus on architecture and edge cases rather than a specific vendor's endpoints, which you should take from the provider's own documentation.

Mental model: Aadhaar is a signing method, not a separate system

Most eSign APIs are envelope-based. An envelope holds a document, a list of signers, fields and, for each signer, a signing method. Aadhaar eSign is best treated as one value of that method field. Your backend should not branch into a separate Aadhaar pipeline. The same create, send, track and download flow applies; only the method on one signer changes.

This keeps the codebase small and makes it easy to switch a document type between standard signing and Aadhaar when legal changes their mind.

Who does what in the flow

  1. Your app prepares the final PDF and the signer list.
  2. Your backend creates the envelope through the eSign provider's API, with Aadhaar set as the method for the relevant signer.
  3. The signer opens the signing link or embedded view, reviews the document and authenticates with UIDAI using the OTP on their Aadhaar-linked mobile.
  4. A licensed certifying authority completes the electronic signature.
  5. Your backend picks up the completed status and downloads the signed PDF and certificate.

Your application never performs Aadhaar authentication itself and never becomes a CA.

Data you should not hold

  • Aadhaar numbers. The signer types them into the signing flow. Do not add an Aadhaar field to your onboarding form "to pre-fill" anything.
  • OTPs. Never route OTPs through your support chat, tickets or logs. Scrub logs if a user pastes one.

Less sensitive data in your system means a smaller compliance surface and fewer awkward audit questions.

Edge cases to design for

  • Stale mobile number. The most frequent failure: the signer's UIDAI-registered number is inactive, so the OTP never arrives. Show a clear message telling them to update their number with UIDAI, and let the envelope wait rather than spamming retries.
  • Signer abandons midway. Plan reminders and an expiry policy.
  • Document changes after sending. Void and re-create the envelope; never patch a document under signature.
  • Mixed methods. One envelope may have an Aadhaar signer and a standard signer. Your UI should show each signer's method accurately.

Naming in your product copy

Label things accurately. Aadhaar eSign is not a Class 3 DSC, and portals that require a DSC still need one. An SMS or email OTP signature is not Aadhaar eSign. Product copy that blurs these creates support tickets and legal risk.

Costs to model

Expect two components: the envelope and the Aadhaar step. With DocuMantra, sending is free for up to 10 envelopes every month, and Aadhaar eSign uses credits on top of the envelope. Signers authenticate through a licensed CA and do not need an account or an SDK. Gate Aadhaar behind a per-document-type flag so you only spend credits where legal has asked for it.

For the integration pattern in more detail, see this write-up on the eSign API for Aadhaar. For general API concepts beyond Aadhaar, the eSign API guide for Indian developers is a good companion read.

Ship checklist

  • Aadhaar is a method flag, not a separate pipeline
  • No Aadhaar numbers or OTPs stored or logged
  • Clear UI for stale-mobile failures
  • Void and re-create on document changes
  • Signed PDF and certificate stored per transaction

Top comments (0)