{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/transparent-pt/json-schema/transparent-pt-import-cost-result-schema.json",
  "title": "ImportCostResult",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/transparent-pt-openapi.yml#/components/schemas/ImportCostResult",
  "type": "object",
  "required": [
    "currency",
    "car",
    "transport_eur",
    "paperwork_eur",
    "service_eur",
    "isv_eur",
    "total_eur"
  ],
  "properties": {
    "currency": {
      "type": "string",
      "const": "EUR"
    },
    "car": {
      "type": "object",
      "properties": {
        "listing_price": {
          "type": "integer"
        },
        "vat_mode": {
          "type": "string",
          "enum": [
            "final",
            "gross",
            "net"
          ]
        },
        "seller_vat_pct": {
          "type": [
            "number",
            "null"
          ]
        },
        "net": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Net price when VAT applies."
        },
        "pt_iva_pct": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Portuguese IVA applied to the net price (23)."
        },
        "cost": {
          "type": "integer",
          "description": "Car cost landed in Portugal before transport / ISV."
        }
      }
    },
    "transport_eur": {
      "type": "integer",
      "description": "Germany → Portugal transport."
    },
    "paperwork_eur": {
      "type": "integer",
      "description": "Inspection",
      "IMT fees": null,
      "registration": null,
      "plates": null,
      "documents.": null
    },
    "service_eur": {
      "type": "integer",
      "description": "TransparentCars turnkey service."
    },
    "isv_eur": {
      "type": "integer",
      "description": "Vehicle registration tax (ISV)."
    },
    "total_eur": {
      "type": "integer",
      "description": "Turnkey total with Portuguese plates."
    },
    "above_listing_eur": {
      "type": "integer"
    },
    "iuc_per_year_eur": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Annual road tax — ownership cost",
      "not in the total.": null
    },
    "isv": {
      "$ref": "#/$defs/IsvResult"
    },
    "iuc": {
      "$ref": "#/$defs/IucResult"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "assumptions": {
      "type": "object"
    },
    "calculator": {
      "type": "string",
      "format": "uri"
    }
  },
  "$defs": {
    "IsvResult": {
      "type": "object",
      "description": "One-off registration-tax figure, returned alongside `iuc` for completeness.\nFor local-market running-cost use, prefer `iuc`. Electric → `exempt:true`, `isv:0`.\n",
      "properties": {
        "isv": {
          "type": "number"
        },
        "exempt": {
          "type": "boolean"
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        },
        "table": {
          "type": "string"
        },
        "comp_cilindrada": {
          "type": "number"
        },
        "comp_ambiental": {
          "type": "number"
        },
        "diesel_surcharge": {
          "type": "number"
        },
        "base": {
          "type": "number"
        },
        "rate_pct": {
          "type": "integer"
        },
        "min_isv_applied": {
          "type": "boolean"
        },
        "age_years": {
          "type": "number"
        },
        "age_reduction_pct": {
          "type": "integer"
        }
      }
    },
    "IucResult": {
      "type": "object",
      "description": "Annual road tax (IUC). `iuc` is the yearly euro amount. Electric → `exempt:true`, `iuc:0`.",
      "properties": {
        "iuc": {
          "type": "number",
          "description": "Annual IUC road tax in EUR."
        },
        "exempt": {
          "type": "boolean"
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        },
        "category": {
          "type": "string",
          "description": "IUC category (e.g. \"B\" = passenger registered ≥2007)."
        },
        "taxa_cilindrada": {
          "type": "number",
          "description": "Engine-displacement component, EUR."
        },
        "taxa_co2": {
          "type": "number",
          "description": "CO₂ component, EUR."
        },
        "coef": {
          "type": "number",
          "description": "Year coefficient."
        },
        "diesel_adic": {
          "type": "number",
          "description": "Diesel additional, EUR."
        },
        "co2_adic": {
          "type": "number",
          "description": "CO₂ additional (registrations ≥2017), EUR."
        }
      }
    }
  }
}