Vehicle
The PostAddVehicle endpoint is responsible for registering a new vehicle in the MIMS system and can be viewed on screen CAD056.
How to register a vehicle
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostAddVehicle |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddVehicle" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| VehicleNo | String(10) | No | External code of the vehicle |
| VehiclePlateNo | String(8) | Yes | Vehicle plate |
| Name | String(40) | Yes | Vehicle description |
| ShortName | String(15) | No | Short description of the vehicle |
| TransporterNo | String(25) | Yes | External code of the Transporter |
| DriverNo | String(25) | Yes | External code of the Driver |
| VehicleTypeNo | String(15) | No | External code of the Vehicle Type |
| StandardTare | Float | No | Vehicle Standard Tare |
| TareTolerance | Float | No | Tare Tolerance |
| FreightFactor | Float | No | Slaughtered Freight Factor |
| KmValue | Float | No | Km Value |
| KgValue | Float | No | Kg Value |
| LoadCapacity | Float | No | Load Capacity |
| StateInitials | String(10) | No | Vehicle state initials |
| SealQty | Integer | No | Seal quantity |
| VehicleIdentification | String(15) | No | Vehicle identification |
| IsInactiveVehicle | Boolean | No | Flag indicating that the vehicle is inactive |
| TruckType | TruckType | No | Enumerator with possible values for Body Type (MDFe): ttNotApplicable (Not Applicable), ttOpening (Open), ttClosedOrBoxTrust (Closed/Box Truck), ttTrailerTruck (Grain Truck), ttContainerDoor (Container Door) or ttSider (Sider) |
| LogisticsTypeNo | String(25) | No | Logistics Type |
| IsLoadWithInsurance | Boolean | No | Flag indicating that the load is insured |
| IsNotReleasedLoading | Boolean | No | Flag indicating that the vehicle is NOT released for loading (true = not released, false = released) |
| IsNotAvailable | Boolean | No | Flag indicating that the vehicle is NOT available (true = not available, false = available) |
| TransportTypeNo | String(25) | No | External code of the Transport Type |
| OwnVehicle | Boolean | No | Flag indicating that it is an own vehicle |
| OverwriteIfExists | Boolean | No | Flag indicating that data should be overwritten if the record already exists |
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
| VehicleCode | Integer | Yes | Internal vehicle code generated in the MIMS system |
Request Example
curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddVehicle"' \
--header 'Content-Type: application/json' \
--data '{
"VehicleNo": "VEH12345",
"VehiclePlateNo": "ABC1234",
"Name": "Caminhão Beta",
"ShortName": "CamBeta",
"TransporterNo": "TRANS001",
"DriverNo": "DRV5678",
"VehicleTypeNo": "TRK001",
"StandardTare": 7800.5,
"TareTolerance": 300.0,
"FreightFactor": 1.2,
"KmValue": 2.5,
"KgValue": 0.45,
"LoadCapacity": 15000,
"StateInitials": "SP",
"SealQty": 4,
"VehicleIdentification": "ID98765",
"IsInactiveVehicle": false,
"TruckType": "ttClosedOrBoxTrust",
"LogisticsTypeNo": "LOG987",
"IsLoadWithInsurance": true,
"IsNotReleasedLoading": false,
"IsNotAvailable": false,
"TransportTypeNo": "TP001",
"OwnVehicle": true,
"OverwriteIfExists": true
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"VehicleCode": 202
}
🐞 Possible Errors
| Code | Message |
|---|---|
| AVH‑001 | External Transporter Code parameter (TransporterNo) belongs to a supplier that is not of type "Transporter". Operation not allowed! |
| AVH‑002 | The provided Vehicle Plate parameter (VehiclePlateNo) already exists! |
| AVH‑003 | There is no default Transporter for the informed plate ([value sent in request])! |
| AVH‑004 | There is no default Driver for the informed plate ([value sent in request])! |