Vehicles
5 API calls in this section.
Endpoints for managing delivery vehicles, which define different types of vehicles used for deliveries, including their capacity unit, requirements, specifications, and image URL.
List Vehicles
/delivery/vehiclesGet a paginated list of vehicles with optional column_filters, sort_by, sort_order and inline stats. Requires view:tenant or manage:operations:tenant permission.
Query parameters
| Parameter | Type | Description |
|---|---|---|
page | string | Page number for pagination (1-based) Example: |
limit | string | Number of items per page Example: |
search | string | Free-text search across name and code |
sort_by | string | Sort column. Allowed: name, code, Example: |
sort_order | string | asc or desc (default desc) Example: |
column_filters | string | JSON object with per-column filters. Keys: name (ILIKE), code (ILIKE), active (boolean), |
active | string | Legacy: filter by active status (true/false) |
name | string | Legacy: filter by vehicle name (ILIKE) |
code | string | Legacy: filter by vehicle code (ILIKE) |
fuel_type | string | Legacy: filter by fuel type (exact) |
license_requirements | string | Legacy: filter by license requirement (array element match) |
tenant_idOptional | string | Tenant ID (optional if in auth token) |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/delivery/vehicles?page=1&limit=10&search=&sort_by=created_at&sort_order=desc&column_filters=&tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Vehicles retrieved successfully",4 "vehicles": [5 {6 "id": "uuid-1",7 "name": "Delivery Van - Medium",8 "code": "DVM-001",9 "capacity_unit": 3,10 "vehicle_requirements": {11 "license_requirements": [12 "standard"13 ],14 "special_features": [15 "lift_gate"16 ],17 "fuel_type": "diesel"18 },19 "image_url": "https://example.com/images/delivery-van.jpg",20 "active": true,21 "created_at": "2025-01-15T10:00:00Z"22 }23 ],24 "page": 1,25 "limit": 10,26 "total": 98,27 "stats": {28 "totalVehicles": 124,29 "activeVehicles": 98,30 "inactiveVehicles": 26,31 "recentlyAddedCount": 532 }33}Get Vehicle
/delivery/vehicles/:vehicleIdGet details for a specific vehicle. Requires view:tenant or manage:operations:tenant permission.
Path parameters
| Parameter | Type | Description |
|---|---|---|
vehicleIdRequired | string | ID of the vehicle to retrieve Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | Tenant ID (optional if in auth token) |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/delivery/vehicles/${VEHICLEID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Vehicle retrieved successfully",4 "vehicle": {5 "id": "uuid",6 "tenant_id": "uuid",7 "name": "Delivery Van - Medium",8 "code": "DVM-001",9 "description": "Standard medium-sized delivery van for urban deliveries",10 "capacity_unit": 3,11 "capacity_volume": null,12 "capacity_weight": null,13 "capacity_metrics": null,14 "vehicle_requirements": {15 "license_requirements": [16 "standard"17 ],18 "special_features": [19 "lift_gate"20 ],21 "fuel_type": "diesel"22 },23 "image_url": "https://example.com/images/delivery-van.jpg",24 "active": true,25 "created_at": "2023-07-01T10:00:00Z",26 "updated_at": "2023-08-01T15:30:00Z",27 "deleted_at": null28 }29}Create Vehicle
/delivery/vehiclesCreate a new vehicle type. Requires manage:operations:tenant permission.
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | Tenant ID (optional if in auth token) |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
name | string | — |
code | string | — |
description | string | — |
capacity_unit | number | — |
vehicle_requirements | object | — |
vehicle_requirements.license_requirements | array<string> | — |
vehicle_requirements.special_features | array<string> | — |
vehicle_requirements.fuel_type | string | — |
image_url | string | — |
active | boolean | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/delivery/vehicles?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "name": "Delivery Van - Medium",6 "code": "DVM-001",7 "description": "Standard medium-sized delivery van for urban deliveries",8 "capacity_unit": 3,9 "vehicle_requirements": {10 "license_requirements": [11 "standard"12 ],13 "special_features": [14 "lift_gate"15 ],16 "fuel_type": "diesel"17 },18 "image_url": "https://example.com/images/delivery-van.jpg",19 "active": true20}'Response examples
1{2 "success": true,3 "message": "Vehicle created successfully",4 "id": "uuid"5}Update Vehicle
/delivery/vehicles/:vehicleIdUpdate an existing vehicle. Only the fields provided in the request will be updated. Requires manage:operations:tenant permission.
Path parameters
| Parameter | Type | Description |
|---|---|---|
vehicleIdRequired | string | ID of the vehicle to update Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | Tenant ID (optional if in auth token) |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
name | string | — |
description | string | — |
capacity_unit | number | — |
vehicle_requirements | object | — |
vehicle_requirements.special_features | array<string> | — |
vehicle_requirements.fuel_type | string | — |
image_url | string | — |
active | boolean | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/delivery/vehicles/${VEHICLEID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "name": "Delivery Van - Medium Plus",6 "description": "Updated medium-sized delivery van for urban deliveries",7 "capacity_unit": 5,8 "vehicle_requirements": {9 "special_features": [10 "lift_gate",11 "refrigeration"12 ],13 "fuel_type": "hybrid"14 },15 "image_url": "https://example.com/images/delivery-van-plus.jpg",16 "active": true17}'Response examples
1{2 "success": true,3 "message": "Vehicle updated successfully"4}Delete Vehicle
/delivery/vehicles/:vehicleIdSoft delete a vehicle (sets active = false). Requires manage:operations:tenant permission.
Path parameters
| Parameter | Type | Description |
|---|---|---|
vehicleIdRequired | string | ID of the vehicle to delete Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | Tenant ID (optional if in auth token) |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request DELETE "https://staging-api.ondi.io/functions/v1/delivery/vehicles/${VEHICLEID}?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Vehicle deactivated successfully"4}