Validate a Canadian SIN (NAS)
VerifNow validates a Canadian Social Insurance Number — numéro d’assurance sociale, hence the
endpoint name nas — for its format and its Luhn check digit, and reports what the number’s series
says about it.
Only collect a SIN where the law requires it. In the private sector that essentially means employers, for income reporting, and financial institutions, for interest-bearing and registered accounts. The federal government’s guidance to individuals says it plainly: some businesses may ask for your SIN, and “this is strongly discouraged, but not illegal”. Validating a SIN you should not be holding does not make holding it better.
Basic SIN validation
POST https://api.verifnow.io/api/v1/validate/nas
X-API-KEY: your_api_key_here
Content-Type: application/json
{
"value": "046 454 286"
}Example response
{
"valid": true,
"message": "Valid SIN format, but numbers starting with 0 are not issued to individuals",
"normalizedValue": "046454286",
"originalValue": "046 454 286",
"validationLevel": "STANDARD",
"nasDetails": {
"checksum_valid": true,
"temporary_resident": false,
"individual_series": false,
"formatted": "046 454 286"
}
}046 454 286 is the sample number the Government of Canada prints on example cards. It is well
formed and its check digit is correct — and it starts with 0, a series not issued to individuals,
which is exactly why it is safe to use as an example. See below.
Spaces and dashes are accepted. normalizedValue is the nine digits; formatted is the printed
form, in three groups of three.
nasDetails
| Field | Meaning |
|---|---|
checksum_valid | The Luhn check digit is correct. |
temporary_resident | The number starts with 9. SINs issued to temporary residents always do, and they expire with the holder’s work permit, study permit or visitor record. |
individual_series | The first digit belongs to a series issued to individuals: 1 to 7, or 9. false for numbers starting with 0 or 8. |
formatted | 046 454 286. |
valid means well formed with a correct check digit. The two series flags are reported, not
enforced — valid stays true — so that you decide what they mean for your use case.
Why the series are flags, not rejections
Numbers starting with 0 are used for tax numbers the Canada Revenue Agency assigns to people who cannot get a SIN, and numbers starting with 8 for business numbers. Service Canada does not publish its allocation table, so this rests on consistent secondary sources rather than an official list — reason enough to report it rather than refuse on it. For payroll, you will want to reject both; see the article for the reasoning.
What the number cannot tell you
- When a temporary resident’s SIN expires. The date is on the holder’s immigration document, not
in the number.
temporary_resident: trueis your cue to ask for it. - The province. The first digit once identified the province of registration, but numbers have been issued across series when a region ran short. A province read from the digit would be a guess, so the API does not return one.
- Whether the SIN was issued, or to whom. Only Service Canada knows. An employer relies on the SIN confirmation letter the employee receives.
Common responses
| Input | valid | message |
|---|---|---|
046 454 286 | true | Valid SIN format, but numbers starting with 0 are not issued to individuals |
| A 1-to-7 series number with a correct check digit | true | Valid SIN |
| A 9-series number with a correct check digit | true | Valid SIN — temporary resident: it expires with the holder’s permit |
046 454 287 | false | SIN check digit does not match — please check the number |
04645428 | false | A SIN is exactly 9 digits |
000 000 000 | true | Valid SIN format, but numbers starting with 0 are not issued to individuals |
000 000 000 passes the Luhn check — its digit sum is zero — which is why a checksum-only validator
accepts it. The series flag is what catches it.
Test with the sample number
Use 046 454 286 in tests, fixtures and documentation. Do not invent a “valid” SIN from the 1-to-7
or 9 series: roughly one nine-digit number in ten has a correct check digit, and tens of millions of
SINs have been issued, so a made-up valid number stands a real chance of being someone’s actual SIN.
If a test needs one, compute it at run time from a prefix rather than committing it as a literal.
What VerifNow keeps
The usage log that meters your calls stores a SIN as *** — no digits at all. See
Rate Limits for quotas; validation of a SIN counts as one call on every plan.
Next steps
- Validating a Canadian SIN — what to accept, what to reject, what to store
- Error Handling — status codes and transport failures