mobilidade

Cadastrar veículo

Changed on

Cadastra um veículo para o CPF autenticado. Fluxo catálogo (brand_id+model_id), híbrido (brand_id + model_other sem model_id) ou Outro livre (brand_other/model_other+vehicle_type). URLs de foto devem ser HTTPS GCS. Se has_invoice=true, invoice_photo_url é obrigatória. Contato do dono (nome/telefone/e-mail) é enriquecido ao vivo via RMI a partir do owner_cpf — não enviar owner_* no body. registration_number é gerado pelo backend (formato RJ-E-XXXXXX).

post/citizen/{cpf}/vehicles

Request

  • Base URL: http://localhost:8080/v1
  • URL: http://localhost:8080/v1/citizen/{cpf}/vehicles
  • Auth: API key in header Authorization

Path parameters

cpfstring required

CPF do cidadão (11 dígitos)

Request body

brand_idstring nullable
brand_otherstring nullable
colorstring required
display_namestring required
has_invoiceboolean required
invoice_photo_file_namestring
invoice_photo_file_sizeinteger
invoice_photo_urlstring nullable
model_idstring nullable
model_otherstring nullable
self_declarationboolean required
serial_numberstring required
serial_number_photo_file_namestring
serial_number_photo_file_sizeinteger
serial_number_photo_urlstring required
vehicle_photo_file_namestring
vehicle_photo_file_sizeinteger
vehicle_photo_urlstring required
vehicle_type'bicicleta_eletrica' | 'autopropelido' | 'ciclomotor'

Response

Veículo criado

brand_idstring nullable
brand_namestring nullable

BrandName is response-only: catalog brand name when brand_id is set and brand_other is empty.

brand_otherstring nullable
colorstring
conductor_idstring
created_atstring
deleted_atstring
display_namestring
has_invoiceboolean
idstring
invoice_photo_file_namestring
invoice_photo_file_sizeinteger
invoice_photo_urlstring nullable
model_idstring nullable
model_namestring nullable

ModelName is response-only: catalog model name when model_id is set and model_other is empty.

model_otherstring nullable
owner_cpfstring
owner_emailstring
owner_namestring
owner_phonestring
registration_numberstring

RegistrationNumber is a short wallet identifier generated on create (format RJ-E-XXXXXX). Not accepted in POST/PATCH.

role'owner' | 'conductor'
self_declarationboolean
serial_numberstring
serial_number_photo_file_namestring

Optional file metadata for UI detail (Apêndice A.4).

serial_number_photo_file_sizeinteger
serial_number_photo_urlstring
updated_atstring
vehicle_photo_file_namestring
vehicle_photo_file_sizeinteger
vehicle_photo_urlstring
vehicle_type'bicicleta_eletrica' | 'autopropelido' | 'ciclomotor'

Example response

{
  "registration_number": "RJ-E-000001"
}

Changes