Integrate with api.niyantha.in and build on the open logistics backend.
Niyantha is a platform: session APIs, S2S APIs, and realtime messaging designed to help builders launch startups on top of Bharat's physical-economy infrastructure.
Platform Defaults
HTTP base: https://api.niyantha.in
Realtime base: wss://api.niyantha.in/ws
Stable, production-ready contracts for builders.
Auto-deployed platform updates without downtime.
Public Access
Start with unauthenticated platform entry points and public-facing workflows.
GET /api/v1/accounts/apps/settings
Global backend at api.niyantha.in
Account Session APIs
Authenticate an account, issue keys, and manage operational data across the platform.
Identity, keys, wallet, locations, stores, files
Orders, shipments, drivers, AI characters
Designed for secure browser and server use
S2S + WebSocket
Use API-key based REST and realtime messaging to build startups on top of Niyantha.
REST base: /api/v1/s2s/accounts
Realtime gateway: /ws
Production-ready APIs for building on top of Niyantha
Quickstart
Sample payloads for real platform flows
Use these as the baseline for production integrations on top of Niyantha's public, session, and realtime surfaces.
Account Login
Returns a bearer token for session APIs
curl -X POST https://api.niyantha.in/api/v1/accounts/login \
-H "Content-Type: application/json" \
-d '{
"username": "account@example.com",
"password": "StrongPassword@123"
}'S2S WebSocket Auth
Use on wss://api.niyantha.in/ws
{
"type": "auth.login",
"requestId": "s2s-auth-1",
"payload": {
"authType": "s2s",
"token": "<public_key>",
"metadata": {
"secret": "<secret>",
"app": "anystore",
"storeId": "12"
}
}
}Domain Guides
Deep payload coverage by business domain
Use these dedicated pages when you need exact request bodies, response samples, and route groupings for production integrations.
Reference
Stores
Store creation, settings, and store-product payloads for account and S2S apps.
Open guide
Reference
Orders
Order listing, detail, acceptance, decline, and settlement flows.
Open guide
Reference
Shipments
Network creation, shipment creation, filtering, and deep shipment detail models.
Open guide
Reference
Drivers
Driver profile, license updates, location updates, and shipment assignment lifecycle.
Open guide
Public + Bootstrap APIs
These routes are the public entry layer and account bootstrap layer for apps integrating with Niyantha.
Public APIs
/api/v1/accounts/apps/settingsFetch account app settings bootstrap payload.
App Settings Bootstrap
{
"apps": ["BermerStoresApp", "BermerRidersApp"],
"locale": "en-IN"
}Account Bootstrap
/api/v1/accounts/afasCreate account OTP/AFA for register, login, or forgot password.
/api/v1/accountsCreate an account.
/api/v1/accounts/loginLog in with password or OTP/AFA.
/api/v1/accounts/is_existsCheck if an account already exists.
/api/v1/accounts/verify_forgot_password_afaVerify forgot-password OTP and set a new password.
Account OTP Request
{
"type": "otp",
"purpose": "account_register",
"email": "founder@startup.in",
"sender": "niyantha"
}Account Session APIs
After account login, use these authenticated routes to run your application on top of Niyantha.
Identity + Keys + Wallet
/api/v1/sessionGet current account profile.
/api/v1/session/logoutEnd the current account session.
/api/v1/session/updateUpdate account profile data.
/api/v1/session/update_passwordUpdate account password.
/api/v1/session/initiate_contact_updateStart contact change flow.
/api/v1/session/update_contactComplete contact change flow.
/api/v1/session/initiate_email_updateStart email change flow.
/api/v1/session/update_emailComplete email change flow.
/api/v1/session/keysCreate an S2S API key pair.
/api/v1/session/keysList issued API keys.
/api/v1/session/keys/:id/expireExpire an API key immediately.
/api/v1/session/walletGet account wallet.
/api/v1/session/walletCreate account wallet.
Create API Key
{
"name": "production-primary",
"ttl_seconds": 86400
}Apps + Networks + Files
/api/v1/session/appsCreate an account app.
/api/v1/session/appsList account apps.
/api/v1/session/apps/logoUpload account app logo.
/api/v1/session/apps/:idGet an account app.
/api/v1/session/apps/:idUpdate an account app.
/api/v1/session/networksCreate a network.
/api/v1/session/networksList networks.
/api/v1/session/networks/:idGet a network.
/api/v1/session/filesCreate/upload a file.
/api/v1/session/files/:idGet a file.
Create Account App
{
"name": "Niyantha Dispatch OS",
"description": "Control panel for dispatch, fleet operations, and account orchestration",
"primary_color": "#f59e0b"
}Locations + Stores + Base Products
/api/v1/session/locations/estimateEstimate travel distance and time.
/api/v1/session/locations/address/coordinatesGeocode an address.
/api/v1/session/locations/coordinates/addressReverse geocode coordinates.
/api/v1/session/locationsCreate a location.
/api/v1/session/locationsList locations.
/api/v1/session/locations/:idGet a location.
/api/v1/session/locations/:idUpdate a location.
/api/v1/session/base-productsList base products.
/api/v1/session/storesCreate a store.
/api/v1/session/storesList account stores.
/api/v1/session/stores/:idGet a store.
/api/v1/session/stores/:id/settingsGet store settings.
/api/v1/session/stores/:idUpdate a store.
/api/v1/session/stores/:id/productsCreate a store product.
/api/v1/session/stores/:id/productsList store products.
/api/v1/session/stores/:id/products/:product_idGet a store product.
/api/v1/session/stores/:id/products/:product_idUpdate a store product.
/api/v1/session/stores/:id/products/:product_idDelete a store product.
Create Store
{
"type": "grocery",
"name": "Fresh Mart Hub",
"description": "Neighborhood store connected to Niyantha logistics",
"location_id": 101,
"owner_aadhaar_front_file_id": 12,
"owner_aadhaar_back_file_id": 13,
"shop_body_type": "stationary_shop"
}Orders + Shipments + Drivers + AI Characters
/api/v1/session/ordersList account orders.
/api/v1/session/orders/:idGet an account order.
/api/v1/session/orders/:id/acceptAccept an order.
/api/v1/session/orders/:id/declineDecline an order.
/api/v1/session/orders/:id/mark-paid-and-deliveredMark an order paid and delivered.
/api/v1/session/stores/:store_id/ordersList store-scoped orders.
/api/v1/session/shipmentsCreate a shipment.
/api/v1/session/shipmentsList shipments.
/api/v1/session/shipments/:idGet a shipment.
/api/v1/session/driversGet driver profile.
/api/v1/session/drivers/update-licensesUpdate driver licenses.
/api/v1/session/drivers/locationUpdate driver location.
/api/v1/session/drivers/shipmentsList assigned shipments.
/api/v1/session/drivers/shipments/:id/acceptAccept assigned shipment.
/api/v1/session/drivers/shipments/:id/rejectReject assigned shipment.
/api/v1/session/drivers/shipments/:id/completeComplete assigned shipment.
/api/v1/session/stores/:store_id/charactersList store AI characters.
/api/v1/session/stores/:store_id/charactersCreate store AI character.
/api/v1/session/characters/:character_idPatch AI character.
/api/v1/session/charactersList account-owned AI characters.
Create Shipment
{
"from_location_id": 101,
"to_location_id": 205,
"vehicle_type": "truck",
"load_weight": 1250,
"notes": "Handle with care"
}S2S REST + Realtime
The same operational primitives are exposed for API-key based server integrations and realtime applications.
S2S REST Base
/api/v1/s2s/accountsGet account profile with S2S key auth.
/api/v1/s2s/accounts/updateUpdate account profile.
/api/v1/s2s/accounts/update_passwordUpdate password.
/api/v1/s2s/accounts/initiate_contact_updateStart contact update flow.
/api/v1/s2s/accounts/update_contactComplete contact update flow.
/api/v1/s2s/accounts/initiate_email_updateStart email update flow.
/api/v1/s2s/accounts/update_emailComplete email update flow.
/api/v1/s2s/accounts/walletGet wallet.
/api/v1/s2s/accounts/walletCreate wallet.
/api/v1/s2s/accounts/afasCreate AFA/OTP flow for parity scenarios.
Header-Based S2S Auth
X-API-Key: <public_key>
X-API-Secret: <secret>S2S Operational Domains
/api/v1/s2s/accounts/appsList apps.
/api/v1/s2s/accounts/appsCreate app.
/api/v1/s2s/accounts/networksCreate network.
/api/v1/s2s/accounts/filesUpload file.
/api/v1/s2s/accounts/locationsCreate location.
/api/v1/s2s/accounts/storesCreate store.
/api/v1/s2s/accounts/stores/:id/productsCreate store product.
/api/v1/s2s/accounts/productsCreate catalog product.
/api/v1/s2s/accounts/shipmentsCreate shipment.
/api/v1/s2s/accounts/ordersList account orders.
/api/v1/s2s/accounts/drivers/shipmentsList assigned driver shipments.
/api/v1/s2s/accounts/charactersList account AI characters.
/api/v1/s2s/accounts/base-productsList base products.
Create Store Product
{
"store_item_id": 501,
"name": "Tomato Crate",
"type": "vegetable",
"unit": "kg",
"price_per_unit": 24,
"min_order_unit": 1,
"max_order_unit": 100,
"stock_type": "limited",
"stock": 400
}Realtime Gateway
/wsAuthenticate with auth.login and then use account, store, product, order, location, file, network, vehicle, shipment, AI, and review message types.
Realtime Auth Envelope
{
"type": "auth.login",
"requestId": "account-live-1",
"payload": {
"authType": "s2s",
"token": "<public_key>",
"metadata": {
"secret": "<secret>",
"app": "niyantha",
"storeId": "12"
}
}
}Build on Niyantha APIs.
Start with public and session APIs, graduate to S2S and realtime. The platform runs at api.niyantha.in with production-ready contracts for startups and enterprise teams.