API Documentation

REST API for TillageConnect — integrate tractor marketplace features into your own applications.

Base URL

https://tillageconnect.bkafrica.co.zw/api/v1

Authentication

Login to receive a token. Include it in the Authorization header as Token <your_token> for protected endpoints.

Authentication

POST/auth/login/
Login with phone & password. Returns token and user data.
Body: { "phone": "+263771234567", "password": "Tillage2024" }
{
  "success": true,
  "data": {
    "token": "abc123...",
    "user": { "id": 1, "username": "john_moyo", "phone": "+263771234567", "user_type": "farmer" }
  }
}
POST/auth/register/
Register a new user (farmer, tractor_owner, or trader).
Body: { "username", "phone", "password", "user_type", "email", "location" }

Tractors

GET/tractors/
List all active tractors. Supports filters: ?tractor_type=, &status=, &city=, &search=
GET/tractors/{id}/
Get details of a specific tractor.
POST/tractors/
Create a new tractor listing (tractor owners only, auth required).
Body: { "name", "make", "model", "horsepower", "hourly_rate", "daily_rate", "location", "latitude", "longitude", "implements" }

Tillage Jobs

GET/tillage/
List all tillage jobs. Supports ?status=, &tillage_type=
POST/tillage/
Create a tillage job (farmers only, auth required).
Body: { "tillage_type", "field_size", "location", "latitude", "longitude", "notes" }
PUT/tillage/{id}/status/
Update job status (pending → assigned → in_progress → completed).

Marketplace

GET/marketplace/
List all equipment listings. Supports ?listing_type=sale|rent, &category=
POST/marketplace/
Create a marketplace listing (auth required).
Body: { "title", "description", "price", "listing_type", "category", "location" }

Messaging

GET/messages/
List conversations (auth required).
POST/messages/
Send a message (auth required).

Notifications

GET/notifications/
List user notifications (auth required).
View API Root