{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.1.0-rc.4/core/vehicle-item.json",
  "title": "Vehicle Item",
  "description": "A vehicle listing within a vehicle-type catalog. Carries the make/model, pricing, and specification data that platforms use for automotive inventory ads. Maps to Meta Automotive Inventory Ads, Microsoft Auto Inventory feeds, Google vehicle ads, and similar formats.",
  "type": "object",
  "properties": {
    "vehicle_id": {
      "type": "string",
      "description": "Unique identifier for this vehicle listing."
    },
    "title": {
      "type": "string",
      "description": "Listing title (e.g., '2024 Honda Civic EX Sedan')."
    },
    "make": {
      "type": "string",
      "description": "Vehicle manufacturer (e.g., 'Honda', 'Ford', 'BMW')."
    },
    "model": {
      "type": "string",
      "description": "Vehicle model (e.g., 'Civic', 'F-150', 'X5')."
    },
    "year": {
      "type": "integer",
      "minimum": 1900,
      "description": "Model year."
    },
    "price": {
      "$ref": "/schemas/3.1.0-rc.4/core/price.json",
      "description": "Vehicle price."
    },
    "condition": {
      "type": "string",
      "enum": ["new", "used", "certified_pre_owned"],
      "description": "Vehicle condition."
    },
    "vin": {
      "type": "string",
      "description": "Vehicle Identification Number (17-character VIN)."
    },
    "trim": {
      "type": "string",
      "description": "Trim level (e.g., 'EX', 'Limited', 'Sport')."
    },
    "mileage": {
      "type": "object",
      "description": "Odometer reading.",
      "properties": {
        "value": {
          "type": "number",
          "minimum": 0,
          "description": "Mileage value."
        },
        "unit": {
          "type": "string",
          "enum": ["km", "mi"],
          "description": "Distance unit."
        }
      },
      "required": ["value", "unit"],
      "additionalProperties": false
    },
    "body_style": {
      "type": "string",
      "enum": ["sedan", "suv", "truck", "coupe", "convertible", "wagon", "van", "hatchback"],
      "description": "Vehicle body style."
    },
    "transmission": {
      "type": "string",
      "enum": ["automatic", "manual", "cvt"],
      "description": "Transmission type."
    },
    "fuel_type": {
      "type": "string",
      "enum": ["gasoline", "diesel", "electric", "hybrid", "plug_in_hybrid"],
      "description": "Fuel or powertrain type."
    },
    "exterior_color": {
      "type": "string",
      "description": "Exterior color."
    },
    "interior_color": {
      "type": "string",
      "description": "Interior color."
    },
    "location": {
      "type": "object",
      "description": "Dealer or vehicle location.",
      "properties": {
        "lat": {
          "type": "number",
          "minimum": -90,
          "maximum": 90,
          "description": "Latitude in decimal degrees (WGS 84)."
        },
        "lng": {
          "type": "number",
          "minimum": -180,
          "maximum": 180,
          "description": "Longitude in decimal degrees (WGS 84)."
        }
      },
      "required": ["lat", "lng"],
      "additionalProperties": false
    },
    "image_url": {
      "type": "string",
      "format": "uri",
      "description": "Primary vehicle image URL."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Vehicle listing page URL."
    },
    "tags": {
      "type": "array",
      "description": "Tags for filtering (e.g., 'low-mileage', 'one-owner', 'dealer-certified').",
      "items": {
        "type": "string"
      },
      "minItems": 1
    },
    "assets": {
      "type": "array",
      "description": "Typed creative asset pools for this vehicle. Uses the same OfferingAssetGroup structure as offering-type catalogs. Standard group IDs: 'images_landscape' (exterior hero), 'images_vertical' (9:16 for Stories), 'images_square' (1:1). Enables formats to declare typed image requirements that map unambiguously to the right asset regardless of platform.",
      "items": {
        "$ref": "/schemas/3.1.0-rc.4/core/offering-asset-group.json"
      },
      "minItems": 1
    },
    "ext": {
      "$ref": "/schemas/3.1.0-rc.4/core/ext.json"
    }
  },
  "required": ["vehicle_id", "title", "make", "model", "year"],
  "additionalProperties": true,
  "examples": [
    {
      "description": "New sedan at dealership",
      "data": {
        "vehicle_id": "dlr-2024-civic-001",
        "title": "2024 Honda Civic EX Sedan",
        "make": "Honda",
        "model": "Civic",
        "year": 2024,
        "trim": "EX",
        "price": { "amount": 28500, "currency": "USD" },
        "condition": "new",
        "body_style": "sedan",
        "transmission": "cvt",
        "fuel_type": "gasoline",
        "exterior_color": "Lunar Silver Metallic",
        "image_url": "https://images.acmemotors.com/civic-ex-2024.jpg",
        "url": "https://acmemotors.com/inventory/civic-001",
        "tags": ["new-arrival"]
      }
    },
    {
      "description": "Used electric SUV",
      "data": {
        "vehicle_id": "dlr-2022-my-042",
        "title": "2022 Tesla Model Y Long Range",
        "make": "Tesla",
        "model": "Model Y",
        "year": 2022,
        "price": { "amount": 38900, "currency": "USD" },
        "condition": "used",
        "vin": "5YJYGDEE4NF123456",
        "mileage": { "value": 28000, "unit": "mi" },
        "body_style": "suv",
        "fuel_type": "electric",
        "url": "https://acmemotors.com/inventory/my-042",
        "tags": ["low-mileage", "one-owner"]
      }
    }
  ]
}
