{"openapi":"3.0.3","info":{"title":"Consulta de chapas DINATRAN","version":"1.0.0","description":"API HTTP para consultar placas nacionais paraguaias no serviço público da DINATRAN (mostrarplacanacional). Não há persistência em disco ou banco: apenas cache e rate limit em memória.\n","contact":{"name":"MercoSys"}},"servers":[{"url":"http://localhost:3000","description":"Ambiente local"}],"paths":{"/api/placa/{placa}":{"get":{"operationId":"getPlaca","summary":"Consultar dados de uma placa nacional","description":"Normaliza a placa (maiúsculas, remove espaços e hífens), valida o formato, consulta a DINATRAN e devolve JSON estável. Requer Bearer token.\n","security":[{"bearerAuth":[]}],"parameters":[{"name":"placa","in":"path","required":true,"description":"Placa nacional (ex. AAHH728 ou ABC123)","schema":{"type":"string","pattern":"^[A-Za-z]{3,4}[-\\s]?[0-9]{3,4}$","example":"AAHH728"}}],"responses":{"200":{"description":"Consulta bem-sucedida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsultaPlaca"},"example":{"placa":"AAHH728","fonte":"DINATRAN","consultadoEm":"2026-10-19T17:30:00.000Z","proprietario":{"nome":"26518-TRANSPORTADORA ESPECIALIZADA DE CARGAS S.A.","documento":"********-7","cedula":null,"ruc":"********-7","endereco":"MADAN LINCH CASI AVIADORES DEL CHACO-ASUNCION","telefone":"0981******"},"habilitacao":{"numero":"2298674","vencimento":"2027-08-10","situacao":"VIGENTE","estado":null},"veiculo":{"ano":2018,"marca":"IVECO","tipo":"CAMION FURGON","chassi":"93ZE12JMZK8934465","servico":"CARGA NACIONAL","eixos":3,"pesoKg":24000,"codigoSeguranca":"0","jornais":0},"chapaProvisoria":null,"dataBaixa":null,"observacoes":"Orden de Insp. Nº: 0","multas":[],"inspecoes":[{"ano":2021,"codigoTaller":"CITV1107","taller":"CITV IVESUR S.A. ASUNCION","dataInspecao":"2021-08-10","planilha":"16566","certificado":"933075","vencimento":"2022-08-10","resultado":"APROBADA","classe":"Permisionaria"}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"}}}},"/api/openapi.json":{"get":{"operationId":"getOpenApi","summary":"Especificação OpenAPI em JSON","security":[],"responses":{"200":{"description":"Documento OpenAPI","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Token definido em API_TOKENS (lista separada por vírgulas, opcionalmente nome:token)"}},"responses":{"Error":{"description":"Erro padronizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"UNAUTHORIZED","message":"Token ausente ou inválido. Envie Authorization: Bearer <token>.","status":401}}}}}},"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","status"],"properties":{"code":{"type":"string","enum":["INVALID_PLATE","UNAUTHORIZED","NOT_FOUND","RATE_LIMITED","UPSTREAM_ERROR","UNPARSEABLE","TIMEOUT"]},"message":{"type":"string"},"status":{"type":"integer"}}}}},"ConsultaPlaca":{"type":"object","required":["placa","fonte","consultadoEm","proprietario","habilitacao","veiculo","chapaProvisoria","dataBaixa","observacoes","multas","inspecoes"],"properties":{"placa":{"type":"string","example":"AAHH728"},"fonte":{"type":"string","enum":["DINATRAN"]},"consultadoEm":{"type":"string","format":"date-time"},"proprietario":{"$ref":"#/components/schemas/Proprietario"},"habilitacao":{"$ref":"#/components/schemas/Habilitacao"},"veiculo":{"$ref":"#/components/schemas/Veiculo"},"chapaProvisoria":{"type":"string","nullable":true},"dataBaixa":{"type":"string","format":"date","nullable":true},"observacoes":{"type":"string","nullable":true},"multas":{"type":"array","items":{"$ref":"#/components/schemas/Multa"}},"inspecoes":{"type":"array","items":{"$ref":"#/components/schemas/InspecaoTecnica"}}}},"Proprietario":{"type":"object","properties":{"nome":{"type":"string","nullable":true},"documento":{"type":"string","nullable":true,"description":"RUC se existir, senão cédula"},"cedula":{"type":"string","nullable":true},"ruc":{"type":"string","nullable":true},"endereco":{"type":"string","nullable":true},"telefone":{"type":"string","nullable":true}}},"Habilitacao":{"type":"object","properties":{"numero":{"type":"string","nullable":true},"vencimento":{"type":"string","format":"date","nullable":true},"situacao":{"type":"string","nullable":true},"estado":{"type":"string","nullable":true}}},"Veiculo":{"type":"object","properties":{"ano":{"type":"integer","nullable":true},"marca":{"type":"string","nullable":true},"tipo":{"type":"string","nullable":true},"chassi":{"type":"string","nullable":true},"servico":{"type":"string","nullable":true},"eixos":{"type":"integer","nullable":true},"pesoKg":{"type":"number","nullable":true},"codigoSeguranca":{"type":"string","nullable":true},"jornais":{"type":"number","nullable":true}}},"InspecaoTecnica":{"type":"object","properties":{"ano":{"type":"integer","nullable":true},"codigoTaller":{"type":"string","nullable":true},"taller":{"type":"string","nullable":true},"dataInspecao":{"type":"string","format":"date","nullable":true},"planilha":{"type":"string","nullable":true},"certificado":{"type":"string","nullable":true},"vencimento":{"type":"string","format":"date","nullable":true},"resultado":{"type":"string","nullable":true},"classe":{"type":"string","nullable":true}}},"Multa":{"type":"object","properties":{"acta":{"type":"string","nullable":true},"serie":{"type":"string","nullable":true},"data":{"type":"string","format":"date","nullable":true},"rubro":{"type":"string","nullable":true},"subrubro":{"type":"string","nullable":true},"conceito":{"type":"string","nullable":true},"jornais":{"type":"number","nullable":true},"importe":{"type":"number","nullable":true},"dolares":{"type":"number","nullable":true},"nroResolucao1":{"type":"string","nullable":true},"nroResolucao2":{"type":"string","nullable":true},"expediente":{"type":"string","nullable":true}}}}}}