API Documentation
API ReferenceInvestment

Compare investment scenarios

Compare multiple investment scenarios with different interest rates.

POST
/investment-comparison

Request Body

application/json

principal*number

Initial principal amount

Range0 <= value
years*integer

Investment duration in years (1-50)

Range1 <= value <= 50
scenarios*

Investment scenarios to compare (1-10)

Items1 <= items <= 10

Response Body

application/json

application/json

curl -X POST "https://loading/api/cpf/investment-comparison" \  -H "Content-Type: application/json" \  -d '{    "principal": 100000,    "years": 10,    "scenarios": [      {        "name": "CPF OA",        "rate": 2.5      },      {        "name": "CPF SA",        "rate": 4      },      {        "name": "Market",        "rate": 7      }    ]  }'
{
  "input": {
    "principal": 0,
    "years": 0
  },
  "results": [
    {
      "name": "string",
      "rate": 0,
      "finalValue": 0,
      "totalGrowth": 0,
      "growthPercentage": 0
    }
  ]
}
{
  "error": "string"
}