Create Unit
Create a new unit of measure in Last Mile Intelligence.
Operation
Section titled “Operation”createUnit
Resource
Section titled “Resource”unit
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Unit Data | JSON | Yes | - | Unit object with required fields |
Unit Data Fields
Section titled “Unit Data Fields”| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Unit name |
| abbreviation | string | Yes | Short abbreviation |
| type | string | Yes | Unit type (volume, weight, length, count) |
| baseUnit | string | No | Base unit for conversion |
| conversionFactor | number | No | Conversion factor to base unit |
Response
Section titled “Response”Success
Section titled “Success”{ "id": "unit_new123", "name": "Cubic Yard", "abbreviation": "yd³", "type": "volume", "baseUnit": "liter", "conversionFactor": 764.555, "createdAt": "2024-06-21T09:00:00Z"}{ "success": false, "error": "Validation failed", "details": { "abbreviation": "Abbreviation already exists" }}Error Handling
Section titled “Error Handling”- Missing API Token: LMI credential is missing API token
- Duplicate Abbreviation: Unit abbreviation already exists
- Invalid Type: Unit type is not recognized
- Validation Error: Required fields missing or invalid
- Permission Denied: API token lacks permission for this operation