Skip to main content

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 TypeExample URL
POST{{url_base}}/PostAddVehicle
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddVehicle"

Input Parameters

ParameterTypeRequiredDescription
VehicleNoString(10)NoExternal code of the vehicle
VehiclePlateNoString(8)YesVehicle plate
NameString(40)YesVehicle description
ShortNameString(15)NoShort description of the vehicle
TransporterNoString(25)YesExternal code of the Transporter
DriverNoString(25)YesExternal code of the Driver
VehicleTypeNoString(15)NoExternal code of the Vehicle Type
StandardTareFloatNoVehicle Standard Tare
TareToleranceFloatNoTare Tolerance
FreightFactorFloatNoSlaughtered Freight Factor
KmValueFloatNoKm Value
KgValueFloatNoKg Value
LoadCapacityFloatNoLoad Capacity
StateInitialsString(10)NoVehicle state initials
SealQtyIntegerNoSeal quantity
VehicleIdentificationString(15)NoVehicle identification
IsInactiveVehicleBooleanNoFlag indicating that the vehicle is inactive
TruckTypeTruckTypeNoEnumerator 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)
LogisticsTypeNoString(25)NoLogistics Type
IsLoadWithInsuranceBooleanNoFlag indicating that the load is insured
IsNotReleasedLoadingBooleanNoFlag indicating that the vehicle is NOT released for loading (true = not released, false = released)
IsNotAvailableBooleanNoFlag indicating that the vehicle is NOT available (true = not available, false = available)
TransportTypeNoString(25)NoExternal code of the Transport Type
OwnVehicleBooleanNoFlag indicating that it is an own vehicle
OverwriteIfExistsBooleanNoFlag indicating that data should be overwritten if the record already exists

Return

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard WebService response information in method execution
VehicleCodeIntegerYesInternal 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

CodeMessage
AVH‑001External Transporter Code parameter (TransporterNo) belongs to a supplier that is not of type "Transporter". Operation not allowed!
AVH‑002The provided Vehicle Plate parameter (VehiclePlateNo) already exists!
AVH‑003There is no default Transporter for the informed plate ([value sent in request])!
AVH‑004There is no default Driver for the informed plate ([value sent in request])!