eStamp — Leegality

Created by Rajatha B M, Modified on Fri, 27 Mar at 2:33 PM by Rajatha B M

What does this API do?

The Leegality eStamp capability (BharatStamp) allows lenders integrated with the ULI Platform to digitally stamp loan documents as part of the eSign workflow. Stamping can be combined with an eSigning journey in a single API call or used independently for stamping-only flows via NeSL.

Key capabilities of BharatStamp:

  • Available across 31 States and Union Territories.
  • Supports both fixed and dynamic stamp duties.
  • Dynamic stamping — automatically selects appropriate stamp denominations based on transaction value.
  • Reclaims unused stamps if a signer drops off, eliminating stamp paper wastage.
  • Integrates with NeSL (National E-Governance Services Ltd) for compliance tracking of stamped documents.

The same eSign eStamp API endpoint handles both eSign and eStamp operations. Stamping parameters are passed alongside signing parameters in the request body. After successful processing, the lender receives a Document ID, and signatories receive signing/stamping links via their preferred communication channel.

Who can use it?

Lenders and financial institutions onboarded on the ULI Platform who require legally compliant digital stamping — with or without accompanying eSigning — for loan agreements, security documents, or other instruments requiring stamp duty payment.

Prerequisites

Complete all common platform prerequisites as described in Getting Started with ULI Platform APIs.

In addition, the following Leegality-specific steps must be completed before using eStamp:

  • Leegality Account Onboarding — Complete the necessary Leegality account setup to obtain system access.
  • X-Auth-Token Setup — Retrieve your X-Auth-Token from the API Settings tab on your Leegality dashboard. This is required in every API request header.
  • Stamp Procurement — BharatStamps must be procured in advance through Leegality before they can be used in requests.
  • Workflow Configuration — Define and publish a Workflow Profile in the Leegality dashboard that includes stamping. The profileId of a published workflow is mandatory in the request body.
  • NeSL Onboarding (if applicable) — If documents require NeSL-compliant stamping (lending or non-lending flows), complete NeSL-specific onboarding with Leegality and configure party, document, and security details accordingly.
  • Template Configuration (if applicable) — If using a Template-type workflow, configure the template beforehand. A Base64-encoded PDF can also be passed directly.
  • Callback URL Registration — Register a callback URL with the platform to receive post-stamping and post-signing webhook notifications.

API endpoints

EnvironmentURL
Sandboxhttps://extgw.nonprod.rbihub.io/leegality/esign-estamp/1.0/en
Productionhttps://extgw.api.rbihub.io/leegality/esign-estamp/1.0/en

HTTP Method: POST

URL path convention: /{service name}/{ver}/{lang}

URL ParameterValueDescription
service nameleegality/esign-estampUnique name of the service
ver1.0Current API version
langenLanguage for the response (default: English)

Headers

HeaderDescriptionRemarks
AuthenticationJWT token generated by the ULI authentication server. Refer to the Authentication and Authorization API specification.Mandatory
client-idBase64-encoded value of the Client ID provided in the JWT token.Mandatory
providerService provider code. Value: 130 for Leegality.Mandatory
x-lender-auth-tokenLender's JWT token for data authentication.Mandatory
x-sp-auth-tokenLeegality's X-Auth-Token from the Leegality Dashboard.Mandatory
x-env-routeRequired to route requests to the sandbox environment. Value: /sbMandatory for Sandbox only; omit for Production
api-key24-character alphanumeric key assigned during lender registration.Optional — reserved for future use

Request body

All requests must be in JSON format. The top-level envelope parameters are:

ParameterDescription
tsDate and time of request initiation in ISO-8601 format: yyyy-MM-ddTHH:mm:ssZ
txncodeUnique transaction code for this request
verVersion of the request template currently in use
hmacSHA-256 hash of the value of the data key
dataObject containing the eStamp request payload (see key fields below)

Key stamp-specific fields within the data object:

ParameterMandatoryTypeDescription
profileIdYesstringID of the published Workflow from the Leegality Dashboard
file.fileYesstringBase64-encoded PDF file (max 15 MB before encoding)
stampSeriesNostringStamp series value from the dashboard when stamp choice is enabled
multipleStampSeries[].stampSeriesNostringSeries number of the stamp series to use
multipleStampSeries[].seriesQuantityNostringNumber of stamps to affix (1–99)
seriesGroupNostringStamp group value from the dashboard
stampValueNostringStamp amount value when stamp group is enabled
stampUpload.stateYes (if stampUpload used)stringName of the state where the stamp paper is issued
stampUpload.denominationYes (if stampUpload used)stringDenomination of the uploaded stamp paper
stampUpload.firstPartyNameYes (if stampUpload used)stringFirst party name on the stamp paper
stampUpload.secondPartyNameYes (if stampUpload used)stringSecond party name on the stamp paper
stampUpload.stampSerialYes (if stampUpload used)stringSerial number of the uploaded stamp paper
stampUpload.stampFileYes (if stampUpload used)stringBase64-encoded file of the uploaded stamp paper
revenueStampSeriesNostringRevenue stamp series from the dashboard if enabled
revenueStampQuantityNostringQuantity of revenue stamps (default: 1)

Key NeSL-specific fields within the data.neslData object (required for NeSL-compliant stamping):

ParameterMandatoryDescription
neslData.documentDetail.loanNumberConditionalLoan number. Either loan number or sanction number is required for lending flows; loan number is mandatory for eBG.
neslData.documentDetail.sanctionNumberConditionalSanction number. Either loan number or sanction number is required for lending.
neslData.documentDetail.registrationTypeYesType of debt: INDIVIDUAL_LOAN, NON_INDIVIDUAL_LOAN, non_lending, EBG
neslData.documentDetail.stateYesState where stamp duty is paid
neslData.documentDetail.sanctionAmountConditionalSanctioned amount. Mandatory for Individual, Non-individual, and eBG flows.
neslData.documentDetail.dateOfSanctionConditionalLoan sanction date as per lender CBS. Mandatory for Individual and Non-individual loans.
neslData.documentDetail.typeOfDebtConditionalType of loan: FINANCIAL or OPERATIONAL. Mandatory for Individual, Non-individual, and eBG.
neslData.documentDetail.accountClosedFlagConditionalAccount status: YES, NO, or ASSIGNED. Mandatory for Individual, Non-individual, and eBG.
neslData.documentDetail.fundTypeConditionalCredit facility type: FUNDED or NON_FUNDED. Mandatory for Individual, Non-individual, and eBG.
neslData.documentDetail.sanctionCurrencyConditionalLoan currency. Accepted value: INR. Mandatory for Individual, Non-individual, and eBG.
neslData.documentDetail.docRefNoYes (Non-Lending)Alphanumeric document reference number. Mandatory for Non-lending flows.
neslData.documentDetail.expiryDateEbgYes (eBG)eBG expiry date in YYYY-MM-DD format.
neslData.documentDetail.claimExpiryDateYes (eBG)eBG claim expiry date in YYYY-MM-DD format.
neslData.stampData[].firstPartyYes (if stampData used)Name of the first party on the stamp paper (max 40 alphanumeric characters)
neslData.stampData[].secondPartyYes (if stampData used)Name of the second party on the stamp paper (max 40 alphanumeric characters)
neslData.stampData[].stampDutyAmountYes (if stampData used)Stamp duty amount (auto-calculated in WB, MH, MP, KL, TS if considerationPrice differs)
neslData.stampData[].considerationPriceYes (if stampData used)Consideration price for stamp duty calculation. Whole numbers or .00 decimals (e.g., 500, 500.00)
neslData.stampData[].descriptionOfDocumentYes (if stampData used)Description of the document for stamp duty purposes
neslData.stampData[].stampDutyPaidByYes (if stampData used)Name of the party paying stamp duty (first or second party name expected)
neslData.stampData[].articleCodeYes (if stampData used)Stamp duty article code. Refer to the NeSL article code list.
neslData.participants[].fullNameYes (if participants used)Full name of the NeSL signing party (max 100 alphanumeric characters)
neslData.participants[].contactRelationYes (if participants used)Party's relation to the debt: CREDITOR, DEBTOR, GUARANTOR, CO_OBLIGANT, SECURITY_PROVIDER, ASSIGNEE, BENEFICIARY
neslData.participants[].legalConstitutionYes (if participants used)Legal constitution of the signer (e.g., RESIDENT_INDIVIDUAL, PRIVATE_LTD, LLP, TRUST, etc.)
neslData.participants[].officialDocTypeYes (if participants used)Official document type: PAN_CARD, DRIVING_LICENSE, VOTER_ID, PASSPORT, ANY_OTHER_OFFICIAL_ID
neslData.neslSecurities[].securityDescriptionYes (if securities used)Description of the security asset
neslData.neslSecurities[].assetsTypeYes (if securities used)Asset type: MOVABLE, IMMOVABLE, INTANGIBLE, NOT_CLASSIFIED
neslData.neslSecurities[].chargeTypeYes (if securities used)Charge type: MORTGAGE, HYPOTHECATION, CHARGE, ASSIGNMENT, PLEDGE, LIEN, NEGATIVE_LIEN, GUARANTEE, OTHERS, NOT_CLASSIFIED

Sample request skeleton for eStamp with NeSL:

{
  "ts": "2025-05-01T10:00:00Z",
  "txncode": "TXN123456789",
  "ver": "1.0",
  "hmac": "<SHA-256 hash of data value>",
  "data": {
    "profileId": "<workflow-profile-id>",
    "file": {
      "name": "LoanAgreement.pdf",
      "file": "<base64-encoded-pdf>"
    },
    "neslData": {
      "documentDetail": {
        "loanNumber": "LN12345",
        "registrationType": "INDIVIDUAL_LOAN",
        "state": "Karnataka",
        "sanctionAmount": "500000",
        "typeOfDebt": "FINANCIAL",
        "accountClosedFlag": "NO",
        "fundType": "FUNDED",
        "sanctionCurrency": "INR"
      },
      "stampData": [
        {
          "firstParty": "Borrower Name",
          "secondParty": "Bank Name",
          "stampDutyAmount": "500",
          "considerationPrice": "500000",
          "descriptionOfDocument": "Loan Agreement",
          "stampDutyPaidBy": "Borrower Name",
          "articleCode": "<nesl-article-code>"
        }
      ]
    },
    "invitees": [
      {
        "name": "Borrower Name",
        "email": "borrower@example.com",
        "phone": "9876543210"
      }
    ],
    "irn": "LENDER-REF-001"
  }
}

Response fields

ParameterDescription
tsDate and time of the response
txncodeUnique transaction code echoed from the request
verAPI version
errcodeE000 on success; a specific error code on failure
statussuccess or fail
infoEmpty string on success; error message on failure
hmacHMAC generated by the platform on the response data
publickeyPublic key shared by the lender
sig-algoAlgorithm used for signing the response (e.g., SHA256withECDSA)
signaturePlatform-generated signature on the response data
data.documentIdUnique Leegality Document ID for this transaction. Use this in the Get Details API and callback matching.
data.irnInternal Reference Number as passed in the request
data.invitees[].nameName of the invitee
data.invitees[].emailEmail of the invitee
data.invitees[].phonePhone number of the invitee
data.invitees[].signUrlStamping/Signing URL for this invitee
data.invitees[].activeInvitation status of the invitee
data.invitees[].expiryDateExpiry date of this invitee's link
data.messages[].codeResponse code from Leegality
data.messages[].messageResponse message from Leegality

Retrieving the stamped document: Use the Get Details API (POST /leegality/detail/1.0/en) with the documentId returned in the eStamp response. Pass "refreshNeslDocument": true in the request body to fetch the latest stamped document from NeSL. The stamped file will be available at data.file in the response once stamping is complete.

Note: If a document is stamped but not yet signed, NeSL may not return the stamped file by default. Contact Leegality to enable stamped document retrieval for your account.

Callback (Webhook): After each event, Leegality sends a POST to the lender's registered callback URL. The lender's endpoint must return HTTP 200. If not received, Leegality retries 3 times.

Error codes

Error CodeDescription
E000Success — no error
E099Invalid lender JWT token
ELG001Invalid or incorrect x-sp-auth-token
E043Provider-specific dynamic error — see the error message for details (e.g., stamp procurement failure, NeSL validation errors)
ELG004Missing or empty documentId

For a comprehensive list of platform-level error codes, refer to the Latest Platform Error Code document.

Who to contact?

If you encounter an issue with the eStamp API, email support@rbihub.in with the following details:

  • Subject: Leegality eStamp API Error
  • Service Name: esign-estamp
  • Environment: Sandbox or Production
  • Service Provider: Leegality
  • Request Headers
  • Request Payload
  • Error Code and Error Message
  • Screenshot or log of the error
  • Prerequisites status: IP Whitelisting, URL Whitelisting, Service Subscription, Token Generation, Stamp Procurement

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article