{
  "openapi": "3.1.0",
  "info": {
    "title": "My Net Worth calculator API",
    "version": "v1 (engine 2026.10.30)",
    "description": "Malaysian personal-finance calculations from mynetworth.today. Estimates, not advice: relay the tax year, dates and warnings with any figure. Inputs are used for the one calculation and not stored. Method: https://mynetworth.today/blog/kira-pcb.html"
  },
  "servers": [
    {
      "url": "https://mynetworth.today"
    }
  ],
  "paths": {
    "/api/v1/payslip": {
      "post": {
        "operationId": "estimateTakeHomePay",
        "summary": "Monthly take-home pay from gross salary (EPF, SOCSO, EIS, LINDUNG 24 Jam, PCB), pay dates 2026-06-01 to 2027-12-31",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "salary",
                  "date"
                ],
                "properties": {
                  "salary": {
                    "description": "Gross monthly salary in MYR (RM), before any deduction.",
                    "type": "number",
                    "minimum": 0.01,
                    "maximum": 1000000
                  },
                  "date": {
                    "description": "Pay date (YYYY-MM-DD) whose rules apply; picks the tax year. Supported 2026-06-01 to 2027-12-31. Use today's date for \"now\".",
                    "type": "string",
                    "format": "date"
                  },
                  "tax_category": {
                    "description": "single; married (spouse has no income, adds RM4,000 relief); married_spouse_working.",
                    "type": "string",
                    "enum": [
                      "single",
                      "married",
                      "married_spouse_working"
                    ],
                    "default": "single"
                  },
                  "children": {
                    "description": "Children claimed for PCB (RM2,000 relief each).",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 20,
                    "default": 0
                  },
                  "resident": {
                    "description": "Malaysian tax resident. Non-residents pay a flat 30% with no reliefs.",
                    "type": "boolean",
                    "default": true
                  },
                  "citizen": {
                    "description": "Malaysian citizen or PR. Others: EPF 2% employee and employer.",
                    "type": "boolean",
                    "default": true
                  },
                  "age60": {
                    "description": "Aged 60 or over: no employee SOCSO/EIS, employee EPF defaults to 0%.",
                    "type": "boolean",
                    "default": false
                  },
                  "epf_rate": {
                    "description": "Employee EPF % (default 11; 0 from age 60; 2 for non-citizens).",
                    "type": "number",
                    "minimum": 0,
                    "maximum": 30
                  },
                  "zakat": {
                    "description": "Zakat deducted through salary per month (RM); reduces PCB for residents.",
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000,
                    "default": 0
                  },
                  "lindung": {
                    "description": "Contributes to PERKESO LINDUNG 24 Jam (optional for local workers since 13 Jul 2026).",
                    "type": "boolean",
                    "default": true
                  },
                  "locale": {
                    "description": "Language of the summary and messages: en-MY or ms-MY. Keys and numbers are the same.",
                    "type": "string",
                    "enum": [
                      "en-MY",
                      "ms-MY"
                    ],
                    "default": "en-MY"
                  }
                }
              },
              "example": {
                "salary": 5000,
                "date": "2026-10-30"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Estimate",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "api_version",
                    "engine_version",
                    "warnings",
                    "summary"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "estimate",
                        "unsupported",
                        "invalid"
                      ]
                    },
                    "api_version": {
                      "type": "string"
                    },
                    "engine_version": {
                      "type": "string"
                    },
                    "rules_checked_at": {
                      "type": "string",
                      "format": "date"
                    },
                    "currency": {
                      "type": "string",
                      "enum": [
                        "MYR"
                      ]
                    },
                    "calculation_date": {
                      "type": "string",
                      "format": "date"
                    },
                    "tax_year": {
                      "type": "integer"
                    },
                    "rules_effective_from": {
                      "type": "string",
                      "format": "date"
                    },
                    "rules_effective_to": {
                      "type": "string",
                      "format": "date"
                    },
                    "inputs_used": {
                      "type": "object"
                    },
                    "results": {
                      "type": "object",
                      "description": "gross, deductions {epf, socso, eis, lindung, pcb, zakat, total}, net, employer {epf, socso, eis, total}, yearly {pcb, net}; all RM."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "affected_fields": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "assumptions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "summary": {
                      "type": "string",
                      "description": "One paragraph to relay as is, in the requested locale."
                    },
                    "methodology_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (see errors)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "api_version",
                    "engine_version",
                    "warnings",
                    "summary"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "estimate",
                        "unsupported",
                        "invalid"
                      ]
                    },
                    "api_version": {
                      "type": "string"
                    },
                    "engine_version": {
                      "type": "string"
                    },
                    "rules_checked_at": {
                      "type": "string",
                      "format": "date"
                    },
                    "currency": {
                      "type": "string",
                      "enum": [
                        "MYR"
                      ]
                    },
                    "calculation_date": {
                      "type": "string",
                      "format": "date"
                    },
                    "tax_year": {
                      "type": "integer"
                    },
                    "rules_effective_from": {
                      "type": "string",
                      "format": "date"
                    },
                    "rules_effective_to": {
                      "type": "string",
                      "format": "date"
                    },
                    "inputs_used": {
                      "type": "object"
                    },
                    "results": {
                      "type": "object",
                      "description": "gross, deductions {epf, socso, eis, lindung, pcb, zakat, total}, net, employer {epf, socso, eis, total}, yearly {pcb, net}; all RM."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "affected_fields": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "assumptions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "summary": {
                      "type": "string",
                      "description": "One paragraph to relay as is, in the requested locale."
                    },
                    "methodology_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Body too large"
          },
          "422": {
            "description": "Date outside the supported range",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "api_version",
                    "engine_version",
                    "warnings",
                    "summary"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "estimate",
                        "unsupported",
                        "invalid"
                      ]
                    },
                    "api_version": {
                      "type": "string"
                    },
                    "engine_version": {
                      "type": "string"
                    },
                    "rules_checked_at": {
                      "type": "string",
                      "format": "date"
                    },
                    "currency": {
                      "type": "string",
                      "enum": [
                        "MYR"
                      ]
                    },
                    "calculation_date": {
                      "type": "string",
                      "format": "date"
                    },
                    "tax_year": {
                      "type": "integer"
                    },
                    "rules_effective_from": {
                      "type": "string",
                      "format": "date"
                    },
                    "rules_effective_to": {
                      "type": "string",
                      "format": "date"
                    },
                    "inputs_used": {
                      "type": "object"
                    },
                    "results": {
                      "type": "object",
                      "description": "gross, deductions {epf, socso, eis, lindung, pcb, zakat, total}, net, employer {epf, socso, eis, total}, yearly {pcb, net}; all RM."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "affected_fields": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "assumptions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "summary": {
                      "type": "string",
                      "description": "One paragraph to relay as is, in the requested locale."
                    },
                    "methodology_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "API switched off"
          }
        }
      }
    }
  }
}
