Update vehicle
curl --request PATCH \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"make_and_model": "<string>",
"year": 123,
"license_plate": "<string>",
"vin": "<string>",
"description": "<string>",
"is_primary": true
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId}"
payload = {
"external_id": "<string>",
"make_and_model": "<string>",
"year": 123,
"license_plate": "<string>",
"vin": "<string>",
"description": "<string>",
"is_primary": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: '<string>',
make_and_model: '<string>',
year: 123,
license_plate: '<string>',
vin: '<string>',
description: '<string>',
is_primary: true
})
};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => '<string>',
'make_and_model' => '<string>',
'year' => 123,
'license_plate' => '<string>',
'vin' => '<string>',
'description' => '<string>',
'is_primary' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId}"
payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"make_and_model\": \"<string>\",\n \"year\": 123,\n \"license_plate\": \"<string>\",\n \"vin\": \"<string>\",\n \"description\": \"<string>\",\n \"is_primary\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"make_and_model\": \"<string>\",\n \"year\": 123,\n \"license_plate\": \"<string>\",\n \"vin\": \"<string>\",\n \"description\": \"<string>\",\n \"is_primary\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"<string>\",\n \"make_and_model\": \"<string>\",\n \"year\": 123,\n \"license_plate\": \"<string>\",\n \"vin\": \"<string>\",\n \"description\": \"<string>\",\n \"is_primary\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"make_and_model": "<string>",
"year": 123,
"is_primary": true,
"is_eligible_for_deletion": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"type": "com.layerfi.routers.ApiVehicle",
"external_id": "<string>",
"license_plate": "<string>",
"vin": "<string>",
"description": "<string>",
"archived_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
}{
"type": "InvalidParameters",
"description": "<string>",
"error_enum": "InvalidPayload",
"meta": {}
}{
"type": "InvalidParameters",
"description": "<string>",
"error_enum": "InvalidPayload",
"meta": {}
}Vehicles
Update vehicle
Partially updates a vehicle. Only provided fields will be updated.
PATCH
/
v1
/
businesses
/
{businessId}
/
mileage
/
vehicles
/
{vehicleId}
Update vehicle
curl --request PATCH \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"make_and_model": "<string>",
"year": 123,
"license_plate": "<string>",
"vin": "<string>",
"description": "<string>",
"is_primary": true
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId}"
payload = {
"external_id": "<string>",
"make_and_model": "<string>",
"year": 123,
"license_plate": "<string>",
"vin": "<string>",
"description": "<string>",
"is_primary": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: '<string>',
make_and_model: '<string>',
year: 123,
license_plate: '<string>',
vin: '<string>',
description: '<string>',
is_primary: true
})
};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => '<string>',
'make_and_model' => '<string>',
'year' => 123,
'license_plate' => '<string>',
'vin' => '<string>',
'description' => '<string>',
'is_primary' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId}"
payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"make_and_model\": \"<string>\",\n \"year\": 123,\n \"license_plate\": \"<string>\",\n \"vin\": \"<string>\",\n \"description\": \"<string>\",\n \"is_primary\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"make_and_model\": \"<string>\",\n \"year\": 123,\n \"license_plate\": \"<string>\",\n \"vin\": \"<string>\",\n \"description\": \"<string>\",\n \"is_primary\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/mileage/vehicles/{vehicleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"<string>\",\n \"make_and_model\": \"<string>\",\n \"year\": 123,\n \"license_plate\": \"<string>\",\n \"vin\": \"<string>\",\n \"description\": \"<string>\",\n \"is_primary\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"make_and_model": "<string>",
"year": 123,
"is_primary": true,
"is_eligible_for_deletion": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"type": "com.layerfi.routers.ApiVehicle",
"external_id": "<string>",
"license_plate": "<string>",
"vin": "<string>",
"description": "<string>",
"archived_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
}{
"type": "InvalidParameters",
"description": "<string>",
"error_enum": "InvalidPayload",
"meta": {}
}{
"type": "InvalidParameters",
"description": "<string>",
"error_enum": "InvalidPayload",
"meta": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Content-Type must be set to application/json.
Path Parameters
The UUID of the business.
The UUID of the vehicle.
Body
application/json
All fields are optional. Only provided fields will be updated.
An optional external identifier for the vehicle.
The make and model of the vehicle.
The model year of the vehicle.
The license plate number of the vehicle.
The Vehicle Identification Number (VIN).
An optional description or notes about the vehicle.
Whether this should be the primary vehicle.
Response
The updated vehicle.
Show child attributes
Show child attributes
⌘I