CPFB Apex Apispecs
CPFB Apex Apispecs
Official (Open)
1
Contents
1. INTRODUCTION............................................................................................3
1.1 PURPOSE..................................................................................................................... 3
1.2 DEFINITIONS, ACRONYMS, AND ABBREVIATIONS...................................................................3
1.3 GENERAL USAGE........................................................................................................... 3
1.4 STAGING (UAT) USAGE.................................................................................................. 3
1.5 PRODUCTION USAGE...................................................................................................... 3
1.6 COMMON INTERFACE INFORMATION...................................................................................4
2. PAYROLL API SERVICE..................................................................................5
2.1 API ENDPOINT.............................................................................................................. 5
2.2 JSON REQUEST PAYLOAD............................................................................................... 5
2.2.1 Input Details...................................................................................................... 5
2.2.2 Schema Definition.............................................................................................. 6
2.2.3 Sample JSON Request Payload...........................................................................7
2.3 SUCCESS RESPONSE....................................................................................................... 7
2.3.1 Output Details.................................................................................................... 7
2.3.2 Schema Definition.............................................................................................. 9
2.3.3 Sample Success JSON Response Object...........................................................11
2.4 ERROR RESPONSE....................................................................................................... 12
2.4.1 Output Details.................................................................................................. 12
2.4.2 Schema Definition............................................................................................ 12
2.4.3 Sample Error JSON Response Object................................................................13
2.5 RESPONSE CODE AND MESSAGES...................................................................................13
3. ANNEX...................................................................................................... 14
Official (Open)
2
1. INTRODUCTION
1.1 Purpose
The Central Provident Fund Board (CPFB) provides the submission of contribution details
application programming interface (API) service to allow software developers (SWD) to
incorporate within their payroll software the feature for employers to submit CPF contributions
to CPFB.
To consume the API, the user must be authenticated to APEX 2.0. Please refer to the
documentation “[For SWD] How to call API using OAuth Authz Code Flow.pdf” provided by
GovTech on the steps required.
To access Staging environment, developers must have onboarded APEX Cloud (Refer to the
documentation at https://docs.developer.tech.gov.sg/docs/complete-apex-user-guide).
Official (Open)
3
1.6 Common Interface Information
JSON is case sensitive by specifications.
All date strings are to be represented in compliance to the ISO-8601 standard.
All string fields are subject to validation of the following acceptable characters that is
allowed (in red):
o [a-zA-Z0-9‘@#()\-,./&+_ ] (Note: whitespace is included)
All properties follow the camel-case convention.
Unless stated as optional, all JSON object properties must be specified.
Unless otherwise specified, all JSON services are invoked using HTTP verb POST.
Official (Open)
4
2. PAYROLL API SERVICE
2.1 API Endpoint
Environment Method Endpoint
Sandbox POST https://sandbox.api.gov.sg/cpf/employer-cpf-
(UAT) contributions/v{version
number}/submitCPFContributions
Production POST https://public.api.gov.sg/cpf/employer-cpf-
contributions/v{version
number}/submitCPFContributions
*{version number} is dependent on the available version of the API in APEX.
The JSON request needs to be modified with escape strings and serialised in order to be
acceptable by API service.
Official (Open)
7
2.2.3 Sample JSON Request Payload
{
"csn": "123456789A-PTE-01",
"submissionFileName": "123456789A-PTE-01_May2022",
"paymentMode": "P",
"deductionDate": "",
"submissionFile":
"RiAxMjM0NTY3ODlBUFRFMDEgMDUyMDIyMDUwMTEwMDAxNUZUUC5EVEwgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI
CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCkYwMTIzNDU2Nzg5QVBURTAxIDA1Mj
AyMjA1MDEwMDAwMDAwNjkwMDAwMDAwMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA
gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIApGMDEyMzQ1Njc4OUFQVEUwMSAwNTIwMjIwNTAyMDAwMDAwMDEwMDAwMDAwM
DAwMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC
AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKRjAxMjM0NTY
3ODlBUFRFMDEgMDUyMDIyMDUwNDAwMDAwMDAyMDAwMDAwMDAwMDIgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI
CAgICAgICAgICAgICAgICAgICAgICAgICAgCkYwMTIzNDU2Nzg5QVBURTAxIDA1MjAyMjA1MDcwMD
AwMDAwMTUwMDAwMDAwMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA
gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIApGMDEyMzQ1Njc4OUFQVEUwMSAwNTIwMjIwNTEwMDAwMDAwMDMwMDAwMDAwMDAwMSAgICAgI
CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC
AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKRjAxMjM0NTY3ODlBUFRFMDE
gMDUyMDIyMDUxMTAwMDAwMDAyMDAwMDAwMDAwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI
CAgICAgICAgICAgICAgICAgCkYxMTIzNDU2Nzg5QVBURTAxIDA1MjAyMjA1MDFTMTIzNDU2N0EwMD
AwMDAwMzAwMDAwMDAwMTc1ODM5MDAwMDAwMDAwMEVFbXBsb3llZSBBICAgICAgICAgICAgICAgICA
gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIApGMTEy
MzQ1Njc4OUFQVEUwMSAwNTIwMjIwNTA0UzEyMzQ1NjdBMDAwMDAwMDEwMDAwMDAwMDAwMDAwMDAwM
DAwMDAwMDAgRW1wbG95ZWUgQSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC
AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKRjExMjM0NTY3ODlBUFRFMDEgMDUyMDIyMDU
wMVMyMzQ1Njc4QjAwMDAwMDAzMDAwMDAwMDA0NDcwMDAwMDAwMDAwMDAwRUVtcGxveWVlIEIgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI
CAgICAgICAgCkYxMTIzNDU2Nzg5QVBURTAxIDA1MjAyMjA1MDRTMjM0NTY3OEIwMDAwMDAwMTAwMD
AwMDAwMDAwMDAwMDAwMDAwMDAwMCBFbXBsb3llZSBCICAgICAgICAgICAgICAgICAgICAgICAgICA
gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIApGMTEyMzQ1Njc4OUFQ
VEUwMSAwNTIwMjIwNTAxUzM0NTY3ODlDMDAwMDAwMDA5MDAwMDAwMDIzNDc5MTAwMDAwMDAwMDBFR
W1wbG95ZWUgQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC
AgICAgICAgICAgICAgICAgICAgICAKRjExMjM0NTY3ODlBUFRFMDEgMDUyMDIyMDUwMlMzNDU2Nzg
5QzAwMDAwMDAxMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwIEVtcGxveWVlIEMgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgC
kY5MTIzNDU2Nzg5QVBURTAxIDA1MDAwMDAxNDAwMDAwMDAwMDE2NDAwMCAgICAgICAgICAgICAgIC
AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA
gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAo="
}
Official (Open)
9
Ex: 30000 (for $300.00)
Total MBMF amount for the submission.
totalMbmf 21 String
Ex: 1000 (for $10.00)
Total SINDA amount for the submission.
totalSinda 21 String
Ex: 1000 (for $10.00)
Total CDAC amount for the submission.
totalCdac 21 String
Ex: 20000 (for $200.00)
Total ECF amount for the submission.
totalEcf 21 String
Ex: 10000 (for $100.00)
Total amount for the submission.
grandTotal 21 String
Ex: 150000 (for $1500.00)
Official (Open)
10
"adviceCode": {
"type": "string"
},
"totalContribution": {
"type": "string"
},
"cpfLatePaymentInterest": {
"type": "string"
},
"skillsDevelopmentLevy": {
"type": "string"
},
"totalCommunityChest": {
"type": "string"
},
"totalMbmf": {
"type": "string"
},
"totalSinda": {
"type": "string"
},
"totalCdac": {
"type": "string"
},
"totalEcf": {
"type": "string"
},
"grandTotal": {
"type": "string"
}
},
"required": [
"csn",
"companyName",
"submitterNric",
"submissionFileName",
"submissionDateTime",
"paymentMode",
"deductionDate",
"paynowQrCode",
"submissionStatus",
"monthPaid",
"adviceCode",
"totalContribution",
"cpfLatePaymentInterest",
"skillsDevelopmentLevy",
"totalCommunityChest",
"totalMbmf",
"totalSinda",
"totalCdac",
"totalEcf",
"grandTotal"
]
}
},
"required": [
"timestamp",
"responseCode",
"responseMessage",
"responseData"
]
}
Official (Open)
11
2.3.3 Sample Success JSON Response Object
A successful call to the API service means that the submission is accepted. A JSON response
object that contains the following parameters will be returned in the HTTP response.
{
"timestamp":
2022-06-
09T15:09:38+0800,
"responseCode":
"00",
"responseMessage"
: "Success",
"responseData": {
"csn":
"123456789A-PTE-01",
"companyNa
me": "ABC Pte. Ltd.",
"submitter
Nric":
"SXXXX123A
",
"submissio
nFileName": "123456789A-
PTE-01_May2022",
"submissio
nDateTime": "2022-06-
09T15:09:38+0800",
"paymentMo
de": "P",
"deduction
Date": null,
"paynowQrC
ode":
"+7gbg6aZeAODQLuzga4AzRw
gLseq44E3KHBPoO7swHu1gU7
F7irI3AXB1rDMlTUoAFsXXAH
d33DLAN3hSTgLuAO0PozuOux
6kjAHdztM7g7G86zdcEO3PU6
dQTu0OBAa1jOhho0gIED3MFd
3xBwV0j2GdwF3K2rP4O756uO
BNwdaPsM7s6G82xdcAd3vY5z
wB0aHGhwdzbAHaCBA9zBXR0J
uEODfQZ3ZwPcrQvuLs9XHQm4
O9AalqHibBjA1gV3cNc3zDJw
V0gC7s4GuAM0cIC7HquOBNyh
wT6Du7MB7tYFOxe4qyNwl+Ro
sv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FwN09gzu4O5PgDu7
gDu7gLgLB7hkawB3cYdReOc/
gLgLuwAHu4G6vQEcN2ivnGdx
FwN09gzu4O5MwCu7gLuAuAsH
uGdzBHdxh1F45z+AuAu7gDu7
gDu6gowbBHdzBXQSC3TO4g7s
zCaP2CtwF3EUgGJJgFNxBB0b
tlfMM7iLg7p7BHdydSdABd3A
Hd3AXgWD3DA3gDu4waq/
AXcBdwB04IAnc7RXogLu9cp7
BXQTc3TO4g7szCaPgDu7gDu4
iEOyewR3cwR1G7ZXzDO4i4A7
u4A7u9gp01KC9AndwF4Fg9wz
u4O5Mwii4g7uAuwgEQxKMgju
4w6i9cp7BXQTc3TO4g7szCTp
qENzBHdyTtZBcih+C6+
+5gmBnQ+1bV9+AfnA3kFwKGN
zBHdzBHWSt6zwLuBtIhii4qw
UD2NkAHevqG+AO7uDuAndwB3
cDWM8BWevqG+AO7gYSuDuT4A
7u",
"submissio
nStatus":
"Submitted
",
"monthPaid
": "May 2022",
"adviceCod
e": "05",
"totalCont
ribution": "69000",
"cpfLatePa
ymentInterest": "15000",
"skillsDev
elopmentLevy": "20000",
"totalComm
unityChest": "30000",
"totalMbmf
": "0",
Official (Open)
13
"totalSind
a": "0",
"totalCdac
": "20000",
"totalEcf"
: "10000",
"grandTota
l ": "164000"
}
}
For successful submission, an acknowledgement email will also be sent to the email address(es)
maintained in CPF EZPay.
Official (Open)
14
"type": "string"
},
"errorMessage": {
"type": "string"
}
},
"required": [
"errorCode",
"errorMessage"
]
}
},
"required": [
"timestamp"
"responseCode",
"responseMessage",
]
}
Refer to the Annex (3) for the errorCode and errorMessage details.
Server Error
When an exception occurs during the processing of the request, a JSON response object that
contains the following parameters will be returned in the HTTP response.
{
"timestamp": 2022-06-09T15:09:38+0800
"responseCode": "500",
"responseMessage": "Internal Server Error",
}
Official (Open)
15
Official (Open)
16
3. ANNEX
S/No. Name File
(In Base64)
https://www.cpf.gov.sg/content/
dam/web/employer/making-cpf-
2 Submission file specification
contributions/documents/
CPFEZPayFTPSpecifications.pdf
Official (Open)
17