API Documentation
API ReferenceInvestment

Compare investment scenarios

Compare multiple investment scenarios with different interest rates.

POST
/investment-comparison

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

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"
}
{
  "error": "Rate limit exceeded"
}