API Documentation

The IndiTrace app runs on a JSON REST API. Anyone can verify a batch from its QR code; signed-in members use the same endpoints the app does.

Public trace lookups

Every QR code resolves to a batch UID. The trace endpoint returns what the public trace page shows, including the batch's recorded quantity — never private documents or contact details.

GET /api/v1/batches/public/trace/<batch_uid>/

{
  "batch_uid": "B68286692756350",
  "product_name": "Makhana",
  "farmer_name": "Sita D.",
  "farm_locations": [ … ],
  "timeline": [ … ],
  "blockchain_proof": {
    "tx_hash": "0x…",
    "explorer_url": "https://polygonscan.com/tx/0x…",
    "status": "anchored",
    "anchored_at": "2026-09-14T08:12:00Z"
  },
  "blockchain_network": { "name": "Polygon PoS", "testnet": false }
}

Session authentication

Sign in to receive a 15-minute access token and a 14-day refresh token. Refresh tokens rotate on every use, signing out revokes both, and changing the password revokes all of them. Accounts with two-factor authentication confirm an emailed code first.

POST /api/v1/auth/login/
{"email": "you@example.com", "password": "…"}

→ {"access": "<15-minute token>", "refresh": "<14-day token>", "user": {…}}

GET /api/v1/batches/
Authorization: Bearer <access token>

Integrations

There are no self-serve API keys yet. For server-to-server access, webhooks or higher limits, tell us what you want to connect and we will set it up with you.

Talk to us about an integration