{
  "openapi": "3.1.0",
  "info": {
    "title": "Japan Leaving Tax Check API",
    "version": "1.0.0",
    "description": "Leaving Japan? See whether you still owe resident tax (住民税) for the coming fiscal year, why leaving by December 31 matters, whether you need a tax agent (納税管理人), what happens to payroll-deducted 住民税 on your final salary, when your income tax return (準確定申告) is due, and the 転出届 and pension lump-sum deadlines.\n\nFree, no API key, CORS open. Fair use: about 120 requests per minute per IP. Also available as MCP tools at https://free-agent-tools.vercel.app/mcp"
  },
  "servers": [
    {
      "url": "https://japan-leaving-tax.vercel.app"
    }
  ],
  "paths": {
    "/api/check": {
      "get": {
        "operationId": "japanLeavingTaxCheck",
        "summary": "Leaving Japan: do I still owe resident tax (住民税), do I need a tax agent (納税管理人), and what income-tax and move-out deadlines apply?",
        "description": "Applies Japan's departure rules (as of 2026-11-01): 住民税 is assessed on whoever is registered in a city on January 1 (地方税法 39 / 294 / 318), on the previous year's income, for the fiscal year June–May. Leave (with a 転出届) on or before December 31 → no 住民税 next fiscal year on this year's income; leave January 2 or later → that fiscal year is owed in full. Leaving January–May, the bill is issued in June after you go → tax agent (納税管理人, 地方税法 300) or certification. Payroll (特別徴収): job ending January 1 – April 30 → remaining installments deducted in one lump sum from the final pay (地方税法 321-5 ②); June–December → lump sum only on request. Income tax: year-end adjustment on the last salary before departure (NTA 1920); if a return is needed, 準確定申告 by departure without an agent, or by March 15 next year with one (所得税法 127, NTA 1926); previous year's return due by departure if leaving January 1 – March 15 (所得税法 126); agent form to the tax office (国税通則法 117); exit-tax flag for ¥100M+ securities (NTA 1478). Also: 転出届 window, pension Lump-sum Withdrawal claim deadline (2 years), residence card. Returns verdict (agent_needed | settle_before_departure | nothing_after_departure | still_resident), summary, residentTax {fiscalYears[{fiscalYear, incomeYear, status, why, howToPay}], nextFiscalYearAvoided, leaveByToAvoidNextFY, jan1Tip, lumpSumFromFinalPay, agentRequired, agentForm}, incomeTax {yearEndAdjustment, returnRequired, returnDeadline, previousYearReturnDeadline, agentRequired, agentForm, exitTax}, deadlines[{date, what, ja, mandatory, passed}], actions, warnings, pension, sources, disclaimer. No yen amounts.\n\nExample: https://japan-leaving-tax.vercel.app/api/check?departureDate=2027-03-20&employment=employee&payMethod=salary",
        "parameters": [
          {
            "name": "departureDate",
            "in": "query",
            "required": true,
            "description": "YYYY-MM-DD the day you leave Japan (aliases: departure, leaveDate).",
            "schema": {
              "type": "string",
              "description": "YYYY-MM-DD the day you leave Japan (aliases: departure, leaveDate)."
            }
          },
          {
            "name": "plan",
            "in": "query",
            "required": false,
            "description": "leave (moving abroad for a year or more, files a 転出届) | short (trip under a year, keeps the address). Aliases: permanent, for_good, temporary, 一時出国…",
            "schema": {
              "type": "string",
              "description": "leave (moving abroad for a year or more, files a 転出届) | short (trip under a year, keeps the address). Aliases: permanent, for_good, temporary, 一時出国…",
              "enum": [
                "leave",
                "short"
              ],
              "default": "leave"
            }
          },
          {
            "name": "arrivalDate",
            "in": "query",
            "required": false,
            "description": "Optional YYYY-MM-DD you first registered an address in Japan (default: before January 1 of the departure year).",
            "schema": {
              "type": "string",
              "description": "Optional YYYY-MM-DD you first registered an address in Japan (default: before January 1 of the departure year)."
            }
          },
          {
            "name": "employment",
            "in": "query",
            "required": false,
            "description": "employee | self_employed | none. Aliases: 会社員, freelance, 個人事業主, student…",
            "schema": {
              "type": "string",
              "description": "employee | self_employed | none. Aliases: 会社員, freelance, 個人事業主, student…",
              "enum": [
                "employee",
                "self_employed",
                "none"
              ],
              "default": "employee"
            }
          },
          {
            "name": "payMethod",
            "in": "query",
            "required": false,
            "description": "How you pay 住民税: salary (payroll, 特別徴収) | self (bills, 普通徴収) | none (no tax). Default: salary for employees, self for self-employed, none otherwise.",
            "schema": {
              "type": "string",
              "description": "How you pay 住民税: salary (payroll, 特別徴収) | self (bills, 普通徴収) | none (no tax). Default: salary for employees, self for self-employed, none otherwise.",
              "enum": [
                "salary",
                "self",
                "none"
              ]
            }
          },
          {
            "name": "jobEndDate",
            "in": "query",
            "required": false,
            "description": "Optional YYYY-MM-DD your job ends (default: departureDate). Decides the lump-sum rule.",
            "schema": {
              "type": "string",
              "description": "Optional YYYY-MM-DD your job ends (default: departureDate). Decides the lump-sum rule."
            }
          },
          {
            "name": "incomeLastYear",
            "in": "query",
            "required": false,
            "description": "Had taxable income last calendar year (false = no 住民税 bill expected).",
            "schema": {
              "type": "boolean",
              "description": "Had taxable income last calendar year (false = no 住民税 bill expected).",
              "default": true
            }
          },
          {
            "name": "needsTaxReturn",
            "in": "query",
            "required": false,
            "description": "You need an income tax return for this year (side income over ¥200k, salary over ¥20M, self-employed, two employers…). Default: true for self_employed, false otherwise.",
            "schema": {
              "type": "boolean",
              "description": "You need an income tax return for this year (side income over ¥200k, salary over ¥20M, self-employed, two employers…). Default: true for self_employed, false otherwise."
            }
          },
          {
            "name": "prevYearReturnPending",
            "in": "query",
            "required": false,
            "description": "Leaving January 1 – March 15 with last year's return not yet filed.",
            "schema": {
              "type": "boolean",
              "description": "Leaving January 1 – March 15 with last year's return not yet filed.",
              "default": false
            }
          },
          {
            "name": "incomeAfterLeaving",
            "in": "query",
            "required": false,
            "description": "Japan-source income after leaving (rent, property sale…) → tax agent needed.",
            "schema": {
              "type": "boolean",
              "description": "Japan-source income after leaving (rent, property sale…) → tax agent needed.",
              "default": false
            }
          },
          {
            "name": "hasTaxAgent",
            "in": "query",
            "required": false,
            "description": "You will appoint a tax agent (納税管理人).",
            "schema": {
              "type": "boolean",
              "description": "You will appoint a tax agent (納税管理人).",
              "default": false
            }
          },
          {
            "name": "nationality",
            "in": "query",
            "required": false,
            "description": "foreign | japanese (pension lump sum and residence card only apply to foreign nationals).",
            "schema": {
              "type": "string",
              "description": "foreign | japanese (pension lump sum and residence card only apply to foreign nationals).",
              "enum": [
                "foreign",
                "japanese"
              ],
              "default": "foreign"
            }
          },
          {
            "name": "pensionMonths",
            "in": "query",
            "required": false,
            "description": "Optional months of Japanese pension contributions (6–119 → lump-sum claim deadline).",
            "schema": {
              "type": "number",
              "description": "Optional months of Japanese pension contributions (6–119 → lump-sum claim deadline)."
            }
          },
          {
            "name": "securities100M",
            "in": "query",
            "required": false,
            "description": "Holding ¥100M+ in securities etc. → exit-tax (国外転出時課税) flag.",
            "schema": {
              "type": "boolean",
              "description": "Holding ¥100M+ in securities etc. → exit-tax (国外転出時課税) flag.",
              "default": false
            }
          },
          {
            "name": "today",
            "in": "query",
            "required": false,
            "description": "Override today's date (default: today in Japan).",
            "schema": {
              "type": "string",
              "description": "Override today's date (default: today in Japan)."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result as JSON. Always includes a `disclaimer` field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid input. The body explains what to send and gives an example."
          },
          "429": {
            "description": "Too many requests from one IP. Retry after the Retry-After seconds."
          }
        }
      },
      "post": {
        "operationId": "japanLeavingTaxCheckPost",
        "summary": "Leaving Japan: do I still owe resident tax (住民税), do I need a tax agent (納税管理人), and what income-tax and move-out deadlines apply? (JSON body)",
        "description": "Applies Japan's departure rules (as of 2026-11-01): 住民税 is assessed on whoever is registered in a city on January 1 (地方税法 39 / 294 / 318), on the previous year's income, for the fiscal year June–May. Leave (with a 転出届) on or before December 31 → no 住民税 next fiscal year on this year's income; leave January 2 or later → that fiscal year is owed in full. Leaving January–May, the bill is issued in June after you go → tax agent (納税管理人, 地方税法 300) or certification. Payroll (特別徴収): job ending January 1 – April 30 → remaining installments deducted in one lump sum from the final pay (地方税法 321-5 ②); June–December → lump sum only on request. Income tax: year-end adjustment on the last salary before departure (NTA 1920); if a return is needed, 準確定申告 by departure without an agent, or by March 15 next year with one (所得税法 127, NTA 1926); previous year's return due by departure if leaving January 1 – March 15 (所得税法 126); agent form to the tax office (国税通則法 117); exit-tax flag for ¥100M+ securities (NTA 1478). Also: 転出届 window, pension Lump-sum Withdrawal claim deadline (2 years), residence card. Returns verdict (agent_needed | settle_before_departure | nothing_after_departure | still_resident), summary, residentTax {fiscalYears[{fiscalYear, incomeYear, status, why, howToPay}], nextFiscalYearAvoided, leaveByToAvoidNextFY, jan1Tip, lumpSumFromFinalPay, agentRequired, agentForm}, incomeTax {yearEndAdjustment, returnRequired, returnDeadline, previousYearReturnDeadline, agentRequired, agentForm, exitTax}, deadlines[{date, what, ja, mandatory, passed}], actions, warnings, pension, sources, disclaimer. No yen amounts.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "departureDate"
                ],
                "properties": {
                  "departureDate": {
                    "type": "string",
                    "description": "YYYY-MM-DD the day you leave Japan (aliases: departure, leaveDate)."
                  },
                  "plan": {
                    "type": "string",
                    "description": "leave (moving abroad for a year or more, files a 転出届) | short (trip under a year, keeps the address). Aliases: permanent, for_good, temporary, 一時出国…",
                    "enum": [
                      "leave",
                      "short"
                    ],
                    "default": "leave"
                  },
                  "arrivalDate": {
                    "type": "string",
                    "description": "Optional YYYY-MM-DD you first registered an address in Japan (default: before January 1 of the departure year)."
                  },
                  "employment": {
                    "type": "string",
                    "description": "employee | self_employed | none. Aliases: 会社員, freelance, 個人事業主, student…",
                    "enum": [
                      "employee",
                      "self_employed",
                      "none"
                    ],
                    "default": "employee"
                  },
                  "payMethod": {
                    "type": "string",
                    "description": "How you pay 住民税: salary (payroll, 特別徴収) | self (bills, 普通徴収) | none (no tax). Default: salary for employees, self for self-employed, none otherwise.",
                    "enum": [
                      "salary",
                      "self",
                      "none"
                    ]
                  },
                  "jobEndDate": {
                    "type": "string",
                    "description": "Optional YYYY-MM-DD your job ends (default: departureDate). Decides the lump-sum rule."
                  },
                  "incomeLastYear": {
                    "type": "boolean",
                    "description": "Had taxable income last calendar year (false = no 住民税 bill expected).",
                    "default": true
                  },
                  "needsTaxReturn": {
                    "type": "boolean",
                    "description": "You need an income tax return for this year (side income over ¥200k, salary over ¥20M, self-employed, two employers…). Default: true for self_employed, false otherwise."
                  },
                  "prevYearReturnPending": {
                    "type": "boolean",
                    "description": "Leaving January 1 – March 15 with last year's return not yet filed.",
                    "default": false
                  },
                  "incomeAfterLeaving": {
                    "type": "boolean",
                    "description": "Japan-source income after leaving (rent, property sale…) → tax agent needed.",
                    "default": false
                  },
                  "hasTaxAgent": {
                    "type": "boolean",
                    "description": "You will appoint a tax agent (納税管理人).",
                    "default": false
                  },
                  "nationality": {
                    "type": "string",
                    "description": "foreign | japanese (pension lump sum and residence card only apply to foreign nationals).",
                    "enum": [
                      "foreign",
                      "japanese"
                    ],
                    "default": "foreign"
                  },
                  "pensionMonths": {
                    "type": "number",
                    "description": "Optional months of Japanese pension contributions (6–119 → lump-sum claim deadline)."
                  },
                  "securities100M": {
                    "type": "boolean",
                    "description": "Holding ¥100M+ in securities etc. → exit-tax (国外転出時課税) flag.",
                    "default": false
                  },
                  "today": {
                    "type": "string",
                    "description": "Override today's date (default: today in Japan)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result as JSON. Always includes a `disclaimer` field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid input. The body explains what to send and gives an example."
          },
          "429": {
            "description": "Too many requests from one IP. Retry after the Retry-After seconds."
          }
        }
      }
    },
    "/api/rules": {
      "get": {
        "operationId": "japanLeavingTaxRules",
        "summary": "Japan departure tax rules: 住民税 January 1 assessment date, fiscal year, lump-sum deduction from the final salary, tax agent (納税管理人), 準確定申告, previous-year return, exit tax, 転出届, pension lump sum, what is not covered, sources",
        "description": "Returns the rules the checker applies, with law articles, official sources and disclaimer. No inputs.",
        "responses": {
          "200": {
            "description": "Rules JSON with rulesAsOf and sources.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    }
  }
}