v1.0 · REST API

LVMS API Documentation

Complete reference guide for the Logistics & Vehicle Management System. This document covers every API endpoint — written for both technical developers and non-technical business stakeholders.

FormatREST / JSON
AuthBearer Token
VersionAPI v1
SystemLVMS — Lyansh Motors & Logistics

📖 What is this document?

This is the complete API documentation for the LVMS (Logistics & Vehicle Management System). An API is like a messenger — it lets the mobile app, web dashboard, or any other software talk to the system's database and logic. Every action in the system (adding a driver, creating a booking, generating a report) goes through one of these API endpoints described below.

For clients/business owners: This document helps you understand what the system can and cannot do, and what information needs to be provided for each action.

🔐
Auth & Roles
Login · Roles · Permissions · Profile
👤
Users
Create · Update · Delete · List
🚛
Drivers
Register · License · Advances
🏭
Customers
Pickup & Dropoff businesses
🚗
Vehicles
Fleet · Documents · Statistics
📦
Bookings & Trips
Full trip lifecycle management
Fuel
Stations · History · Payments
🔧
Maintenance
Service · Parts · Upcoming
💰
Advances
Salary advances & repayments
🏆
Rewards
Campaigns · Leaderboards
📊
Reports
13 report types · Excel & PDF
📍
GPS Tracking
Live location · Fuel · Odometer
🌐

Base URL & Setup

How to connect to the API

Base URL

All API requests are made to the following base URL. Replace {{baseUrl}} in all endpoints with this value:

http://<your-server-ip>:8000/api/v1
⚠️ During development, the server runs locally at 192.168.1.11:8000. For production, this will be replaced with the actual domain name.

Request Format

Most endpoints accept and return JSON. Some endpoints that upload files (like driver license images or vehicle documents) use multipart/form-data instead. These are clearly marked in the documentation below.

Content-Type: application/json
Accept: application/json
🔑

Authentication

How to log in and use the API securely

How Authentication Works

LVMS uses Bearer Token Authentication. Here's the simple flow:

Step 1: Call the Login endpoint with your email and password → you get back a token (a long string of letters and numbers).

Step 2: Include that token in the Authorization header of every subsequent request. Without this, the system will reject your request.

Authorization: Bearer <your_token_here>
The token identifies who you are and what you're allowed to do. Keep it private — treat it like a password.
POST

Login

/login
Sign in to the system and receive an access token. This is always the first step before using any other endpoint.
Request Body (JSON)
FieldTypeRequiredDescription
emailstringrequiredYour registered email address
passwordstringrequiredYour account password
Example Request
POST /api/v1/login
{
  "email": "admin@logistics.com",
  "password": "password"
}
Response
{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
  "user": { "name": "Admin", "email": "admin@logistics.com" }
}
🛡️

Roles & Permissions

Control who can do what inside the system

What are Roles?

Roles define what a user is allowed to do. For example, a "Driver" role may only access their own trips, while an "Admin" role can manage all users. Permissions are the individual actions (e.g., "view bookings", "delete customers") that are bundled into a role.

GET

List All Roles

/roles
Retrieve a list of all roles defined in the system (e.g., Admin, Manager, Driver).
No request parameters needed. Returns an array of roles with their assigned permissions.
POST

Create a Role

/roles
Create a new role and assign specific permissions to it.
FieldTypeRequiredDescription
namestringrequiredName of the role (e.g., "manager")
permissionsarrayrequiredArray of permission IDs to assign to this role
{ "name": "manager", "permissions": [5, 6, 7, 8] }
PUT

Update a Role

/roles/:role_id
Modify an existing role's name or the permissions assigned to it.
{ "name": "Staff Admin", "permissions": [2, 3, 6, 7, 8] }
DELETE

Delete a Role

/roles/:role_id
Permanently remove a role from the system.
⚠️ Deleting a role that has users assigned to it may affect their access. Verify before deleting.
GET

List All Permissions

/permissions
Get all individual permissions available in the system. Use these IDs when creating or updating roles.
No parameters needed. Returns full list of permission IDs and their descriptions.
GET

Grouped Permissions

/permissions/grouped
Returns permissions organized by category (e.g., "Bookings", "Drivers"), making it easier to assign them in a UI.
No parameters needed.
GET

View My Profile

/profile
Returns the profile information of the currently logged-in user.
No parameters. Uses the logged-in user's token to identify who to return.
PUT

Update My Profile

/profile
Update the currently logged-in user's own profile details such as name, email, or password.
Send only the fields you want to update.
👤

Users

Manage system user accounts (admins, managers, staff)

What is a User?

A "User" in LVMS is anyone who logs into the system dashboard — administrators, managers, and staff. This is different from Drivers (who have their own separate section) and Customers (businesses).

GET

List All Users

/users
Get a list of all registered system users.
No parameters needed.
POST

Create a User

/users
Register a new system user with a role and contact details.
FieldTypeRequiredDescription
namestringrequiredFull name of the user
emailstringrequiredEmail address (used for login)
phonestringrequiredContact phone number
passwordstringrequiredLogin password
addressstringoptionalPhysical address
user_typestringrequiredType of user: admin, manager, staff
rolestringrequiredRole name to assign (e.g., "Admin")
is_activebooleanoptionalWhether the account is active
avatarstringoptionalProfile image filename
PUT

Update a User

/users/:user_id
Update an existing user's details.
Send only the fields you want to change. All fields are the same as Create User.
DELETE

Delete a User

/users/:user_id
Remove a user account from the system.
⚠️ This permanently deletes the account. Consider deactivating (is_active: false) instead.
🚛

Drivers

Register and manage truck/vehicle drivers

What is a Driver?

Drivers are the people who operate the vehicles. Each driver is linked to a system User account and has additional details like license number, license type, and expiry date. Drivers also use the Driver Mobile App to manage their trips.

GET

List All Drivers

/drivers
Get a list of all drivers registered in the system.
No parameters needed. Returns all driver profiles.
POST

Register a Driver

/drivers
Add a new driver to the system with their license details and photo uploads. This uses file upload format.
📎 This endpoint uses multipart/form-data (not JSON) because it includes file uploads.
Fields
FieldTypeRequiredDescription
user_idintegerrequiredThe user account ID this driver belongs to
license_numberstringrequiredDriver's license number
license_countrystringrequiredCountry that issued the license (e.g., "NP" for Nepal)
license_issue_datedaterequiredDate the license was issued (Nepali BS format)
license_expiry_datedaterequiredDate the license expires
license_typestringrequiredLicense class (e.g., "B" for trucks)
license_image_frontfilerequiredPhoto of the front of the driver's license
license_image_backfilerequiredPhoto of the back of the driver's license
POST

Update a Driver

/drivers/:driver_id
Update an existing driver's license details or photos. Uses POST with a hidden _method=PUT field.
Same fields as Register Driver. Include _method: PUT as a form field to signal this is an update operation.
DELETE

Delete a Driver

/drivers/:driver_id
Remove a driver from the system.
⚠️ Only delete drivers who have no active or pending bookings.
💵

Driver Advances

Manage salary advances given to drivers

What is an Advance?

An advance is money given to a driver before their regular pay cycle — for example, for a family emergency or personal need. The system tracks how much was given, how much has been paid back, and the current outstanding balance.

POST

Create an Advance

/drivers/:driver_id/advances
Record a new advance given to a driver.
FieldTypeRequiredDescription
advance_amountnumberrequiredTotal advance amount in NPR
advance_typestringrequiredpersonal (for personal needs) or booking (trip-related expense)
reasonstringrequiredReason for the advance (e.g., "Family medical emergency")
statusstringrequiredInitial status: pending
notesstringoptionalAdditional notes (e.g., repayment plan)
POST

Approve an Advance

/advances/:advance_id/approve
Approve a pending advance and record when and how much was actually given.
FieldTypeRequiredDescription
statusstringrequiredSet to "approved"
given_atdaterequiredThe date the money was physically handed over
advance_amountnumberrequiredFinal approved amount
POST

Record an Advance Repayment

/advances/:advance_id/payments
Record a repayment installment from the driver towards their advance balance.
FieldTypeRequiredDescription
payment_amountnumberrequiredAmount being repaid this time
payment_methodstringrequiredHow payment was made: cash, online_transfer, cheque
payment_datedatetimerequiredDate and time of payment
notesstringoptionalNotes about this repayment
GET

Driver Advance Summary

/drivers/:driver_id/advances/summary
Get a summary of all advances for a specific driver — total given, total repaid, outstanding balance.
No parameters needed. Returns the financial summary for the driver's advances.
GET

All Pending Advances

/advances/pending
Get all advances that are still pending approval across all drivers.
Query ParameterValuesDescription
advance_typestringFilter by: personal or booking
GET

Get Driver's Advances

/drivers/:driver_id/advances
List all advances for a specific driver.
Returns full advance history for the specified driver.
GET

Advance Repayment History

/advances/:advance_id/payments
See all repayment installments made against a specific advance.
No parameters needed.
🏭

Customers

Manage pickup and dropoff client businesses

Customer Types

Customers are the businesses that use LVMS's logistics services. There are two types:

Pickup — Businesses from which goods are collected (e.g., a factory or warehouse)

Dropoff — Businesses to which goods are delivered (e.g., a distributor)

Both — A business that acts as both a pickup and a dropoff point

GET

List Customers

/customers
Get a filterable list of all customers in the system.
Query ParameterValuesDescription
customer_typestringFilter by: pickup, dropoff, or both
citystringFilter by city (e.g., "Kathmandu")
is_activebooleantrue = active customers only, false = inactive
per_pageintegerNumber of results per page (default 20)
searchstringSearch by company name
POST

Create a Customer

/customers
Register a new customer business in the system.
FieldTypeRequiredDescription
namestringrequiredContact person's full name
emailstringoptionalContact email address
phonestringrequiredContact phone number
company_namestringrequiredOfficial business name
addressstringrequiredFull business address
citystringrequiredCity where the business is located
customer_typestringrequiredpickup, dropoff, or both
vat_numberstringoptionalVAT/PAN registration number
passwordstringoptionalLogin password if customer gets portal access
is_activebooleanoptionalWhether this customer is active
GET

View Customer Details

/customers/:customer_id
Get the full profile of a single customer.
No parameters needed. Returns complete customer data.
PUT

Update a Customer

/customers/:customer_id
Edit an existing customer's details.
Send only the fields you want to update.
POST

Toggle Customer Status

/customers/:customer_id/toggle-status
Switch a customer between active and inactive status. Useful to temporarily disable a business without deleting their data.
No body needed. Each call flips the active/inactive status.
GET

Customer Pickup History

/customers/:customer_id/pickup-history
See all past pickup trips for a specific customer within a date range.
Query ParameterTypeDescription
from_datedateStart of date range (Nepali BS date format)
to_datedateEnd of date range
GET

Customer Delivery History

/customers/:customer_id/delivery-history
See all past delivery trips for a specific customer within a date range.
Query ParameterTypeDescription
from_datedateStart of date range
to_datedateEnd of date range
GET

Customer Pending Payments

/customers/:customer_id/pending-payments
View all outstanding (unpaid) payment amounts owed by a specific customer.
No parameters needed.
GET

List All Customer Cities

/customers/cities
Get a list of all unique cities where customers are located. Useful for filtering.
No parameters needed.
DELETE

Delete Payment Collection Record

/payment-history/:paymentCollection/delete
Remove a specific payment collection entry from a customer's payment history.
⚠️ This deletes the payment record permanently. Only use if the entry was added by mistake.
POST

Quick Customer Create (Driver App)

/create-customer
A simplified version of customer creation used from the driver's mobile app. Only basic fields required.
FieldTypeRequiredDescription
company_namestringrequiredBusiness name
phonestringrequiredPhone number
citystringrequiredCity name
customer_typestringrequiredpickup or dropoff
vat_numberstringoptionalVAT/PAN number
🚗

Vehicles

Manage the vehicle fleet

GET

List Vehicles

/vehicles
Get a filterable list of all vehicles in the fleet.
Query ParameterValuesDescription
in_servicebooleantrue = currently on the road, false = out of service
driver_idintegerFilter by assigned driver ID
searchstringSearch by make name, model name, or license plate
per_pageintegerResults per page (default 15)
POST

Add a Vehicle

/vehicles
Register a new vehicle to the fleet.
FieldTypeRequiredDescription
make_namestringrequiredVehicle brand (e.g., "Toyota", "Tata")
model_namestringrequiredVehicle model name
yearintegerrequiredManufacturing year
license_platestringrequiredVehicle registration number plate
in_servicebooleanoptionalIs vehicle currently active? (default true)
driver_idintegeroptionalAssign a default driver to this vehicle
GET

Vehicle Statistics

/vehicles-statistics
Get overall statistics for the entire fleet — total vehicles, how many are active, in service, etc.
No parameters needed. Returns fleet-wide statistics.
POST

Toggle Vehicle Service Status

/vehicles/:vehicle_id/toggle-service
Switch a vehicle between in-service and out-of-service status (e.g., when sending it for repairs).
No body needed. Each call flips the status.

Vehicle Documents

Manage compliance documents per vehicle (insurance, bluebook, etc.)

POST

Upload Vehicle Document

/vehicles/:vehicle_id/documents
Upload a compliance document for a vehicle (e.g., insurance certificate, road permit).
📎 Uses multipart/form-data for file upload.
FieldTypeRequiredDescription
doc_typestringrequiredDocument type (e.g., "Insurance Certificate", "Road Permit")
doc_numberstringrequiredOfficial document number
issue_datedaterequiredDate document was issued
expiry_datedaterequiredDate document expires
documentfilerequiredScanned copy of the document
GET

Expired Documents

/documents/expired
Get a list of all vehicle documents that have already expired. Use this to take action immediately.
⚠️ Vehicles with expired documents should not be operated until renewed.
GET

Documents Expiring Soon

/documents/expiring-soon
Get a list of documents that will expire within a configurable number of days. Use to plan renewals in advance.
Query ParameterTypeDescription
daysintegerNumber of days ahead to check (e.g., 45 = expiring within 45 days)
GET

Download Document

/vehicles/:vehicle_id/documents/:document_id/download
Download a scanned copy of a specific vehicle document.
Returns the file as a downloadable attachment.
📦

Bookings & Trips

The core of LVMS — full lifecycle from departure to completion

How Bookings & Trips Work

A Booking is a single vehicle assignment — one vehicle + one driver + one departure. A booking can contain multiple Trips (e.g., the truck goes from Kathmandu to Birgunj, picks up goods, delivers them, then returns). Each trip can have multiple Loads (cargo from different pickup customers) and multiple Deliveries (to different dropoff customers).

The typical flow is: Create Booking → Start Booking → Create Trip → Add Loads → Start Trip → Add Deliveries → Complete Trip → Complete Booking

POST

Create a Booking

/bookings
Create a new booking by assigning a vehicle, driver, and departure time.
FieldTypeRequiredDescription
vehicle_idintegerrequiredID of the vehicle to use
driver_idintegerrequiredID of the driver assigned
departure_timedatetimerequiredScheduled departure date and time
POST

Start a Booking

/bookings/:booking_id/start
Mark a booking as started — the vehicle has departed from the base.
No body needed. Transitions the booking status from "scheduled" to "in progress".
GET

List Bookings

/bookings
Get a list of all bookings. Can be filtered by status, date, driver, or vehicle.
Supports filtering via query parameters. Returns paginated results.
POST

Add Fuel to a Booking

/bookings/:booking_id/fuel
Record a fuel fill-up that occurred during this booking. Links to a specific trip and fuel station.
📎 Uses multipart/form-data (supports image upload of receipt).
FieldTypeRequiredDescription
trip_idintegerrequiredThe trip this fuel was used for
fuel_station_idintegerrequiredWhich fuel station was used
litersnumberrequiredAmount of fuel filled in liters
filled_atdatetimerequiredDate and time of fuel fill
payment_typestringrequiredcash or credit
imagefileoptionalPhoto of the fuel receipt
notesstringoptionalAny extra notes
POST

Report a Breakdown

/bookings/:booking_id/breakdowns
Record a vehicle breakdown that occurred during a booking.
FieldTypeRequiredDescription
trip_idintegerrequiredWhich trip the breakdown happened during
breakdown_typestringrequiredType of breakdown (e.g., engine, tyre, electrical)
descriptionstringrequiredDescription of what happened
repair_costnumberoptionalEstimated or actual repair cost
locationstringrequiredWhere the breakdown occurred
breakdown_timedatetimerequiredWhen the breakdown happened
imagefileoptionalPhoto evidence of the breakdown
POST

Mark Breakdown as Fixed

/breakdowns/:breakdown_id/fixed
Mark a breakdown as resolved once the vehicle has been repaired.
No body needed.
POST

Complete a Booking

/bookings/:booking_id/complete
Mark the entire booking as completed when the vehicle returns to base.
FieldTypeRequiredDescription
return_timedatetimerequiredActual return time of the vehicle
driver_returned_amountnumberoptionalCash amount returned by the driver at end of trip
notesstringoptionalAny final notes
GET

Booking Performance

/performance/bookings/:booking_id/calculate
Calculate the revenue, cost, and performance score for a completed booking.
No parameters needed. Returns profit/loss analysis for the booking.
GET

Bookings with Pending Payments

/bookings/pending-payments
Get a list of bookings that have outstanding unpaid amounts from customers.
No parameters needed.

Trips (within Bookings)

Individual routes within a booking

POST

Add a Load to a Trip

/trips/:trip_id/loads
Record goods being picked up from a customer for this trip.
FieldTypeRequiredDescription
pickup_customer_idintegerrequiredThe customer whose goods are being picked up
product_namestringrequiredName of the goods (e.g., "Scrap Metal")
weight_kgnumberrequiredWeight of the goods in kilograms
price_per_kgnumberrequiredRate charged per kilogram
include_vatbooleanoptionalWhether VAT is included in the price
loading_imagefileoptionalPhoto taken during loading
notesstringoptionalAdditional notes
POST

Add a Delivery to a Trip

/trips/:trip_id/deliveries
Record goods being delivered to a dropoff customer.
Send delivery details including customer and payment information. Body structure mirrors the update endpoint below.
PUT

Update a Delivery

/trips/deliveries/:trip_delivery_id
Update payment details for a delivery (e.g., mark payment as received).
FieldTypeRequiredDescription
amount_collectednumberrequiredTotal amount collected from the delivery customer
payment_methodstringrequiredcash, cheque, online_transfer, or credit
payment_referencestringoptionalReference number (e.g., transaction ID or cheque number)
notesstringoptionalAny notes about the payment
POST

Complete a Trip

/trips/:trip_id/complete
Mark a trip as finished. All deliveries for this trip must be done before completing.
No body needed. Changes trip status to "completed".

Driver Payments (within Bookings)

Record cash given to or returned by driver during a booking

POST

Record Driver Payment

/driver-payments/store
Record a payment made to or from the driver for a specific booking (e.g., road expenses, cash for fuel).
FieldTypeRequiredDescription
booking_idintegerrequiredThe booking this payment belongs to
driver_idintegerrequiredThe driver involved
amountnumberrequiredPayment amount
statusstringrequiredpartial or full
collected_atdaterequiredDate payment was collected
payment_referencestringoptionalReference number if applicable

Fuel Management

Manage fuel stations, history, and payments

GET

List Fuel Stations

/fuel-stations
Get all registered fuel stations that drivers can use.
No parameters needed.
POST

Add a Fuel Station

/fuel-stations
Register a new fuel station.
FieldTypeRequiredDescription
station_namestringrequiredName of the station
locationstringrequiredPhysical address or location description
contact_personstringoptionalContact person at the station
phonestringoptionalStation phone number
payment_typestringrequiredcash, credit, or both
is_activebooleanoptionalWhether station is currently active
GET

Fuel History

/fuel/history
View complete fuel fill-up history across all vehicles and trips.
No parameters needed. Returns full history.
GET

Monthly Fuel Contract Bill

/fuel/monthly-contract
Get the total fuel bill for a specific month from credit-based fuel stations.
Query ParameterTypeDescription
monthstringMonth in YYYY-MM format (e.g., "2024-01")
POST

Pay Fuel Bill

/fuel/:fuel_id/pay
Record payment for a fuel credit bill.
FieldTypeRequiredDescription
payment_methodstringrequiredcash, online_transfer, or cheque
payment_refstringoptionalTransaction or cheque reference number
🔧

Vehicle Maintenance

Track service records, parts, and upcoming maintenance

POST

Create Maintenance Record

/vehicles/:vehicle_id/maintenance
Record a maintenance or service event for a vehicle, including parts used and costs.
FieldTypeRequiredDescription
maintenance_typestringrequiredservice, repair, inspection, parts_replacement, or other
titlestringrequiredShort description (e.g., "Oil Change and Filter Replacement")
service_datedaterequiredDate of the service
odometer_readingintegerrequiredVehicle odometer at time of service (in km)
next_service_kmintegeroptionalOdometer reading when next service is due
labor_costnumberoptionalCost of labor
parts_costnumberoptionalTotal cost of all parts
performed_bystringoptionalName of mechanic or garage
statusstringrequiredcompleted, pending, or scheduled
partsarrayoptionalArray of parts used (see below)
Parts Array Structure
"parts": [
  {
    "part_name": "Engine Oil (Fully Synthetic)",
    "part_number": "5W-30-5L",
    "quantity": 5,
    "unit_price": 600
  }
]
GET

Upcoming Maintenance

/maintenance/upcoming
Get a list of vehicles with scheduled or due maintenance within the next N days.
Query ParameterTypeDescription
daysintegerLook ahead period in days (e.g., 15 = show maintenance due in next 15 days)
GET

All Vehicles Maintenance Summary

/maintenance/all-vehicles-summary
Get a cost and activity summary for all vehicles within a date range.
Query ParameterTypeDescription
from_datedateStart of the date range
to_datedateEnd of the date range
🏆

Rewards & Driver Performance

Incentivize and rank drivers through campaigns and scoring

How the Rewards System Works

LVMS has a performance scoring engine that evaluates each driver based on factors like trip completions, revenue generated, fuel efficiency, and cost management. Admins can create Campaigns (monthly, occasional) with prize money distributed to top-performing drivers.

POST

Create a Reward Campaign

/campaigns
Create a performance campaign with prizes for top drivers.
FieldTypeRequiredDescription
campaign_namestringrequiredName of the campaign
campaign_typestringrequiredmonthly or occasional
start_datedaterequiredCampaign start date
end_datedaterequiredCampaign end date
top_performers_countintegerrequiredHow many top drivers will receive prizes
first_prizenumberrequiredPrize amount for 1st place (NPR)
second_prizenumberoptionalPrize for 2nd place
third_prizenumberoptionalPrize for 3rd place
additional_prizesarrayoptionalPrizes for 4th place and beyond
GET

Live Leaderboard

/performance/live-leaderboard
See the real-time driver performance rankings for a given period.
Query ParameterTypeDescription
start_datedateStart of the scoring period
end_datedateEnd of the scoring period
POST

Compare Drivers

/performance/compare-drivers
Side-by-side performance comparison for selected drivers.
FieldTypeRequiredDescription
driver_idsarrayrequiredArray of driver IDs to compare (e.g., [4, 5, 6])
start_datedaterequiredComparison period start
end_datedaterequiredComparison period end
GET

Driver Achievements

/drivers/:driver_id/achievements
View all past campaign wins and achievements for a specific driver.
No parameters needed.
📊

Reports

13 report types — exportable as Excel or PDF

About Reports

All reports accept date range filters and most support format=excel or format=pdf as a query parameter to export directly. Without the format parameter, they return JSON data for display in the dashboard.

GET

Booking Report

/reports/booking
Full booking history with filters for status, driver, vehicle, and date range.
FilterDescription
from_date / to_dateDate range
statuscompleted, pending, in_progress
driver_idFilter by specific driver
vehicle_idFilter by specific vehicle
formatexcel or pdf to download
GET

Revenue Report

/reports/revenue
Total income collected within a period, filterable by payment method and customer.
Filter by: from_date, to_date, payment_method (cash/cheque/online_transfer), customer_id, status (collected), format
GET

Profit & Loss Report

/reports/profit-loss
Complete P&L statement showing total revenue minus all expenses for a given period.
Filter by: from_date, to_date, format
GET

Expenses Report

/reports/expense
All expenses (fuel, maintenance, driver advances, etc.) for a given period.
Filter by: from_date, to_date, format
GET

Driver Performance Report

/reports/driver-performance
Performance scores for all drivers within a date range.
Filter by: from_date, to_date, is_active, format
GET

Vehicle Utilization Report

/reports/vehicle-utilization
How much each vehicle has been used, idle time, trips completed, and total km driven.
Filter by: from_date, to_date, in_service, format
GET

Fuel Consumption Report

/reports/fuel-consumption
Total fuel used, average consumption, and cost per vehicle.
Filter by: vehicle_id, from_date, to_date, format
GET

Customer Transaction Report

/reports/customer-transaction
All transactions (loads picked up, deliveries, payments) for customers within a period.
Filter by: city, from_date, to_date, customer_type (pickup/dropoff), format
GET

Driver Settlement Report

/reports/driver-settlement
Summary of wages, advances, and net amount owed to each driver.
Filter by: driver_id, from_date, to_date
GET

Maintenance & Breakdown Report

/reports/maintenance-breakdown
All maintenance events and breakdown incidents, with costs, for a date range.
Filter by: from_date, to_date, vehicle_id, format
GET

Trip Analysis Report

/reports/trip-analysis
Detailed breakdown of all trips — distance, revenue, load weights, driver performance.
Filter by: from_date, to_date, format
GET

Dashboard Summary

/reports/dashboard-summary
High-level KPIs for the main dashboard — today's bookings, revenue, active drivers, etc.
Filter by: period (day, week, month, year)
POST

Comparative Report

/reports/comparative
Compare two time periods side by side — useful for month-over-month or year-over-year analysis.
FieldDescription
period1_from / period1_toStart and end of the first period
period2_from / period2_toStart and end of the second period
formatpdf or excel
📢

Notices

Send announcements to drivers via the mobile app

GET

List Notices

/notices
Get all notices sent by the company.
No parameters needed.
POST

Send a Notice

/notices
Send a notice/announcement to all drivers or to specific ones.
FieldTypeRequiredDescription
messagestringrequiredThe notice message text
send_to_allbooleanrequiredtrue = send to all drivers, false = send to specific drivers
driver_idsarrayconditionalRequired if send_to_all is false. Array of driver IDs to notify
⚙️

Company Settings

Configure system-wide settings like fuel price, company name, etc.

POST

Create a Setting

/company-settings
Add a new configurable setting to the system.
FieldTypeRequiredDescription
setting_keystringrequiredUnique key name (e.g., "fuel_price_per_liter")
setting_valueanyrequiredThe value of the setting
setting_typestringrequiredData type: text, number, boolean
descriptionstringoptionalHuman-readable description of what this setting does
GET

Get All Settings

/company-settings
Retrieve all current system settings.
No parameters needed.
PUT

Update a Setting

/company-settings/:setting_key
Change the value of an existing setting using its key name.
Send the new value and description. The key is passed in the URL.
📍

GPS Tracking API

Real-time vehicle location and telemetry data

About the GPS API

This module connects to an external GPS tracking service. It uses a vehicle's IMEI number (a unique hardware ID from the GPS device installed in the vehicle) to query location, fuel levels, odometer readings, and movement history.

GET

Get Vehicle IMEI Number

GPS Service · cmd=get_imei
Look up the GPS device IMEI number for a vehicle using its license plate number.
ParameterDescription
vehnumVehicle license plate number
cmdAlways: get_imei
nodeGPS server node (usually 1)
GET

Current Vehicle Status

GPS Service · cmd=status
Get the current live location, speed, and engine status of a vehicle.
ParameterDescription
imeiVehicle's GPS device IMEI number
cmdAlways: status
nodeGPS server node
GET

Odometer & Fuel Reading

GPS Service · cmd=odo_and_fuel
Get odometer reading and fuel tank level for a vehicle over a time period.
ParameterDescription
imeiVehicle IMEI number
start / stopUnix timestamps for start and end of period
nodeGPS server node
GET

Parking & Stops

GPS Service · cmd=runstops
View where and how long a vehicle was parked or stopped during a journey.
ParameterDescription
imeiVehicle IMEI number
start / stopUnix timestamps
📱

Driver Mobile App API

Endpoints used exclusively by the driver's mobile application

About the Driver App

The Driver App is a separate mobile application installed on each driver's phone. It has its own simplified set of endpoints tailored for drivers on the road — logging in, checking their dashboard, viewing campaigns, and marking notices as read.

POST

Driver App Login

/login
Driver logs in to the mobile app using email and password.
📎 Uses form-data format. Fields: email, password.
GET

Driver Dashboard

/dashboard
Returns the driver's personal dashboard — active booking, recent trips, earnings summary, and notifications.
Uses the driver's token to identify which driver's data to return.
GET

Active Campaigns

/campaign-list
View all currently active performance reward campaigns the driver can participate in.
No parameters needed.
GET

My Campaign Rank

/campaign-rank
View the driver's current rank in active campaigns.
No parameters needed. Returns the logged-in driver's ranking.
GET

My Achievements

/achievements
View all past wins, badges, and campaign rewards earned by the driver.
No parameters needed.
POST

Mark Notices as Read

/notices/mark-as-read
Mark one or more notices as read so they don't show as unread in the driver app.
FieldTypeRequiredDescription
notices_idarrayrequiredArray of notice IDs to mark as read (e.g., [3, 4])
📖

Glossary

Plain-language definitions of terms used in LVMS

TermMeaning
BookingA single vehicle dispatch event — one vehicle, one driver, one departure. Contains one or more trips.
TripOne route within a booking (e.g., Kathmandu → Birgunj). Contains loads and deliveries.
LoadGoods picked up from a pickup customer and placed on the truck during a trip.
DeliveryGoods delivered to a dropoff customer during a trip, along with payment collection.
Pickup CustomerA business from which goods are collected.
Dropoff CustomerA business to which goods are delivered.
AdvanceMoney given to a driver before their regular pay cycle, to be repaid in installments.
CampaignA time-bound reward competition where top-performing drivers win cash prizes.
IMEIA unique ID number for the GPS tracking device installed in a vehicle.
Bearer TokenA security key returned after login. Must be included in all subsequent API requests.
VAT NumberA business's tax registration number (equivalent to PAN in Nepal).
Unix TimestampA way of representing a date/time as a number — seconds elapsed since January 1, 1970.
BS DateBikram Sambat (Nepali calendar) date format. Used in several date fields throughout the system.
Multipart/form-dataA request format used when uploading files (images, documents) along with other data.
🤝

For Clients & Business Owners

What this system does for your business — in plain language

What LVMS Does

LVMS (Lyansh Motors & Logistics Management System) is a complete digital platform for managing a logistics and transportation business. Here's what it handles automatically:

Fleet Management
Track every vehicle — its current status (on the road / in garage), maintenance schedule, document renewal dates, and full service history.

Trip Operations
Create and manage every trip from start to finish. Know exactly which driver took what cargo, from which business, delivered to which customer, and how much was collected.

Finance & Settlements
Automatically calculate revenue, expenses, driver wages, and profit/loss per booking and per period. Export any report to Excel or PDF.

Driver Management
Keep license records up to date, track salary advances and repayments, and use performance scores to reward your best drivers.

Customer Records
Maintain a database of all pickup and dropoff businesses with their full transaction and payment history.

GPS Integration
See where your vehicles are in real time, review past routes, and get fuel consumption data directly from the GPS device.

Questions for the Development Team

If you're a client reviewing this documentation, here are things worth confirming with your developer before going live:

1. Production Server URL — The current API points to a local development machine. Ask for the live domain when ready for production.

2. Date Format — Several fields use Nepali BS (Bikram Sambat) calendar dates. Confirm whether this is consistent across all date inputs.

3. GPS Service Credentials — The GPS API requires a separate third-party account. Confirm access is set up.

4. File Storage — Images (license, vehicle documents, fuel receipts) are uploaded to the server. Confirm backup and storage policy.