Vehicles (Protected)

Create Vehicle

Create new vehicle.

Business rules:

  • IDempresa set from user's company
  • Ponto_de_venda set from user's PV if not provided
  • Dataentr defaults to now
  • Quadro must be unique within open vehicles
post/api/vehicles/

Headers

x-api-tokenstring nullable

Request body

Matriculastring nullable

Primary license plate

MatriculaSecundariastring nullable

Secondary license plate (national)

code_matriculastring nullable

Primary license plate country code

code_matricula_secundariastring nullable

Secondary license plate country code

Quadrostring nullable

VIN/Chassis number

Marcainteger nullable

Brand ID (FK to MarcasViatura)

Modelointeger nullable

Model ID (FK to ModelosViatura)

Versaostring nullable

Version/Trim

Kminteger nullable

Mileage in kilometers

Motorstring nullable

Engine code

Cilindradastring nullable

Engine displacement (cc)

Potenciastring nullable

Power (HP or kW)

Combustinteger nullable

Fuel type ID (FK to CombustivelViatura)

Caixainteger nullable

Gearbox ID (FK to CaixaVelocidadesViatura)

Corinteger nullable

Color ID (FK to CoresViatura)

Lugaresinteger nullable

Number of seats (FK to LugaresViatura)

Portasinteger nullable

Number of doors (FK to PortasViatura)

Pesostring nullable

Weight in kg

Segmentointeger nullable

Segment/Type ID (FK to TipoViatura)

Subsegmentointeger nullable

Subsegment ID (FK to Subsegmentos)

Estadointeger nullable

State ID (1=new, 2=sold, 3=reserved, 4=to close)

Preçonumber nullable

Sale price

ValorSelonumber nullable

Stamp tax value

RegimeIvainteger nullable

VAT regime ID (FK to RegimeIva)

Dataentrstring date-time nullable

Entry date

Datamatstring date-time nullable

First registration date

Data_Impstring date-time nullable

Import date

data_mat_nacionalstring date-time nullable

National registration date

ValInspstring date-time nullable

Inspection validity date

Forneceinteger nullable

Supplier ID (FK to Cliente)

Ponto_de_vendainteger nullable

Point of sale ID (FK to PontosDeVenda)

IDempresainteger nullable

Company ID - auto-set from authenticated user

current_park_location_idinteger nullable

Current physical park location (FK to Z_ParkLocations). Required when the vehicle is created with localizacao=0 (em parque). Validated at route layer to belong to the same company.

Consignadoboolean nullable

Consigned vehicle

Emprestadoboolean nullable

Loaned vehicle

Seguroboolean nullable

Insured

Importadoboolean nullable

Imported

stockpartilhadoboolean nullable

Shared stock

hiddenboolean nullable

Hidden from listings

fechadoboolean nullable

Closed

datafechostring date-time nullable

Close date

Fotosstring nullable

Photos JSON or CSV

bucketurlstring nullable

S3 bucket URL for main photo

Observacoesstring nullable

Observations/Notes

IDeasydatainteger nullable

EasyData ID

Estadoeasydatainteger nullable

EasyData state

referenceinteger nullable

External reference

version_idinteger nullable

Integrazu version ID

gearbox_type_idinteger nullable

Integrazu gearbox type ID

gearbox_shift_idinteger nullable

Integrazu gearbox shift ID

section_idinteger nullable

Integrazu section ID

second_key_status'sim' | 'não' | 'requisitado' nullable

Second-key status

Response

Successful Response

IDinteger required
Matriculastring nullable
MatriculaSecundariastring nullable
code_matriculastring nullable
code_matricula_secundariastring nullable
Quadrostring nullable
Marcainteger nullable
Modelointeger nullable
Versaostring nullable
Kminteger nullable
Motorstring nullable
Cilindradastring nullable
Potenciastring nullable
Combustinteger nullable
Caixainteger nullable
Corinteger nullable
Lugaresinteger nullable
Portasinteger nullable
Pesostring nullable
Segmentointeger nullable
Subsegmentointeger nullable
Estadointeger nullable
Preçonumber nullable
ValorSelonumber nullable
PreçoPinturanumber nullable
RegimeIvainteger nullable
Dataentrstring date-time nullable
Datamatstring date-time nullable
Data_Impstring date-time nullable
data_mat_nacionalstring date-time nullable
ValInspstring date-time nullable
datafechostring date-time nullable
Forneceinteger nullable
Ponto_de_Vendainteger nullable
IDempresainteger required
current_park_location_idinteger nullable
fechadoboolean nullable
consignadoboolean nullable
Emprestadoboolean nullable
Seguroboolean nullable
Importadoboolean nullable
stockpartilhadoboolean nullable
hiddenboolean nullable
Fotosstring nullable
bucketurlstring nullable
Observacoesstring nullable
IDeasydatainteger nullable
Estadoeasydatainteger nullable
referenceinteger nullable
version_idinteger nullable
gearbox_type_idinteger nullable
gearbox_shift_idinteger nullable
section_idinteger nullable
second_key_status'sim' | 'não' | 'requisitado' nullable

Changes