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-Tokenfrom 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
profileIdof 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
| Environment | URL |
|---|---|
| Sandbox | https://extgw.nonprod.rbihub.io/leegality/esign-estamp/1.0/en |
| Production | https://extgw.api.rbihub.io/leegality/esign-estamp/1.0/en |
HTTP Method: POST
URL path convention: /{service name}/{ver}/{lang}
| URL Parameter | Value | Description |
|---|---|---|
service name | leegality/esign-estamp | Unique name of the service |
ver | 1.0 | Current API version |
lang | en | Language for the response (default: English) |
Headers
| Header | Description | Remarks |
|---|---|---|
Authentication | JWT token generated by the ULI authentication server. Refer to the Authentication and Authorization API specification. | Mandatory |
client-id | Base64-encoded value of the Client ID provided in the JWT token. | Mandatory |
provider | Service provider code. Value: 130 for Leegality. | Mandatory |
x-lender-auth-token | Lender's JWT token for data authentication. | Mandatory |
x-sp-auth-token | Leegality's X-Auth-Token from the Leegality Dashboard. | Mandatory |
x-env-route | Required to route requests to the sandbox environment. Value: /sb | Mandatory for Sandbox only; omit for Production |
api-key | 24-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:
| Parameter | Description |
|---|---|
ts | Date and time of request initiation in ISO-8601 format: yyyy-MM-ddTHH:mm:ssZ |
txncode | Unique transaction code for this request |
ver | Version of the request template currently in use |
hmac | SHA-256 hash of the value of the data key |
data | Object containing the eStamp request payload (see key fields below) |
Key stamp-specific fields within the data object:
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
profileId | Yes | string | ID of the published Workflow from the Leegality Dashboard |
file.file | Yes | string | Base64-encoded PDF file (max 15 MB before encoding) |
stampSeries | No | string | Stamp series value from the dashboard when stamp choice is enabled |
multipleStampSeries[].stampSeries | No | string | Series number of the stamp series to use |
multipleStampSeries[].seriesQuantity | No | string | Number of stamps to affix (1–99) |
seriesGroup | No | string | Stamp group value from the dashboard |
stampValue | No | string | Stamp amount value when stamp group is enabled |
stampUpload.state | Yes (if stampUpload used) | string | Name of the state where the stamp paper is issued |
stampUpload.denomination | Yes (if stampUpload used) | string | Denomination of the uploaded stamp paper |
stampUpload.firstPartyName | Yes (if stampUpload used) | string | First party name on the stamp paper |
stampUpload.secondPartyName | Yes (if stampUpload used) | string | Second party name on the stamp paper |
stampUpload.stampSerial | Yes (if stampUpload used) | string | Serial number of the uploaded stamp paper |
stampUpload.stampFile | Yes (if stampUpload used) | string | Base64-encoded file of the uploaded stamp paper |
revenueStampSeries | No | string | Revenue stamp series from the dashboard if enabled |
revenueStampQuantity | No | string | Quantity of revenue stamps (default: 1) |
Key NeSL-specific fields within the data.neslData object (required for NeSL-compliant stamping):
| Parameter | Mandatory | Description |
|---|---|---|
neslData.documentDetail.loanNumber | Conditional | Loan number. Either loan number or sanction number is required for lending flows; loan number is mandatory for eBG. |
neslData.documentDetail.sanctionNumber | Conditional | Sanction number. Either loan number or sanction number is required for lending. |
neslData.documentDetail.registrationType | Yes | Type of debt: INDIVIDUAL_LOAN, NON_INDIVIDUAL_LOAN, non_lending, EBG |
neslData.documentDetail.state | Yes | State where stamp duty is paid |
neslData.documentDetail.sanctionAmount | Conditional | Sanctioned amount. Mandatory for Individual, Non-individual, and eBG flows. |
neslData.documentDetail.dateOfSanction | Conditional | Loan sanction date as per lender CBS. Mandatory for Individual and Non-individual loans. |
neslData.documentDetail.typeOfDebt | Conditional | Type of loan: FINANCIAL or OPERATIONAL. Mandatory for Individual, Non-individual, and eBG. |
neslData.documentDetail.accountClosedFlag | Conditional | Account status: YES, NO, or ASSIGNED. Mandatory for Individual, Non-individual, and eBG. |
neslData.documentDetail.fundType | Conditional | Credit facility type: FUNDED or NON_FUNDED. Mandatory for Individual, Non-individual, and eBG. |
neslData.documentDetail.sanctionCurrency | Conditional | Loan currency. Accepted value: INR. Mandatory for Individual, Non-individual, and eBG. |
neslData.documentDetail.docRefNo | Yes (Non-Lending) | Alphanumeric document reference number. Mandatory for Non-lending flows. |
neslData.documentDetail.expiryDateEbg | Yes (eBG) | eBG expiry date in YYYY-MM-DD format. |
neslData.documentDetail.claimExpiryDate | Yes (eBG) | eBG claim expiry date in YYYY-MM-DD format. |
neslData.stampData[].firstParty | Yes (if stampData used) | Name of the first party on the stamp paper (max 40 alphanumeric characters) |
neslData.stampData[].secondParty | Yes (if stampData used) | Name of the second party on the stamp paper (max 40 alphanumeric characters) |
neslData.stampData[].stampDutyAmount | Yes (if stampData used) | Stamp duty amount (auto-calculated in WB, MH, MP, KL, TS if considerationPrice differs) |
neslData.stampData[].considerationPrice | Yes (if stampData used) | Consideration price for stamp duty calculation. Whole numbers or .00 decimals (e.g., 500, 500.00) |
neslData.stampData[].descriptionOfDocument | Yes (if stampData used) | Description of the document for stamp duty purposes |
neslData.stampData[].stampDutyPaidBy | Yes (if stampData used) | Name of the party paying stamp duty (first or second party name expected) |
neslData.stampData[].articleCode | Yes (if stampData used) | Stamp duty article code. Refer to the NeSL article code list. |
neslData.participants[].fullName | Yes (if participants used) | Full name of the NeSL signing party (max 100 alphanumeric characters) |
neslData.participants[].contactRelation | Yes (if participants used) | Party's relation to the debt: CREDITOR, DEBTOR, GUARANTOR, CO_OBLIGANT, SECURITY_PROVIDER, ASSIGNEE, BENEFICIARY |
neslData.participants[].legalConstitution | Yes (if participants used) | Legal constitution of the signer (e.g., RESIDENT_INDIVIDUAL, PRIVATE_LTD, LLP, TRUST, etc.) |
neslData.participants[].officialDocType | Yes (if participants used) | Official document type: PAN_CARD, DRIVING_LICENSE, VOTER_ID, PASSPORT, ANY_OTHER_OFFICIAL_ID |
neslData.neslSecurities[].securityDescription | Yes (if securities used) | Description of the security asset |
neslData.neslSecurities[].assetsType | Yes (if securities used) | Asset type: MOVABLE, IMMOVABLE, INTANGIBLE, NOT_CLASSIFIED |
neslData.neslSecurities[].chargeType | Yes (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
| Parameter | Description |
|---|---|
ts | Date and time of the response |
txncode | Unique transaction code echoed from the request |
ver | API version |
errcode | E000 on success; a specific error code on failure |
status | success or fail |
info | Empty string on success; error message on failure |
hmac | HMAC generated by the platform on the response data |
publickey | Public key shared by the lender |
sig-algo | Algorithm used for signing the response (e.g., SHA256withECDSA) |
signature | Platform-generated signature on the response data |
data.documentId | Unique Leegality Document ID for this transaction. Use this in the Get Details API and callback matching. |
data.irn | Internal Reference Number as passed in the request |
data.invitees[].name | Name of the invitee |
data.invitees[].email | Email of the invitee |
data.invitees[].phone | Phone number of the invitee |
data.invitees[].signUrl | Stamping/Signing URL for this invitee |
data.invitees[].active | Invitation status of the invitee |
data.invitees[].expiryDate | Expiry date of this invitee's link |
data.messages[].code | Response code from Leegality |
data.messages[].message | Response 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 Code | Description |
|---|---|
E000 | Success — no error |
E099 | Invalid lender JWT token |
ELG001 | Invalid or incorrect x-sp-auth-token |
E043 | Provider-specific dynamic error — see the error message for details (e.g., stamp procurement failure, NeSL validation errors) |
ELG004 | Missing 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
Feedback sent
We appreciate your effort and will try to fix the article