{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/carstat-app/json-schema/carstat-app-vin-decode-response-schema.json",
  "title": "vin_decode_response",
  "description": "A decoded VIN. Returned by GET /v1/vin-decode/{vin}, which performs no specification lookup: use it to identify or validate a VIN cheaply, and for vehicles the specification catalog does not cover. Every field is decoded from the VIN itself: the vehicle it identifies, the registered manufacturer and origin, the vehicle class, the VIN's own series/trim labels, the engine manufacturer, the check-digit verification and the manufacturing (build) plant. Body type, doors, drivetrain, fuel and engine specifications are not included: those are vehicle specifications, available from the specification endpoints. Each field is null when it cannot be determined from the VIN.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/carstat-app-vin-decoding-api-openapi.yml#/components/schemas/vin_decode_response",
  "type": "object",
  "properties": {
    "vin": {
      "type": "string",
      "description": "The VIN that was decoded, upper-cased."
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Non-fatal VIN validation warnings, if any."
    },
    "make": {
      "type": [
        "string",
        "null"
      ],
      "description": "Manufacturer decoded from the VIN"
    },
    "model": {
      "type": [
        "string",
        "null"
      ],
      "description": "Model decoded from the VIN, normalised to the name used in the catalog. Null when the VIN identifies the manufacturer but not a specific model."
    },
    "year": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Model year decoded from VIN position 10"
    },
    "wmi": {
      "type": [
        "string",
        "null"
      ],
      "description": "World Manufacturer Identifier (VIN positions 1-3)."
    },
    "manufacturer": {
      "type": [
        "string",
        "null"
      ],
      "description": "Registered manufacturer name, e.g. \"TESLA, INC.\" — distinct from the vehicle make/brand."
    },
    "region": {
      "type": [
        "string",
        "null"
      ],
      "description": "Geographic region of manufacture, e.g. \"ASIA\", \"NORTH AMERICA\", \"EUROPE\"."
    },
    "country": {
      "type": [
        "string",
        "null"
      ],
      "description": "Manufacturing country decoded from the VIN/WMI."
    },
    "vehicle_type": {
      "type": [
        "string",
        "null"
      ],
      "description": "Vehicle class registered for this VIN, e.g. \"Passenger Car\", \"Truck\", \"Multipurpose Passenger Vehicle (MPV)\". A broader classification than the body type in the spec candidates."
    },
    "series": {
      "type": [
        "string",
        "null"
      ],
      "description": "Vehicle series / sub-model as decoded from the VIN."
    },
    "trim": {
      "type": [
        "string",
        "null"
      ],
      "description": "Trim level as decoded from the VIN."
    },
    "engine_manufacturer": {
      "type": [
        "string",
        "null"
      ],
      "description": "Company that built the engine, which is not always the vehicle's make. Not available for all manufacturers."
    },
    "check_digit": {
      "type": [
        "object",
        "null"
      ],
      "description": "Verification of the VIN's check digit (position 9), which is derived from the other 16 characters. A mismatch usually means the VIN was mistyped or transcribed incorrectly; `expected` gives the character the rest of the VIN implies. Decoding still proceeds, since some regions do not use a check digit.",
      "properties": {
        "actual": {
          "type": [
            "string",
            "null"
          ],
          "description": "Check digit character present in the supplied VIN (VIN position 9)."
        },
        "expected": {
          "type": [
            "string",
            "null"
          ],
          "description": "Check digit character the rest of the VIN implies."
        },
        "is_valid": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the supplied check digit matches the expected one."
        }
      }
    },
    "plant": {
      "type": [
        "object",
        "null"
      ],
      "description": "Manufacturing (build) plant decoded from the VIN. Null when the VIN does not encode a plant for this vehicle (not available for all manufacturers).",
      "properties": {
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "Plant country."
        },
        "city": {
          "type": [
            "string",
            "null"
          ],
          "description": "Plant city."
        },
        "state": {
          "type": [
            "string",
            "null"
          ],
          "description": "Plant state or province. Not available for all plants."
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "Plant code (VIN position 11)."
        },
        "manufacturer": {
          "type": [
            "string",
            "null"
          ],
          "description": "Plant operator/manufacturer."
        }
      }
    }
  },
  "required": [
    "vin",
    "errors",
    "make",
    "model",
    "year",
    "wmi",
    "manufacturer",
    "region",
    "country",
    "vehicle_type",
    "series",
    "trim",
    "engine_manufacturer",
    "check_digit",
    "plant"
  ]
}