Create Vehicle / Crear Vehiculo
POST
/external/vehiculo
const url = 'https://api-dev.zonaparqueo.com/external/vehiculo';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"cliente_id":1,"placa":"example","nombre":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api-dev.zonaparqueo.com/external/vehiculo \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "cliente_id": 1, "placa": "example", "nombre": "example" }'Crea un vehiculo vinculando una placa con un cliente. Es el paso 2 del
alta: requiere que la placa ya exista (ver POST /external/placa).
Authorizations
Sección titulada «Authorizations»Request Bodyrequired
Sección titulada «Request Bodyrequired»Media typeapplication/json
object
cliente_id
required
Identificador del cliente
integer
placa
required
Placa del vehiculo
string
nombre
Nombre o alias del vehiculo (opcional)
string
Examplegenerated
{ "cliente_id": 1, "placa": "example", "nombre": "example"}Responses
Sección titulada «Responses»Vehiculo creado exitosamente
Media typeapplication/json
object
estado
string
data
object
id
Identificador del vehiculo
integer
nombre
Nombre o alias del vehiculo
string
placa
Placa del vehiculo
string
cliente_id
Identificador del cliente
integer
activado
Estado de activacion
integer
favorito
Marcado como favorito
integer
Examples
Examplesuccess
{ "estado": "ok", "data": { "id": 10, "nombre": "Mi carro", "placa": "ABC123", "cliente_id": 5, "activado": 1, "favorito": 0 }}Error de validacion
Media typeapplication/json
object
estado
string
error
Mensaje de error
string
errores
Detalle de errores por campo
object
Example
{ "estado": "fail"}