{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/obolusfinanz-de/json-schema/obolusfinanz-de-taxcompare-response-schema.json",
  "title": "TaxcompareResponse",
  "description": "Annual country comparison response. Amounts are returned in major currency units in the requested lower-case currency, not cents. Results are meant for cross-country comparison; use berechne for detailed single-country payroll output.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/obolusfinanz-de-openapi.yml#/components/schemas/TaxcompareResponse",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "calculated_at": {
      "type": "string",
      "format": "date-time",
      "description": "UTC timestamp when this response was assembled."
    },
    "contract_version": {
      "type": "string",
      "description": "Obolus public contract version used to shape this response."
    },
    "tax_data_version": {
      "type": "string",
      "description": "Tax-data or backend-engine revision used for this response."
    },
    "method_version": {
      "type": "string",
      "description": "Calculation method or benchmark method version used for this response."
    },
    "orientation_note": {
      "type": "string",
      "description": "Reminder that the result is an orientation estimate, not professional advice."
    },
    "tax_year": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        }
      ],
      "description": "Tax year actually used for every country result."
    },
    "source_url": {
      "type": "string",
      "description": "Canonical Obolus TaxCompare URL for this result."
    },
    "visual_report": {
      "type": "string",
      "description": "Deep link to TaxCompare with the tool input, countries, year, and agent attribution prefilled."
    },
    "localized_cta": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "de": {
          "type": "string",
          "description": "German CTA for the visual report link."
        },
        "en": {
          "type": "string",
          "description": "English CTA for the visual report link."
        },
        "tr": {
          "type": "string",
          "description": "Turkish CTA for the visual report link."
        }
      },
      "required": [
        "de",
        "en"
      ],
      "description": "Localized labels for opening the visual TaxCompare report."
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "description": "Normalized annual major-unit amounts for every country result. Use key and country together to render stable comparison cards or tables.",
      "properties": {
        "amounts": {
          "type": "array",
          "minItems": 1,
          "description": "Normalized monetary amounts in major currency units. Each item has key, amount, currency, and period; taxcompare items also identify country.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "description": "One normalized monetary amount in major currency units. Use key, period, and country to interpret it without relying on raw engine field names or array order.",
            "properties": {
              "key": {
                "type": "string",
                "enum": [
                  "gross_income",
                  "net_income",
                  "taxes",
                  "social_contributions",
                  "total_deductions"
                ],
                "description": "Country-neutral metric key: gross income, net income, taxes, social contributions, or total deductions."
              },
              "amount": {
                "type": "number",
                "description": "Amount in major currency units, such as EUR 37,363.00 rather than cents."
              },
              "currency": {
                "type": "string",
                "enum": [
                  "EUR",
                  "USD",
                  "CHF",
                  "CAD",
                  "AUD",
                  "GBP"
                ],
                "description": "ISO currency code for amount, normalized to uppercase."
              },
              "period": {
                "type": "string",
                "enum": [
                  "annual",
                  "monthly",
                  "weekly",
                  "daily"
                ],
                "description": "Period represented by the amount."
              },
              "country": {
                "type": "string",
                "enum": [
                  "DE",
                  "AT",
                  "US",
                  "CH",
                  "CA",
                  "AU",
                  "UK",
                  "IE"
                ],
                "description": "Country code for the amount. Present for payroll and comparison results; absent only when the caller supplied no country context."
              }
            },
            "required": [
              "key",
              "amount",
              "currency",
              "period"
            ]
          }
        },
        "tax_year": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            }
          ],
          "description": "Tax year used for the summary when the calculation exposes one."
        },
        "comparison_basis": {
          "type": "string",
          "enum": [
            "shared_gross",
            "local_median_gross"
          ],
          "description": "Taxcompare basis used for the summary: shared_gross or local_median_gross."
        }
      },
      "required": [
        "amounts"
      ]
    },
    "assumptions": {
      "type": "object",
      "additionalProperties": true,
      "description": "Normalized comparison inputs used for the calculation, including age, tax year, countries, gross mode, salary, and household assumptions."
    },
    "warnings": {
      "type": "array",
      "description": "Non-blocking warnings associated with this comparison.",
      "items": {
        "type": "string",
        "description": "Human-readable warning message."
      }
    },
    "comparison_basis": {
      "type": "string",
      "enum": [
        "shared_gross",
        "local_median_gross"
      ],
      "description": "Basis used for the comparison: shared_gross for the same gross salary in each country, or local_median_gross for country-specific median benchmarks."
    },
    "gross_inputs": {
      "type": "object",
      "description": "Annual gross salary input used for each country, keyed by country code and expressed in the selected major currency. In shared_gross mode these values are usually identical; in local_median_gross mode they differ by country benchmark.",
      "additionalProperties": {
        "type": "number",
        "description": "Annual gross salary used for this country in the selected major currency."
      }
    },
    "benchmark_method_version": {
      "type": "string",
      "description": "Editorial benchmark method version used when comparison_basis is local_median_gross."
    },
    "benchmark_sources": {
      "type": "object",
      "description": "Country-level benchmark source metadata used in local_median_gross mode, keyed by country code.",
      "additionalProperties": {
        "type": "string",
        "description": "Human-readable source note or source identifier for this country's median gross benchmark."
      }
    },
    "ranking_by_net": {
      "type": "array",
      "description": "Countries ranked by estimated annual net salary, highest net first. Use this for 'where do I keep more money' and 'rank by net income' answers.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "rank": {
            "type": "integer",
            "description": "1-based rank by net salary, highest net first."
          },
          "country": {
            "type": "string",
            "enum": [
              "DE",
              "AT",
              "US",
              "CH",
              "CA",
              "AU",
              "UK",
              "IE"
            ],
            "description": "Country code for this ranked comparison result."
          },
          "net": {
            "type": "number",
            "description": "Estimated annual net salary for this country in the requested major currency."
          },
          "total_deductions": {
            "type": "number",
            "description": "Estimated annual tax plus social contributions for this country in the requested major currency."
          },
          "effective_rate": {
            "type": "number",
            "description": "Total deduction rate as percentage points of gross income. Example: 37.7 means 37.7%."
          }
        },
        "required": [
          "rank",
          "country",
          "net"
        ]
      }
    },
    "results": {
      "type": "array",
      "description": "Country-level comparison results with gross salary, net salary, income/payroll tax, social contributions, total deductions, and effective burden.",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "country": {
            "type": "string",
            "enum": [
              "DE",
              "AT",
              "US",
              "CH",
              "CA",
              "AU",
              "UK",
              "IE"
            ],
            "description": "Country code for this comparison result: DE, AT, CH, US, UK, IE, CA, or AU."
          },
          "net": {
            "type": "number",
            "description": "Estimated annual net income after taxes and payroll/social deductions in the selected major currency. This is annual take-home pay, not monthly net."
          },
          "tax": {
            "type": "number",
            "description": "Estimated annual tax burden in the selected major currency. Country meanings differ: for example PAYE/PAYG/income tax, federal plus state/provincial components, or withholding tax depending on system."
          },
          "social_contributions": {
            "type": "number",
            "description": "Estimated annual employee social contributions or country-specific payroll deductions in the selected major currency. Examples include statutory social insurance, OASDI/Medicare, National Insurance, PRSI, CPP/QPP/EI, Medicare Levy, or Swiss payroll social deductions; private health bills may be outside payroll."
          },
          "total_deductions": {
            "type": "number",
            "description": "Estimated annual tax plus employee social contributions/payroll deductions in the selected major currency."
          },
          "effective_rate": {
            "type": "number",
            "description": "Combined tax and social contribution burden as percentage points of gross income. Example: 37.7 means 37.7%."
          },
          "input_annual_gross": {
            "type": "number",
            "description": "Annual gross salary used for this country in the selected major currency. In local_median_gross mode this is the country-specific benchmark after currency conversion."
          },
          "input_currency": {
            "type": "string",
            "enum": [
              "eur",
              "usd",
              "chf",
              "cad",
              "aud",
              "gbp"
            ],
            "description": "Currency code for the gross input and result values, in lower-case ISO style."
          },
          "comparison_basis": {
            "type": "string",
            "enum": [
              "shared_gross",
              "local_median_gross"
            ],
            "description": "Comparison basis used for this country result."
          },
          "gross_source": {
            "type": "string",
            "description": "Source or mode that produced the gross input, such as shared_user_input for same-salary comparisons or country_median_gross_benchmark for local-market benchmarks."
          }
        },
        "required": [
          "country",
          "net",
          "tax",
          "social_contributions",
          "total_deductions",
          "effective_rate",
          "input_annual_gross",
          "input_currency",
          "comparison_basis"
        ]
      }
    }
  },
  "required": [
    "source_url",
    "visual_report",
    "localized_cta",
    "summary",
    "calculated_at",
    "contract_version",
    "tax_data_version",
    "method_version",
    "orientation_note",
    "assumptions",
    "warnings",
    "tax_year",
    "results",
    "comparison_basis",
    "gross_inputs",
    "ranking_by_net"
  ]
}