1. Send a POST request
Call /api/v1/validate with a JSON body containing the ID number.
API Reference
Integrate South African ID validation into your app with one simple JSON request. Send an idNumber and receive validation status, checks, and derived identity details in the response.
Base URL
Endpoint
Content Type
1. Send a POST request
Call /api/v1/validate with a JSON body containing the ID number.
2. Read the JSON response
Check isValid, then use derivedData for values like date of birth, age, gender, and citizenship.
3. Handle failed checks
If isValid is false, inspect the errors and checks fields to understand what failed.
Here is the simplest way to integrate with the API.
curl -X POST "https://api.idvalid.co.za/api/v1/validate" \ -H "Content-Type: application/json" \ -d '{ "idNumber": "9001015800085" }'const response = await fetch("https://api.idvalid.co.za/api/v1/validate", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ idNumber: "9001015800085", }),}); const data = await response.json(); if (!response.ok) { throw new Error("Validation request failed");} if (data.isValid) { console.log(data.derivedData);} else { console.log(data.errors);}| Field | Type | Required | Description |
|---|---|---|---|
| idNumber | string | Yes | A South African ID number to validate. |
A successful request returns JSON like this:
{ "normalizedValue": "9001015800085", "isValid": true, "checks": { "length": { "status": "Passed", "errorCode": null }, "checksum": { "status": "Passed", "errorCode": null } }, "errors": [], "derivedData": { "dateOfBirth": "1990-01-01", "age": 36, "gender": "male", "citizenship": "South African citizen" }}If you are integrating inside this Next.js app, you can use the built-in proxy route instead of calling the upstream API directly.
This route accepts the same JSON body and forwards the request to the validation service on the server.
const response = await fetch("/api/validate-id", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ idNumber: "9001015800085", }),}); const data = await response.json();| Status | Meaning |
|---|---|
| 200 | Request processed. Check isValid in the response body. |
| 400 | Missing idNumber or invalid JSON body. |
| 502 | The validation service could not be reached when using the site proxy route. |
Start with one validation request, confirm the response shape in your app, then wire the returned fields into your form or verification flow.