deepidv Logo

Developer reference

South Africa ID number verification API: 13-digit structure, Luhn check and Home Affairs records

The South African ID number has thirteen digits: date of birth, a gender sequence, a citizenship digit, a legacy digit and a Luhn check digit. Most of it can be validated offline, and the Department of Home Affairs record confirms the rest, including whether the person is alive. The deepidv verification API validates every field, authenticates the Smart ID card or green ID book and matches the face against the record.

Last reviewed October 2026

Field layout of the 13-digit ID number

SA ID number fields by position
DigitsFieldImplementation notes
1-6Date of birthYYMMDD. Check it is a real calendar date. The century is not encoded.
7-10Gender sequence0000 to 4999 female, 5000 to 9999 male.
11Citizenship0 South African citizen, 1 permanent resident, 2 recognised refugee.
12Legacy digitFormerly a race classification, no longer used. Usually 8. Do not interpret it.
13Check digitLuhn algorithm.

Running the Luhn check

  1. Starting from the right, double every second digit, beginning with the twelfth digit.
  2. Where a doubled value exceeds 9, subtract 9.
  3. Sum all thirteen digits after the doubling.
  4. The number is valid when the sum is a multiple of 10.

A number that passes Luhn and has a real date of birth is well formed. It still needs the Home Affairs check to prove the person exists and is alive.

Response contents of a South Africa ID verification API

A parse result tells you whether a number is well formed. A verification response tells you whether the person in front of the camera owns it. deepidv runs one session: document capture with OCR and the AI document fraud check, face liveness with a 1:1 match to the document photo, the Home Affairs record check, PEP and sanctions screening, and an optional 1:N match that flags the same face behind a second account.

  • One decision per session, with an outcome for every step, delivered by webhook (session.status.verified, session.status.rejected, session.status.failed).
  • A reason for every non-pass outcome, separating malformed input, a record that was not found, a mismatch between document and record, and a registry that did not answer.
  • A signed verification receipt with a UTC timestamp per step, anchored on Base L2 with zero personal data on chain, checkable at proof.deepidv.com.

Capturing the Smart ID card and ID book

The Smart ID card carries a chip and, on the back, a PDF417 barcode that encodes the printed data alongside a Code 39 barcode holding the ID number. The green barcoded ID book is still valid and is easier to forge, so deepidv weights its document fraud check accordingly. Both are captured in a single shot.

Home Affairs record checks

The Department of Home Affairs population register confirms the ID number, name, date of birth, citizenship status and whether the person is recorded as deceased, and returns a photo for face matching. Personal information is processed under POPIA.

Liveness, face match and FICA

FICA requires accountable institutions to identify and verify clients under a risk-based approach, documented in a Risk Management and Compliance Programme, with suspicious transactions reported to the FIC through goAML. deepidv runs passive liveness, a face match and PEP and sanctions screening in one session, and Arbiter drafts the report for review.

How deepidv runs South Africa verification

deepidv is a verification engine and agentic compliance suite built from the ground up, without third-party verification APIs underneath. The engine is SOC 2, ISO 27001 and PCI DSS certified, and deepidv is a member of DIACC and the AVPA. Luna, the verification agent, builds and sends South Africa verification workflows from the platform or from any LLM through MCP. Arbiter, the compliance agent, maps the workflow to FICA requirements, monitors accounts after onboarding and drafts suspicious transaction reports for the FIC for your team to review.

Frequently asked questions

How do you tell gender from a South African ID number?

Digits 7 to 10. 0000 to 4999 is female, 5000 to 9999 is male.

What does the eleventh digit mean?

Citizenship status: 0 for a citizen, 1 for a permanent resident, 2 for a recognised refugee.

What check digit algorithm does the SA ID number use?

Luhn, the same mod 10 algorithm used on payment cards.

What is the twelfth digit?

A legacy digit that once recorded race classification. It is no longer used and should not be interpreted.

Can you tell if an ID holder has died?

Not from the number. The Home Affairs record check returns a deceased status.

API documentation

Read the endpoints, field names and webhook events in the docs, or book a call to scope South Africa verification for your product.

Related pages