TaxCalculatorServiceGetCalculatedWeigth Method |
OFV Kjøretøydata service
Weight calculation for vehicle imported into Norway.
Returns weight
Namespace:
OfvTaxData.Service
Assembly:
OfvTaxData.Service (in OfvTaxData.Service.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic TaxDTO GetCalculatedWeigth(
UserDTO user,
int vehicleGroup,
string date,
decimal totalTax,
int power,
string co2,
string nox,
int fuel,
Nullable<int> batteryRange,
string format
)
Parameters
- user
- Type: OfvService.DTO.LoginUserDTO
UserDTO - vehicleGroup
- Type: SystemInt32
Vehiclegroup code for vehicle to calculate tax for - date
- Type: SystemString
Current date or a date back inn time for history taxes - totalTax
- Type: SystemDecimal
Total tax for vehicle import - power
- Type: SystemInt32
Power of combustion engine (do not specify electric engine power or total power of combustion- and electric-engine) - co2
- Type: SystemString
CO2 emission from combustion engine - nox
- Type: SystemString
NOx emmission from combustion engine - fuel
- Type: SystemInt32
Fuel code for combustion engine - batteryRange
- Type: SystemNullableInt32
Battery range for hybrid vehicle - format
- Type: SystemString
json/xml - which format result will be delivered in.
Return Value
Type:
TaxDTO
Return a object of
DTO with weight value in data field, status of request and a description that gives any exceptions.
Remarks
Examples
Here`s an example on how to calculate tax for a vehicle.
function callGetCalculatedWeight(serviceURI) {
var jsonData = JSON.stringify(
{
"user": {
"username": "username",
"password": "encrypted password",
"ipaddress": "internet ip-address of requester"
},
"vehicleGroup": 101,
"date": "2018-06-01",
"totalTax": 35922,
"power": 100,
"co2": 100,
"nox": 10,
"fuel": 1,
"energysource": 2,
"batteryRange": 50
}
);
$.ajax({
url: serviceURI + "/GetCalculatedWeight?format=json",
type: "POST",
data: jsonData,
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (result) {
alert(result.SendResult);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert('ServiceError');
}
});
}{"success":true,"data":1000}
See Also