Adds a cut point record to the catalog. If the vehicle does not yet exist, pass vehicleId: null along with a vehicleData object to create both the vehicle and the cut in a single request. If the vehicle already exists, pass its vehicleId and omit vehicleData.
Endpoint: WRITE service
Action: addOrUpdateCut
Run checkVehicle before this action to determine whether you should create a new vehicle or attach the cut to an existing one.
Request
Must be "addOrUpdateCut".
The ID of an existing vehicle to attach the cut to, or null to create a new vehicle.
Required when vehicleId is null. Omit when attaching to an existing vehicle. Show vehicleData properties
Ignition type (e.g., "Convencional", "Push Button").
Applicable trims or versions.
Base64 data URL of the vehicle photo (e.g., "data:image/jpeg;base64,...").
The cut point details to add. Cut type. One of "Bomba de Combustible", "Señal al Botón", "Corte de Ición", or "Apertura de Puertas".
Relay configuration label for this cut.
Physical location description of the cut point.
Wire color at the cut point.
Base64 data URL of the cut point photo.
Name of the technician contributing this cut record.
Response
Always "success" on success.
The ID of the vehicle that was created or updated.
Example
const WRITE_ENDPOINT = 'https://script.google.com/macros/s/AKfycbyzP3RwEAqxJN8xzrqxjlsChx4xDgRuvpW-ygWM9teMHM0hWl0DDx91gR3TTR832BWakQ/exec' ;
// Adding a cut to a new vehicle
const response = await fetch ( WRITE_ENDPOINT , {
method: 'POST' ,
headers: { 'Content-Type' : 'text/plain' },
body: JSON . stringify ({
action: 'addOrUpdateCut' ,
payload: {
vehicleId: null ,
vehicleData: {
marca: 'Toyota' ,
modelo: 'Corolla' ,
anoDesde: '2020' ,
tipoEncendido: 'Push Button' ,
categoria: 'Automóviles' ,
versionesAplicables: 'XSE' ,
imagenVehiculo: 'data:image/jpeg;base64,/9j/4AAQ...'
},
cutData: {
tipoCorte1: 'Bomba de Combustible' ,
configRelay1: 'NA5' ,
ubicacionCorte1: 'Bajo el asiento trasero, conector gris 4 pines' ,
colorCableCorte1: 'Verde con blanco' ,
imgCorte1: 'data:image/jpeg;base64,/9j/4AAQ...'
},
colaborador: 'Juan Díaz'
}
}),
redirect: 'follow'
});
const result = await response . json ();
if ( result . status === 'success' ) {
console . log ( 'Vehicle ID:' , result . vehicleId );
}