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.
📖 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.
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:
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.
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.
Login
| Field | Type | Required | Description |
|---|---|---|---|
| string | required | Your registered email address | |
| password | string | required | Your account password |
POST /api/v1/login
{
"email": "admin@logistics.com",
"password": "password"
}
{
"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.
List All Roles
Create a Role
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | required | Name of the role (e.g., "manager") |
| permissions | array | required | Array of permission IDs to assign to this role |
{ "name": "manager", "permissions": [5, 6, 7, 8] }
Update a Role
{ "name": "Staff Admin", "permissions": [2, 3, 6, 7, 8] }
Delete a Role
List All Permissions
Grouped Permissions
View My Profile
Update My Profile
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).
List All Users
Create a User
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | required | Full name of the user |
| string | required | Email address (used for login) | |
| phone | string | required | Contact phone number |
| password | string | required | Login password |
| address | string | optional | Physical address |
| user_type | string | required | Type of user: admin, manager, staff |
| role | string | required | Role name to assign (e.g., "Admin") |
| is_active | boolean | optional | Whether the account is active |
| avatar | string | optional | Profile image filename |
Update a User
Delete a User
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.
List All Drivers
Register a Driver
| Field | Type | Required | Description |
|---|---|---|---|
| user_id | integer | required | The user account ID this driver belongs to |
| license_number | string | required | Driver's license number |
| license_country | string | required | Country that issued the license (e.g., "NP" for Nepal) |
| license_issue_date | date | required | Date the license was issued (Nepali BS format) |
| license_expiry_date | date | required | Date the license expires |
| license_type | string | required | License class (e.g., "B" for trucks) |
| license_image_front | file | required | Photo of the front of the driver's license |
| license_image_back | file | required | Photo of the back of the driver's license |
Update a Driver
_method: PUT as a form field to signal this is an update operation.Delete a Driver
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.
Create an Advance
| Field | Type | Required | Description |
|---|---|---|---|
| advance_amount | number | required | Total advance amount in NPR |
| advance_type | string | required | personal (for personal needs) or booking (trip-related expense) |
| reason | string | required | Reason for the advance (e.g., "Family medical emergency") |
| status | string | required | Initial status: pending |
| notes | string | optional | Additional notes (e.g., repayment plan) |
Approve an Advance
| Field | Type | Required | Description |
|---|---|---|---|
| status | string | required | Set to "approved" |
| given_at | date | required | The date the money was physically handed over |
| advance_amount | number | required | Final approved amount |
Record an Advance Repayment
| Field | Type | Required | Description |
|---|---|---|---|
| payment_amount | number | required | Amount being repaid this time |
| payment_method | string | required | How payment was made: cash, online_transfer, cheque |
| payment_date | datetime | required | Date and time of payment |
| notes | string | optional | Notes about this repayment |
Driver Advance Summary
All Pending Advances
| Query Parameter | Values | Description |
|---|---|---|
| advance_type | string | Filter by: personal or booking |
Get Driver's Advances
Advance Repayment History
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
List Customers
| Query Parameter | Values | Description |
|---|---|---|
| customer_type | string | Filter by: pickup, dropoff, or both |
| city | string | Filter by city (e.g., "Kathmandu") |
| is_active | boolean | true = active customers only, false = inactive |
| per_page | integer | Number of results per page (default 20) |
| search | string | Search by company name |
Create a Customer
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | required | Contact person's full name |
| string | optional | Contact email address | |
| phone | string | required | Contact phone number |
| company_name | string | required | Official business name |
| address | string | required | Full business address |
| city | string | required | City where the business is located |
| customer_type | string | required | pickup, dropoff, or both |
| vat_number | string | optional | VAT/PAN registration number |
| password | string | optional | Login password if customer gets portal access |
| is_active | boolean | optional | Whether this customer is active |
View Customer Details
Update a Customer
Toggle Customer Status
Customer Pickup History
| Query Parameter | Type | Description |
|---|---|---|
| from_date | date | Start of date range (Nepali BS date format) |
| to_date | date | End of date range |
Customer Delivery History
| Query Parameter | Type | Description |
|---|---|---|
| from_date | date | Start of date range |
| to_date | date | End of date range |
Customer Pending Payments
List All Customer Cities
Delete Payment Collection Record
Quick Customer Create (Driver App)
| Field | Type | Required | Description |
|---|---|---|---|
| company_name | string | required | Business name |
| phone | string | required | Phone number |
| city | string | required | City name |
| customer_type | string | required | pickup or dropoff |
| vat_number | string | optional | VAT/PAN number |
Vehicles
Manage the vehicle fleet
List Vehicles
| Query Parameter | Values | Description |
|---|---|---|
| in_service | boolean | true = currently on the road, false = out of service |
| driver_id | integer | Filter by assigned driver ID |
| search | string | Search by make name, model name, or license plate |
| per_page | integer | Results per page (default 15) |
Add a Vehicle
| Field | Type | Required | Description |
|---|---|---|---|
| make_name | string | required | Vehicle brand (e.g., "Toyota", "Tata") |
| model_name | string | required | Vehicle model name |
| year | integer | required | Manufacturing year |
| license_plate | string | required | Vehicle registration number plate |
| in_service | boolean | optional | Is vehicle currently active? (default true) |
| driver_id | integer | optional | Assign a default driver to this vehicle |
Vehicle Statistics
Toggle Vehicle Service Status
Vehicle Documents
Manage compliance documents per vehicle (insurance, bluebook, etc.)
Upload Vehicle Document
| Field | Type | Required | Description |
|---|---|---|---|
| doc_type | string | required | Document type (e.g., "Insurance Certificate", "Road Permit") |
| doc_number | string | required | Official document number |
| issue_date | date | required | Date document was issued |
| expiry_date | date | required | Date document expires |
| document | file | required | Scanned copy of the document |
Expired Documents
Documents Expiring Soon
| Query Parameter | Type | Description |
|---|---|---|
| days | integer | Number of days ahead to check (e.g., 45 = expiring within 45 days) |
Download Document
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
Create a Booking
| Field | Type | Required | Description |
|---|---|---|---|
| vehicle_id | integer | required | ID of the vehicle to use |
| driver_id | integer | required | ID of the driver assigned |
| departure_time | datetime | required | Scheduled departure date and time |
Start a Booking
List Bookings
Add Fuel to a Booking
| Field | Type | Required | Description |
|---|---|---|---|
| trip_id | integer | required | The trip this fuel was used for |
| fuel_station_id | integer | required | Which fuel station was used |
| liters | number | required | Amount of fuel filled in liters |
| filled_at | datetime | required | Date and time of fuel fill |
| payment_type | string | required | cash or credit |
| image | file | optional | Photo of the fuel receipt |
| notes | string | optional | Any extra notes |
Report a Breakdown
| Field | Type | Required | Description |
|---|---|---|---|
| trip_id | integer | required | Which trip the breakdown happened during |
| breakdown_type | string | required | Type of breakdown (e.g., engine, tyre, electrical) |
| description | string | required | Description of what happened |
| repair_cost | number | optional | Estimated or actual repair cost |
| location | string | required | Where the breakdown occurred |
| breakdown_time | datetime | required | When the breakdown happened |
| image | file | optional | Photo evidence of the breakdown |
Mark Breakdown as Fixed
Complete a Booking
| Field | Type | Required | Description |
|---|---|---|---|
| return_time | datetime | required | Actual return time of the vehicle |
| driver_returned_amount | number | optional | Cash amount returned by the driver at end of trip |
| notes | string | optional | Any final notes |
Booking Performance
Bookings with Pending Payments
Trips (within Bookings)
Individual routes within a booking
Add a Load to a Trip
| Field | Type | Required | Description |
|---|---|---|---|
| pickup_customer_id | integer | required | The customer whose goods are being picked up |
| product_name | string | required | Name of the goods (e.g., "Scrap Metal") |
| weight_kg | number | required | Weight of the goods in kilograms |
| price_per_kg | number | required | Rate charged per kilogram |
| include_vat | boolean | optional | Whether VAT is included in the price |
| loading_image | file | optional | Photo taken during loading |
| notes | string | optional | Additional notes |
Add a Delivery to a Trip
Update a Delivery
| Field | Type | Required | Description |
|---|---|---|---|
| amount_collected | number | required | Total amount collected from the delivery customer |
| payment_method | string | required | cash, cheque, online_transfer, or credit |
| payment_reference | string | optional | Reference number (e.g., transaction ID or cheque number) |
| notes | string | optional | Any notes about the payment |
Complete a Trip
Driver Payments (within Bookings)
Record cash given to or returned by driver during a booking
Record Driver Payment
| Field | Type | Required | Description |
|---|---|---|---|
| booking_id | integer | required | The booking this payment belongs to |
| driver_id | integer | required | The driver involved |
| amount | number | required | Payment amount |
| status | string | required | partial or full |
| collected_at | date | required | Date payment was collected |
| payment_reference | string | optional | Reference number if applicable |
Fuel Management
Manage fuel stations, history, and payments
List Fuel Stations
Add a Fuel Station
| Field | Type | Required | Description |
|---|---|---|---|
| station_name | string | required | Name of the station |
| location | string | required | Physical address or location description |
| contact_person | string | optional | Contact person at the station |
| phone | string | optional | Station phone number |
| payment_type | string | required | cash, credit, or both |
| is_active | boolean | optional | Whether station is currently active |
Fuel History
Monthly Fuel Contract Bill
| Query Parameter | Type | Description |
|---|---|---|
| month | string | Month in YYYY-MM format (e.g., "2024-01") |
Pay Fuel Bill
| Field | Type | Required | Description |
|---|---|---|---|
| payment_method | string | required | cash, online_transfer, or cheque |
| payment_ref | string | optional | Transaction or cheque reference number |
Vehicle Maintenance
Track service records, parts, and upcoming maintenance
Create Maintenance Record
| Field | Type | Required | Description |
|---|---|---|---|
| maintenance_type | string | required | service, repair, inspection, parts_replacement, or other |
| title | string | required | Short description (e.g., "Oil Change and Filter Replacement") |
| service_date | date | required | Date of the service |
| odometer_reading | integer | required | Vehicle odometer at time of service (in km) |
| next_service_km | integer | optional | Odometer reading when next service is due |
| labor_cost | number | optional | Cost of labor |
| parts_cost | number | optional | Total cost of all parts |
| performed_by | string | optional | Name of mechanic or garage |
| status | string | required | completed, pending, or scheduled |
| parts | array | optional | Array of parts used (see below) |
"parts": [
{
"part_name": "Engine Oil (Fully Synthetic)",
"part_number": "5W-30-5L",
"quantity": 5,
"unit_price": 600
}
]
Upcoming Maintenance
| Query Parameter | Type | Description |
|---|---|---|
| days | integer | Look ahead period in days (e.g., 15 = show maintenance due in next 15 days) |
All Vehicles Maintenance Summary
| Query Parameter | Type | Description |
|---|---|---|
| from_date | date | Start of the date range |
| to_date | date | End 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.
Create a Reward Campaign
| Field | Type | Required | Description |
|---|---|---|---|
| campaign_name | string | required | Name of the campaign |
| campaign_type | string | required | monthly or occasional |
| start_date | date | required | Campaign start date |
| end_date | date | required | Campaign end date |
| top_performers_count | integer | required | How many top drivers will receive prizes |
| first_prize | number | required | Prize amount for 1st place (NPR) |
| second_prize | number | optional | Prize for 2nd place |
| third_prize | number | optional | Prize for 3rd place |
| additional_prizes | array | optional | Prizes for 4th place and beyond |
Live Leaderboard
| Query Parameter | Type | Description |
|---|---|---|
| start_date | date | Start of the scoring period |
| end_date | date | End of the scoring period |
Compare Drivers
| Field | Type | Required | Description |
|---|---|---|---|
| driver_ids | array | required | Array of driver IDs to compare (e.g., [4, 5, 6]) |
| start_date | date | required | Comparison period start |
| end_date | date | required | Comparison period end |
Driver Achievements
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.
Booking Report
| Filter | Description |
|---|---|
| from_date / to_date | Date range |
| status | completed, pending, in_progress |
| driver_id | Filter by specific driver |
| vehicle_id | Filter by specific vehicle |
| format | excel or pdf to download |
Revenue Report
Profit & Loss Report
Expenses Report
Driver Performance Report
Vehicle Utilization Report
Fuel Consumption Report
Customer Transaction Report
Driver Settlement Report
Maintenance & Breakdown Report
Trip Analysis Report
Dashboard Summary
Comparative Report
| Field | Description |
|---|---|
| period1_from / period1_to | Start and end of the first period |
| period2_from / period2_to | Start and end of the second period |
| format | pdf or excel |
Notices
Send announcements to drivers via the mobile app
List Notices
Send a Notice
| Field | Type | Required | Description |
|---|---|---|---|
| message | string | required | The notice message text |
| send_to_all | boolean | required | true = send to all drivers, false = send to specific drivers |
| driver_ids | array | conditional | Required if send_to_all is false. Array of driver IDs to notify |
Company Settings
Configure system-wide settings like fuel price, company name, etc.
Create a Setting
| Field | Type | Required | Description |
|---|---|---|---|
| setting_key | string | required | Unique key name (e.g., "fuel_price_per_liter") |
| setting_value | any | required | The value of the setting |
| setting_type | string | required | Data type: text, number, boolean |
| description | string | optional | Human-readable description of what this setting does |
Get All Settings
Update a Setting
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 Vehicle IMEI Number
| Parameter | Description |
|---|---|
| vehnum | Vehicle license plate number |
| cmd | Always: get_imei |
| node | GPS server node (usually 1) |
Current Vehicle Status
| Parameter | Description |
|---|---|
| imei | Vehicle's GPS device IMEI number |
| cmd | Always: status |
| node | GPS server node |
Odometer & Fuel Reading
| Parameter | Description |
|---|---|
| imei | Vehicle IMEI number |
| start / stop | Unix timestamps for start and end of period |
| node | GPS server node |
Parking & Stops
| Parameter | Description |
|---|---|
| imei | Vehicle IMEI number |
| start / stop | Unix 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.
Driver App Login
Driver Dashboard
Active Campaigns
My Campaign Rank
My Achievements
Mark Notices as Read
| Field | Type | Required | Description |
|---|---|---|---|
| notices_id | array | required | Array of notice IDs to mark as read (e.g., [3, 4]) |
Glossary
Plain-language definitions of terms used in LVMS
| Term | Meaning |
|---|---|
| Booking | A single vehicle dispatch event — one vehicle, one driver, one departure. Contains one or more trips. |
| Trip | One route within a booking (e.g., Kathmandu → Birgunj). Contains loads and deliveries. |
| Load | Goods picked up from a pickup customer and placed on the truck during a trip. |
| Delivery | Goods delivered to a dropoff customer during a trip, along with payment collection. |
| Pickup Customer | A business from which goods are collected. |
| Dropoff Customer | A business to which goods are delivered. |
| Advance | Money given to a driver before their regular pay cycle, to be repaid in installments. |
| Campaign | A time-bound reward competition where top-performing drivers win cash prizes. |
| IMEI | A unique ID number for the GPS tracking device installed in a vehicle. |
| Bearer Token | A security key returned after login. Must be included in all subsequent API requests. |
| VAT Number | A business's tax registration number (equivalent to PAN in Nepal). |
| Unix Timestamp | A way of representing a date/time as a number — seconds elapsed since January 1, 1970. |
| BS Date | Bikram Sambat (Nepali calendar) date format. Used in several date fields throughout the system. |
| Multipart/form-data | A 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.