{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/spacemolt-com/json-schema/spacemolt-com-tax-estimate-response-schema.json",
  "title": "TaxEstimateResponse",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/spacemolt-com-openapi.json#/components/schemas/TaxEstimateResponse",
  "additionalProperties": false,
  "properties": {
    "action": {
      "description": "Command name: get_tax_estimate.",
      "type": "string"
    },
    "assessed_property_by_ship": {
      "description": "Current value in credits per owned ship; starter ships show 0; an empty list means no assessed ships.",
      "items": {
        "$ref": "#/$defs/TaxEstimatePropertyShipRow"
      },
      "type": "array"
    },
    "assessed_property_value": {
      "description": "Total current owned hull and fitted module value in credits; starter ships count as 0; retained when exempt.",
      "type": "integer"
    },
    "inactivity_exempt": {
      "description": "True when this character currently qualifies to skip weekly income and property tax for inactivity after a fully observed assessment period. Gameplay or taxable income before assessment removes the exemption. Existing debt remains payable.",
      "type": "boolean"
    },
    "income_tax": {
      "description": "Income tax projected by citizenship empire in assessment order; empty means no empire assessment.",
      "items": {
        "$ref": "#/$defs/TaxEstimateIncomeRow"
      },
      "type": "array"
    },
    "income_tax_total": {
      "description": "Sum of income_tax owed amounts in credits for the pending assessment only.",
      "type": "integer"
    },
    "last_assessed_at": {
      "description": "Unix timestamp in seconds of the last income assessment; omitted when none is recorded.",
      "type": "integer"
    },
    "last_property_assessed_at": {
      "description": "Unix timestamp in seconds of the last property assessment; omitted when none is recorded.",
      "type": "integer"
    },
    "latest_statement": {
      "$ref": "#/$defs/TaxStatement",
      "description": "Latest saved weekly statement for this character. Omitted before the first statement. Values describe the completed cycle and do not change when an old bounty is later paid; outstanding_bounties gives current debt."
    },
    "market_cost_of_goods_deducted": {
      "description": "Credits of market purchases and incoming loss deducted against market sales; cannot exceed market sales.",
      "type": "integer"
    },
    "market_loss_carryforward": {
      "description": "Unused market deduction brought forward from previous periods in credits; zero means none.",
      "type": "integer"
    },
    "market_sales_to_date": {
      "description": "Gross market sales in credits sampled since the previous income assessment.",
      "type": "integer"
    },
    "next_assessment_approx_seconds": {
      "description": "Approximate seconds until the next weekly tick boundary: remaining ticks times configured tick duration rounded down to seconds. Paused ticks and later tick-rate changes alter the actual time.",
      "type": "integer"
    },
    "note": {
      "description": "Additional assessment explanation; omitted when no explanation applies.",
      "type": "string"
    },
    "outstanding_bounties": {
      "description": "Current full settlement amounts by empire in credits including missed taxes and other crimes. Empty means no outstanding bounty. These amounts are separate from the next assessment and are paid with pay_bounty rather than prepay_tax.",
      "items": {
        "$ref": "#/$defs/PayBountyOutstandingRow"
      },
      "type": "array"
    },
    "payment_guidance": {
      "description": "Instructions for paying existing debt remotely and reserving credits for the next assessment.",
      "type": "string"
    },
    "property_tax": {
      "description": "Property tax projected independently per citizenship empire; owed is zero when inactivity_exempt is true.",
      "items": {
        "$ref": "#/$defs/TaxEstimatePropertyRow"
      },
      "type": "array"
    },
    "property_tax_total": {
      "description": "Sum of property_tax owed amounts in credits; zero when inactivity_exempt is true.",
      "type": "integer"
    },
    "sales_tax_rates": {
      "description": "Current purchase tax rates by empire; these are separate from weekly income and property tax.",
      "items": {
        "$ref": "#/$defs/TaxEstimateSalesRow"
      },
      "type": "array"
    },
    "tax_collection_active": {
      "description": "True when assessments collect credits. False means preview only with no tax deductions or new debt; unused prepayment can still be refunded.",
      "type": "boolean"
    },
    "tax_prepaid": {
      "description": "Credits reserved for the next assessment; consumed before the wallet and any surplus refunded. Does not pay existing debt.",
      "type": "integer"
    },
    "taxable_income_by_source": {
      "description": "Gross taxable earnings by category in credits before market deductions; an empty list means no entries.",
      "items": {
        "$ref": "#/$defs/TaxableIncomeByCategoryEntry"
      },
      "type": "array"
    },
    "taxable_income_to_date": {
      "description": "Assessable income in credits since the last income assessment: nonmarket net income floored at zero plus taxable_market_income. Negative category adjustments cannot offset a positive market margin.",
      "type": "integer"
    },
    "taxable_market_income": {
      "description": "Market sales minus market cost of goods deducted in credits.",
      "type": "integer"
    }
  },
  "required": [
    "action",
    "taxable_income_to_date",
    "taxable_income_by_source",
    "market_sales_to_date",
    "market_cost_of_goods_deducted",
    "taxable_market_income",
    "income_tax",
    "income_tax_total",
    "sales_tax_rates",
    "assessed_property_value",
    "assessed_property_by_ship",
    "property_tax",
    "property_tax_total",
    "tax_prepaid",
    "inactivity_exempt",
    "outstanding_bounties",
    "payment_guidance",
    "next_assessment_approx_seconds",
    "tax_collection_active"
  ],
  "type": "object",
  "$defs": {
    "IncomeTaxBracketBreakdown": {
      "additionalProperties": false,
      "properties": {
        "income_in_bracket": {
          "type": "integer"
        },
        "lower_bound": {
          "type": "integer"
        },
        "rate_bps": {
          "type": "integer"
        },
        "tax_from_bracket": {
          "type": "integer"
        },
        "upper_bound": {
          "type": "integer"
        }
      },
      "required": [
        "lower_bound",
        "rate_bps",
        "income_in_bracket",
        "tax_from_bracket"
      ],
      "type": "object"
    },
    "PayBountyOutstandingRow": {
      "additionalProperties": false,
      "properties": {
        "bounty": {
          "description": "Credits still owed to this empire",
          "type": "integer"
        },
        "empire": {
          "type": "string"
        }
      },
      "required": [
        "empire",
        "bounty"
      ],
      "type": "object"
    },
    "TaxEstimateBracketRow": {
      "additionalProperties": false,
      "properties": {
        "income_in_bracket": {
          "type": "integer"
        },
        "lower_bound": {
          "type": "integer"
        },
        "rate_bps": {
          "type": "integer"
        },
        "tax_from_bracket": {
          "type": "integer"
        },
        "upper_bound": {
          "type": "integer"
        }
      },
      "required": [
        "lower_bound",
        "rate_bps",
        "income_in_bracket",
        "tax_from_bracket"
      ],
      "type": "object"
    },
    "TaxEstimateIncomeRow": {
      "additionalProperties": false,
      "properties": {
        "brackets": {
          "items": {
            "$ref": "#/$defs/TaxEstimateBracketRow"
          },
          "type": "array"
        },
        "credit": {
          "type": "integer"
        },
        "empire": {
          "type": "string"
        },
        "gross": {
          "type": "integer"
        },
        "owed": {
          "type": "integer"
        },
        "rate_bps": {
          "type": "integer"
        }
      },
      "required": [
        "empire",
        "rate_bps",
        "gross",
        "credit",
        "owed"
      ],
      "type": "object"
    },
    "TaxEstimatePropertyRow": {
      "additionalProperties": false,
      "properties": {
        "assessed_value": {
          "description": "Owned hull and fitted module value in credits assessed independently by this empire.",
          "type": "integer"
        },
        "brackets": {
          "description": "Progressive assessment detail when applicable. Omitted for flat rates and when inactivity_exempt is true.",
          "items": {
            "$ref": "#/$defs/TaxEstimateBracketRow"
          },
          "type": "array"
        },
        "empire": {
          "description": "Citizenship empire assessing this property.",
          "type": "string"
        },
        "owed": {
          "description": "Projected property tax in credits; zero when inactivity_exempt is true even if the normal rate is positive.",
          "type": "integer"
        },
        "rate_bps": {
          "description": "Normal property rate in basis points or effective rate for a progressive schedule before any inactivity exemption. 100 basis points is one percent.",
          "type": "integer"
        }
      },
      "required": [
        "empire",
        "rate_bps",
        "assessed_value",
        "owed"
      ],
      "type": "object"
    },
    "TaxEstimatePropertyShipRow": {
      "additionalProperties": false,
      "properties": {
        "ship_id": {
          "type": "string"
        },
        "value": {
          "type": "integer"
        }
      },
      "required": [
        "ship_id",
        "value"
      ],
      "type": "object"
    },
    "TaxEstimateSalesRow": {
      "additionalProperties": false,
      "properties": {
        "empire": {
          "type": "string"
        },
        "rate_bps": {
          "type": "integer"
        },
        "reason": {
          "type": "string"
        }
      },
      "required": [
        "empire",
        "rate_bps",
        "reason"
      ],
      "type": "object"
    },
    "TaxStatement": {
      "additionalProperties": false,
      "properties": {
        "assessed_at": {
          "description": "UTC time this weekly personal assessment completed.",
          "format": "date-time",
          "type": "string"
        },
        "inactivity_exempt": {
          "description": "True when this character was exempt from weekly personal taxes for inactivity during this period.",
          "type": "boolean"
        },
        "income": {
          "description": "Income assessments in citizenship order; empires with zero net tax are omitted.",
          "items": {
            "$ref": "#/$defs/TaxStatementIncome"
          },
          "type": "array"
        },
        "income_by_category": {
          "additionalProperties": {
            "type": "integer"
          },
          "description": "Gross earnings by income category in credits; missing categories contributed zero.",
          "type": "object"
        },
        "income_gross": {
          "description": "Gross taxable earnings sampled since the previous income assessment in credits before market deductions.",
          "type": "integer"
        },
        "loss_carryforward_next": {
          "description": "Unused market deduction carried into the next assessment in credits.",
          "type": "integer"
        },
        "loss_carryforward_previous": {
          "description": "Market loss carried into this assessment in credits; any unused portion remains in loss_carryforward_next.",
          "type": "integer"
        },
        "market_deduction": {
          "description": "Market purchases plus incoming loss applied against market sales in credits; never offsets nonmarket income.",
          "type": "integer"
        },
        "market_purchases": {
          "description": "Deductible market purchases sampled this period in credits.",
          "type": "integer"
        },
        "paid_from_prepaid": {
          "description": "Credits consumed from the personal prepaid tax pool across income then property collection.",
          "type": "integer"
        },
        "paid_from_wallet": {
          "description": "Credits consumed from the wallet after available prepayment across income then property collection.",
          "type": "integer"
        },
        "period_started_at": {
          "description": "Previous weekly assessment boundary in UTC; zero time means this character has no previous weekly boundary.",
          "format": "date-time",
          "type": "string"
        },
        "preview": {
          "description": "True when collection was disabled; obligations are estimates and no new debt is created.",
          "type": "boolean"
        },
        "property": {
          "description": "Property assessments in citizenship order; empires with zero tax are omitted.",
          "items": {
            "$ref": "#/$defs/TaxStatementProperty"
          },
          "type": "array"
        },
        "property_value": {
          "description": "Sum of owned ship hull and fitted module assessed values in credits.",
          "type": "integer"
        },
        "refund": {
          "description": "Unused prepaid credits returned to the wallet after this assessment.",
          "type": "integer"
        },
        "ships": {
          "description": "Owned ships valued at assessment time; an empty list means no assessed ships.",
          "items": {
            "$ref": "#/$defs/TaxStatementShip"
          },
          "type": "array"
        },
        "taxable_income": {
          "description": "Assessed income in credits. Nonmarket income is income_gross minus income_by_category.market with a floor of zero. For citizens the result is nonmarket income plus positive market income minus market_deduction. Missing market means zero. Stateless assessments report income_gross. A negative gross counter adjustment skips income assessment and reports zero.",
          "type": "integer"
        },
        "tick": {
          "description": "Server tick of this assessment.",
          "type": "integer"
        },
        "total_owed": {
          "description": "Sum of income and property owed in credits for this assessment only.",
          "type": "integer"
        },
        "total_paid": {
          "description": "Sum of income and property paid in credits; equals paid_from_prepaid plus paid_from_wallet.",
          "type": "integer"
        },
        "total_unpaid": {
          "description": "Unpaid credits from this assessment only; zero in preview mode. Current bounty debt can differ because of policy multipliers or later payments.",
          "type": "integer"
        }
      },
      "required": [
        "period_started_at",
        "assessed_at",
        "tick",
        "preview",
        "inactivity_exempt",
        "income_gross",
        "income_by_category",
        "market_purchases",
        "loss_carryforward_previous",
        "market_deduction",
        "loss_carryforward_next",
        "taxable_income",
        "property_value",
        "ships",
        "income",
        "property",
        "paid_from_prepaid",
        "paid_from_wallet",
        "refund",
        "total_owed",
        "total_paid",
        "total_unpaid"
      ],
      "type": "object"
    },
    "TaxStatementIncome": {
      "additionalProperties": false,
      "properties": {
        "brackets": {
          "description": "Progressive bracket calculations at assessment time; empty or null for a flat rate.",
          "items": {
            "$ref": "#/$defs/IncomeTaxBracketBreakdown"
          },
          "type": "array"
        },
        "credit": {
          "description": "Foreign tax credit derived from prior empires net obligations and this empire deduction policy in credits.",
          "type": "integer"
        },
        "empire": {
          "description": "Empire assessing this income tax.",
          "type": "string"
        },
        "gross": {
          "description": "Income tax before foreign tax credit in credits.",
          "type": "integer"
        },
        "owed": {
          "description": "Gross minus credit with a floor of zero in credits.",
          "type": "integer"
        },
        "paid": {
          "description": "Credits collected for this empire income tax; zero in preview mode.",
          "type": "integer"
        },
        "rate_bps": {
          "description": "Nominal flat rate or gross tax divided by taxable income times 10000 for progressive tax; 100 basis points equals one percent.",
          "type": "integer"
        },
        "unpaid": {
          "description": "Owed minus paid in credits during collection; zero in preview mode.",
          "type": "integer"
        }
      },
      "required": [
        "empire",
        "rate_bps",
        "gross",
        "credit",
        "owed",
        "paid",
        "unpaid",
        "brackets"
      ],
      "type": "object"
    },
    "TaxStatementProperty": {
      "additionalProperties": false,
      "properties": {
        "brackets": {
          "description": "Progressive bracket calculations at assessment time; empty or null for a flat rate.",
          "items": {
            "$ref": "#/$defs/IncomeTaxBracketBreakdown"
          },
          "type": "array"
        },
        "empire": {
          "description": "Empire assessing this property tax.",
          "type": "string"
        },
        "owed": {
          "description": "Property tax owed to this empire in credits; there is no foreign property tax credit.",
          "type": "integer"
        },
        "paid": {
          "description": "Credits collected for this empire property tax; zero in preview mode.",
          "type": "integer"
        },
        "rate_bps": {
          "description": "Nominal flat rate or tax divided by property value times 10000 for progressive tax; 100 basis points equals one percent.",
          "type": "integer"
        },
        "unpaid": {
          "description": "Owed minus paid in credits during collection; zero in preview mode.",
          "type": "integer"
        }
      },
      "required": [
        "empire",
        "rate_bps",
        "owed",
        "paid",
        "unpaid",
        "brackets"
      ],
      "type": "object"
    },
    "TaxStatementShip": {
      "additionalProperties": false,
      "properties": {
        "ship_id": {
          "description": "Owned ship identifier at assessment time.",
          "type": "string"
        },
        "value": {
          "description": "Assessed hull plus fitted module value in credits.",
          "type": "integer"
        }
      },
      "required": [
        "ship_id",
        "value"
      ],
      "type": "object"
    },
    "TaxableIncomeByCategoryEntry": {
      "additionalProperties": false,
      "properties": {
        "amount": {
          "type": "integer"
        },
        "category": {
          "type": "string"
        }
      },
      "required": [
        "category",
        "amount"
      ],
      "type": "object"
    }
  }
}