Generate CPF projection
Generate multi-year CPF contribution projection with cumulative totals.
1 min read
post/projection
Request example
curl --request POST \
--url https://simplycpf.com/api/cpf/projection \
--header 'Content-Type: application/json' \
--data-raw '{
"income": 5000,
"age": 30,
"years": 5
}'import requests
url = "https://simplycpf.com/api/cpf/projection"
headers = {
"Content-Type": "application/json",
}
payload = {
"income": 5000,
"age": 30,
"years": 5
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)const response = await fetch('https://simplycpf.com/api/cpf/projection', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"income": 5000,
"age": 30,
"years": 5
})
});
const data = await response.json();
console.log(data);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://simplycpf.com/api/cpf/projection',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"income": 5000,
"age": 30,
"years": 5
}',
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://simplycpf.com/api/cpf/projection"
payload := strings.NewReader("{\n \"income\": 5000,\n \"age\": 30,\n \"years\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://simplycpf.com/api/cpf/projection"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"income\": 5000,\n \"age\": 30,\n \"years\": 5\n}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());require 'uri'
require 'net/http'
url = URI('https://simplycpf.com/api/cpf/projection')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = url.scheme == 'https'
request = Net::HTTP::Post.new(url)
request['Content-Type'] = 'application/json'
request.body = '{
"income": 5000,
"age": 30,
"years": 5
}'
response = http.request(request)
puts response.read_bodyResponse
{
"input": {
"income": 0,
"age": 0,
"years": 1
},
"projections": [
{
"year": 1,
"age": 1,
"ageGroup": "<string>",
"contribution": {
"totalContribution": 1,
"employer": 1,
"employee": 1
},
"cumulative": {
"totalContribution": 1,
"employer": 1,
"employee": 1
}
}
],
"projectionInput": {
"monthlyIncome": 0,
"birthDate": "01/1995",
"startAge": 0,
"endAge": 1,
"housingWithdrawal": 0,
"citizenship": "citizen",
"voluntaryTopUp": {
"amount": 0,
"account": "SA",
"frequency": "monthly"
},
"oaToSaTransfer": {
"amount": 0,
"timing": "now"
}
},
"yearlyBalances": [
{
"year": 1,
"age": 1,
"ageGroup": "<string>",
"balances": {
"oa": 1,
"sa": 1,
"ma": 1,
"ra": 1
},
"contributions": {
"employee": 1,
"employer": 1,
"total": 1
},
"distribution": {
"oa": 1,
"sa": 1,
"ma": 1,
"ra": 1
},
"interestEarned": {
"oa": 1,
"sa": 1,
"ma": 1,
"ra": 1,
"extraInterest": 1
},
"housingWithdrawal": 1,
"voluntaryTopUp": 1
}
],
"milestones": {
"age55": {
"oa": 1,
"sa": 1,
"ma": 1,
"ra": 1
},
"age65": {
"oa": 1,
"sa": 1,
"ma": 1,
"ra": 1
},
"age70": {
"oa": 1,
"sa": 1,
"ma": 1,
"ra": 1
}
},
"cpfLifeEstimate": {
"standardMonthly": 1,
"escalatingStartMonthly": 1,
"basicMonthly": 1,
"deferredTo70Monthly": 1
},
"totalContributed": 1,
"totalInterestEarned": 1
}{
"error": "<string>"
}{
"error": "Rate limit exceeded"
}post/projection
Body
application/jsonResponses
application/json
Successful projection
Show child attributesHide child attributes
Show child attributesHide child attributes
Calendar year
Age during this year
Age group description
Show child attributesHide child attributes
Range: >= 0
Birth date in MM/YYYY format. Used when startAge is omitted.
Pattern: ^\d{2}/\d{4}$
Example:"01/1995"
Range: >= 0
Range: > 0
Show child attributesHide child attributes
Show child attributesHide child attributes
Error message
Error message