Navchetna Developer Hub

Build with Independence

The Navchetna Platform provides a unified suite of Made in India tools for Identity Data Extraction and Financial Ledger management. Our stack is designed for zero dependency high security and absolute data sovereignty.

Base Configuration

All API requests are served over HTTPS. Unencrypted HTTP is not supported.

  • Production: https://api.navchetna.tech/v1
  • Sandbox: https://sandbox.navchetna.tech/v1
Product

Aegis Auth

Secure Memory Safe Unified

Aegis Auth is a comprehensive identity platform built in Rust. It provides a single source of truth for user identity across web mobile and backend services.

1 Installation

Choose your environment to install the official Aegis SDK.

JavaScript TypeScript Client Side

npm i aegis-auth-navchetna

Rust Backend High Performance

cargo add aegis-auth-navchetna

Python Backend Data Science

pip install aegis-auth-navchetna

Flutter Mobile

dependencies:
  aegis_auth: ^1.0.0

2 Quickstart Client Side JavaScript

Initialize the Aegis client in your frontend application to handle user login and session management.

import { AegisClient } from 'aegis-auth-navchetna';

// 1 Initialize the client
const aegis = new AegisClient({
  apiKey: 'YOUR_PUBLIC_API_KEY',
  environment: 'production'
});

// 2 Authenticate a User
async function loginUser() {
  try {
    const session = await aegis.login({
      email: 'user@example.com',
      password: 'user_password'
    });

    console.log('User Logged In:', session.user.id);
    console.log('Aegis Token:', session.token); // Send this to your backend
  } catch (error) {
    console.error('Login Failed:', error.message);
  }
}

3 Quickstart Server Side Verification Rust

Never trust the client. Verify the aegis_token on your backend using our memory safe Rust crate.

use aegis_auth_navchetna::{AegisVerifier, Token};

#[tokio::main]
async fn main() {
    // 1 Initialize the Verifier
    let verifier = AegisVerifier::new("YOUR_SECRET_KEY");

    // 2 Verify an incoming token
    let token_string = "eyJhbGciOiJFZDI1NTE5I..."; 
    
    match verifier.verify(token_string).await {
        Ok(claims) => {
            println!("Valid User: {}", claims.user_id);
            println!("Permissions: {:?}", claims.roles);
        },
        Err(e) => println!("Invalid Token: {}", e),
    }
}
Product

LMLense

Context Aware Data Extraction

LMLense allows you to transform unstructured documents into structured JSON data. It uses our proprietary NineLLMs architecture to understand layout and context eliminating the need for rigid templates.

1 API Endpoint

Endpoint: POST /v1/lmlense/extract

Content-Type: multipart/form-data

Parameter Type Required Description
file Binary Yes The document or image file PDF JPG PNG TIFF. Max 25MB.
mode String No Extraction mode. Default auto. Options invoice receipt id_card table.
webhook_url String No URL to receive the result for large files Async processing.

2 Integration Examples

Node.js Axios

Upload a local file to the extraction engine.

const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');

const form = new FormData();
form.append('file', fs.createReadStream('./invoice_scan.pdf'));
form.append('mode', 'invoice');

async function extractData() {
  try {
    const response = await axios.post('https://api.navchetna.tech/v1/lmlense/extract', form, {
      headers: {
        ...form.getHeaders(),
        'Authorization': 'Bearer YOUR_AEGIS_TOKEN' // Secured by Aegis Auth
      }
    });

    console.log('Extraction Result:', response.data);
  } catch (error) {
    console.error('Error:', error.response.data);
  }
}

extractData();

3 Sample Response

LMLense returns a structured JSON object with confidence scores.

{
  "status": "success",
  "document_id": "doc_8823n29",
  "confidence": 0.98,
  "data": {
    "type": "invoice",
    "invoice_number": "INV-2026-001",
    "date": "2026-01-12",
    "vendor": {
      "name": "AWS India",
      "address": "Delhi, India"
    },
    "total": 4500.00,
    "currency": "INR"
  }
}
Product

NSL Navchetna Smart Ledger

Programmable Financial Infrastructure

The NSL API allows developers to programmatically record usage track credits and trigger invoicing logic. It serves as the immutable backend for your financial operations.

1 Core Concepts

  • Ledger: The immutable record of all transactions.
  • Meter: A usage tracker like API calls or storage used that accumulates over a billing period.
  • Invoice: The generated financial document at the end of a cycle.

2 Record Transaction API

Use this endpoint to record a billable event or a credit adjustment.

Endpoint: POST /v1/nsl/transaction

Request Body

{
  "user_id": "usr_5521a",
  "type": "DEBIT", 
  "amount": 299.00,
  "currency": "INR",
  "category": "subscription_renewal",
  "description": "Monthly Pro Plan January 2026",
  "metadata": {
    "plan_id": "plan_pro_v1"
  }
}

3 Webhook Events

NSL pushes events to your system when financial states change.

Event Name Trigger Payload includes
invoice.generated Month end billing cycle completes. Invoice PDF URL Total Amount
invoice.paid User payment is confirmed. Payment method Transaction ID
ledger.threshold User balance exceeds a set limit. Current Balance User ID
Support

Troubleshooting Guide

Errors are part of the development process. When the API returns an error we provide a standard HTTP status code and a JSON error object to help you identify the issue immediately.

Standard Error Response Format

{
  "status": "error",
  "code": "auth_token_expired",
  "message": "The Aegis token provided has expired. Please refresh the session.",
  "request_id": "req_8829910a-f9c2"
}

1 Authentication Errors 401 and 403

These errors are related to Aegis Auth. They occur when the identity of the requester cannot be verified or lacks permission.

Status Code Error Code Meaning Recommended Action
401 Unauthorized missing_token No Authorization header found. Ensure you send Authorization: Bearer <token> in your headers.
401 Unauthorized token_invalid The token is malformed or forged. The token signature verification failed. Re authenticate the user to get a new valid token.
403 Forbidden insufficient_scope Valid user but wrong permissions. The user tried to access a resource that their Role RBAC does not allow. Check the user role in the Aegis dashboard.

2 Request and Validation Errors 400 and 422

These errors happen when the data sent to LMLense or NSL is incorrect or unprocessable by our engines.

Status Code Error Code Meaning Recommended Action
400 Bad Request invalid_json Malformed JSON body. Check your request syntax. Ensure all braces {} and quotes "" are closed properly.
413 Payload Too Large file_too_large File exceeds the size limit. LMLense The file upload limit is 25MB. Compress the PDF or image before uploading.
415 Unsupported Media invalid_file_type File format not supported. LMLense Ensure the file is a PDF JPG PNG or TIFF. ZIP files are not supported.
422 Unprocessable extraction_failed AI could not read the document. LMLense The image might be too blurry corrupted or password protected. Retry with a clearer scan.

3 Server and System Errors 500 Plus

These indicate an issue on the Navchetna side.

Status Code Error Code Meaning Recommended Action
429 Too Many Requests rate_limit_exceeded You are sending too many requests. Slow down. Implement exponential backoff in your code. Check your plan limits.
500 Internal Error internal_server_error Something went wrong on our end. Do not retry immediately. Check the Status Page or contact support with the request_id.

Need Help

If you are stuck on an error not listed here please include the request_id in your support ticket. This ID allows our engineering team to trace the exact call in our logs.

  • Email Support: dev-support@navchetna.tech
  • System Status: status.navchetna.tech