Drivers Domain

Drivers API

Driver profile, document, location, and assigned-shipment operations for account and S2S integrations.

Base Path

https://api.niyantha.in/api/v1/session

Authentication

Authorization: Bearer <token>

The driver routes let an account-facing app keep driver identity and licenses updated, track availability and location, and let assigned drivers accept, reject, or complete shipments. The same contracts are available via /api/v1/s2s/accounts/drivers.

GET/drivers

Get the current driver profile bound to the authenticated account context.

Bearer Token
Sample Response
{
  "id": 44,
  "name": "Raghav",
  "email": "driver@fleet.in",
  "contact": "+919999999999",
  "afa_verified": true,
  "aadhaar_verified": true,
  "is_online": true,
  "current_latitude": 12.9716,
  "current_longitude": 77.5946
}
POST/drivers/update-licenses

Upload and update Aadhaar, selfie, and driving license references.

Bearer Token
Sample Request
{
  "aadhaar_file_id": 11,
  "selfie_file_id": 12,
  "two_wheeler_license_file_id": 13,
  "two_wheeler_license_number": "KA-22-2025-00012",
  "heavy_license_file_id": 14,
  "heavy_license_number": "DL-TRANS-99881"
}
Sample Response
{
  "success": true,
  "message": "Driver documents updated"
}
POST/drivers/location

Update current driver location and online presence.

Bearer Token

Request Fields

FieldTypeRequiredDescription
latitudefloatNoCurrent latitude.
longitudefloatNoCurrent longitude.
onlineboolNoLegacy online flag.
is_onlineboolNoPreferred online flag.
Sample Request
{
  "latitude": 12.9716,
  "longitude": 77.5946,
  "is_online": true
}
Sample Response
{
  "id": 44,
  "current_latitude": 12.9716,
  "current_longitude": 77.5946,
  "is_online": true
}
GET/drivers/shipments

Fetch shipments assigned to the current driver.

Bearer Token
Sample Response
{
  "items": [
    {
      "id": 9001,
      "status": "assigned",
      "pickup_location_id": 66,
      "drop_location_id": 77,
      "estimated_cost": 120
    }
  ]
}
POST/drivers/shipments/:id/accept

Accept an assigned shipment.

Bearer Token
Sample Response
{
  "id": 9001,
  "status": "accepted"
}
POST/drivers/shipments/:id/reject

Reject an assigned shipment and trigger re-allocation.

Bearer Token
Sample Response
{
  "id": 9001,
  "status": "failed"
}
PUT/drivers/shipments/:id/complete

Mark an assigned shipment as completed.

Bearer Token
Sample Response
{
  "id": 9001,
  "status": "completed"
}

Notes

1

Driver routes are shipment-oriented in the current backend, not order-oriented. The docs have been aligned to the actual /drivers/shipments route family.

2

For backend-to-backend apps, switch the same paths to /api/v1/s2s/accounts/drivers and authenticate with X-API-Key and X-API-Secret.