Adds a Vehicle.
EmployeeId must be set to 0 for poolcars and to a valid employee id for an employee-owned car.
To add or remove an employee - poolcar association, please use the relevant link and un-link patches
Name | Description | Additional information |
---|---|---|
request | The Vehicle to add. When adding a new Vehicle through the API, the following properties are required: Id: Must be set to 0, or the add will throw an error. Make: The Vehicle must have a make / manufacturer. Model: The Vehicle must have a model / type. Registration: Every Vehicle must have a registration. Engine Size: The engine size, in cubic centimetre (cc) must be provided. EmployeeId: Must be set to 0 for poolcars and to a non-zero number for an employee-owned car. |
Define this parameter in the request body. |
{ "Id": 0, "Make": "Make", "Model": "Model", "Registration": "Registration", "UnitOfMeasure": 0, "FuelType": 1, "EngineSize": 2000, "IsActive": true, "IsExemptFromHomeToLocationMileage": false, "CarUsageStartDate": null, "CarUsageEndDate": null, "FinancialYearId": null, "MileageCategoryIds": [ 1, 3 ], "OdometerReadings": { "OdometerReadingRequired": false, "StartOdometerReading": 0, "EndOdometerReading": 0, "OdometerReadingList": [ 1, 2, 3 ] }, "Approved": true, "EmployeeId": null, "PoolCarUsers": [ 1 ], "UserDefined": null, "VehicleTypeId": 0, "VehicleDescription": null, "IsPoolVehicle": false, "PreviousVehicleId": 0, "UnapprovedVehicleCount": 0, "TaxExpiry": null, "IsTaxValid": false, "MotExpiry": null, "IsMotValid": false, "MotStart": null }
<Vehicle xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Types"> <Approved>true</Approved> <CarUsageEndDate i:nil="true" /> <CarUsageStartDate i:nil="true" /> <EmployeeId i:nil="true" /> <EngineSize>2000</EngineSize> <FinancialYearId i:nil="true" /> <FuelType>1</FuelType> <Id>0</Id> <IsActive>true</IsActive> <IsExemptFromHomeToLocationMileage>false</IsExemptFromHomeToLocationMileage> <IsMotValid>false</IsMotValid> <IsPoolVehicle>false</IsPoolVehicle> <IsTaxValid>false</IsTaxValid> <Make>Make</Make> <MileageCategoryIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:int>1</d2p1:int> <d2p1:int>3</d2p1:int> </MileageCategoryIds> <Model>Model</Model> <MotExpiry i:nil="true" /> <MotStart i:nil="true" /> <OdometerReadings> <EndOdometerReading>0</EndOdometerReading> <OdometerReadingRequired>false</OdometerReadingRequired> <StartOdometerReading>0</StartOdometerReading> </OdometerReadings> <PoolCarUsers xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:int>1</d2p1:int> </PoolCarUsers> <PreviousVehicleId>0</PreviousVehicleId> <Registration>Registration</Registration> <TaxExpiry i:nil="true" /> <UnapprovedVehicleCount>0</UnapprovedVehicleCount> <UnitOfMeasure>Mile</UnitOfMeasure> <UserDefined i:nil="true" /> <VehicleDescription i:nil="true" /> <VehicleTypeId>None</VehicleTypeId> </Vehicle>
Sample not available.
{ "Item": { "Id": 1, "Make": "sample string 2", "Model": "sample string 3", "Registration": "sample string 4", "UnitOfMeasure": 0, "FuelType": 5, "EngineSize": 6, "IsActive": true, "IsExemptFromHomeToLocationMileage": true, "CarUsageStartDate": "2025-01-26T06:53:19.3315972+00:00", "CarUsageEndDate": "2025-01-26T06:53:19.3315972+00:00", "FinancialYearId": 1, "MileageCategoryIds": [ 1, 2, 3 ], "OdometerReadings": { "OdometerReadingRequired": true, "StartOdometerReading": 2, "EndOdometerReading": 3, "OdometerReadingList": [ 1, 2, 3 ] }, "Approved": true, "EmployeeId": 1, "PoolCarUsers": [ 1, 2, 3 ], "UserDefined": null, "VehicleTypeId": 0, "VehicleDescription": "sample string 10", "IsPoolVehicle": true, "PreviousVehicleId": 12, "UnapprovedVehicleCount": 13, "TaxExpiry": "sample string 14", "IsTaxValid": true, "MotExpiry": "sample string 16", "IsMotValid": true, "MotStart": "sample string 18" }, "ResponseInformation": { "Errors": [ { "ErrorCode": "sample string 1", "Message": "sample string 2" }, { "ErrorCode": "sample string 1", "Message": "sample string 2" }, { "ErrorCode": "sample string 1", "Message": "sample string 2" } ], "Status": 0, "Links": [ { "Rel": "sample string 1", "Href": "sample string 2", "Title": "sample string 3", "IsTemplated": true }, { "Rel": "sample string 1", "Href": "sample string 2", "Title": "sample string 3", "IsTemplated": true }, { "Rel": "sample string 1", "Href": "sample string 2", "Title": "sample string 3", "IsTemplated": true } ] } }
<VehicleResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Responses"> <ResponseInformation xmlns="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Common"> <Errors> <ApiErrorDetail> <ErrorCode>sample string 1</ErrorCode> <Message>sample string 2</Message> </ApiErrorDetail> <ApiErrorDetail> <ErrorCode>sample string 1</ErrorCode> <Message>sample string 2</Message> </ApiErrorDetail> <ApiErrorDetail> <ErrorCode>sample string 1</ErrorCode> <Message>sample string 2</Message> </ApiErrorDetail> </Errors> <Links> <Link> <Href>sample string 2</Href> <IsTemplated>true</IsTemplated> <Rel>sample string 1</Rel> <Title>sample string 3</Title> </Link> <Link> <Href>sample string 2</Href> <IsTemplated>true</IsTemplated> <Rel>sample string 1</Rel> <Title>sample string 3</Title> </Link> <Link> <Href>sample string 2</Href> <IsTemplated>true</IsTemplated> <Rel>sample string 1</Rel> <Title>sample string 3</Title> </Link> </Links> <Status>Failure</Status> </ResponseInformation> <Item xmlns:d2p1="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Types" xmlns="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Common"> <d2p1:Approved>true</d2p1:Approved> <d2p1:CarUsageEndDate>2025-01-26T06:53:19.3315972+00:00</d2p1:CarUsageEndDate> <d2p1:CarUsageStartDate>2025-01-26T06:53:19.3315972+00:00</d2p1:CarUsageStartDate> <d2p1:EmployeeId>1</d2p1:EmployeeId> <d2p1:EngineSize>6</d2p1:EngineSize> <d2p1:FinancialYearId>1</d2p1:FinancialYearId> <d2p1:FuelType>5</d2p1:FuelType> <d2p1:Id>1</d2p1:Id> <d2p1:IsActive>true</d2p1:IsActive> <d2p1:IsExemptFromHomeToLocationMileage>true</d2p1:IsExemptFromHomeToLocationMileage> <d2p1:IsMotValid>true</d2p1:IsMotValid> <d2p1:IsPoolVehicle>true</d2p1:IsPoolVehicle> <d2p1:IsTaxValid>true</d2p1:IsTaxValid> <d2p1:Make>sample string 2</d2p1:Make> <d2p1:MileageCategoryIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:int>1</d3p1:int> <d3p1:int>2</d3p1:int> <d3p1:int>3</d3p1:int> </d2p1:MileageCategoryIds> <d2p1:Model>sample string 3</d2p1:Model> <d2p1:MotExpiry>sample string 16</d2p1:MotExpiry> <d2p1:MotStart>sample string 18</d2p1:MotStart> <d2p1:OdometerReadings> <d2p1:EndOdometerReading>3</d2p1:EndOdometerReading> <d2p1:OdometerReadingRequired>true</d2p1:OdometerReadingRequired> <d2p1:StartOdometerReading>2</d2p1:StartOdometerReading> </d2p1:OdometerReadings> <d2p1:PoolCarUsers xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:int>1</d3p1:int> <d3p1:int>2</d3p1:int> <d3p1:int>3</d3p1:int> </d2p1:PoolCarUsers> <d2p1:PreviousVehicleId>12</d2p1:PreviousVehicleId> <d2p1:Registration>sample string 4</d2p1:Registration> <d2p1:TaxExpiry>sample string 14</d2p1:TaxExpiry> <d2p1:UnapprovedVehicleCount>13</d2p1:UnapprovedVehicleCount> <d2p1:UnitOfMeasure>Mile</d2p1:UnitOfMeasure> <d2p1:UserDefined i:nil="true" /> <d2p1:VehicleDescription>sample string 10</d2p1:VehicleDescription> <d2p1:VehicleTypeId>None</d2p1:VehicleTypeId> </Item> </VehicleResponse>