Phone Number Verification in Tanzania
Verify a Tanzanian mobile-money subscriber and retrieve the subscriber's name and identity details.
Tanzania phone verification routes through the national interoperability hub, which covers all major mobile-money operators in the country. On success, the response includes the subscriber's full name and, when the hub has it, a identity field containing a 15-digit National Identification Number (NIN).
Prerequisites
You'll need an API key. See Quickstart or Authentication if you don't have one yet.
Note: Verification endpoints use an API key in the
X-API-Keyheader β not a Bearer token.
Make the verification request
Tanzania requires a networkCode to identify the mobile-money operator.
curl -X POST https://api.lira.com/api/v1/verify/phone \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "+255621804189",
"country": "TZ",
"networkCode": "503"
}'
Request body fields
| Field | Type | Required | Description |
|---|---|---|---|
phoneNumber |
string | Yes | Tanzanian phone number in E.164 format (e.g. +255621804189) or without the leading + (stripped internally). |
country |
string | Yes | Always TZ. |
networkCode |
string | Yes | Mobile-money operator code. See the supported operators table below. |
Important:
networkCodeis required for all Tanzania phone verifications. Omitting it will result in aNETWORK_CODE_REQUIREDerror.
Supported operators
| Operator | networkCode |
|---|---|
| M-PESA (Vodacom Tanzania) | 503 |
| Airtel Money | 504 |
| Tigo Pesa / Zantel | 501 |
| Halotel Money | HAL |
Read the result
Successful verification
{
"id": "d4e5f6g7-...-...-...-...",
"status": "success",
"verificationType": "PHONE_NUMBER",
"identifier": "+255621804189",
"country": "TZ",
"verifiedAt": "2026-04-08T10:08:00.000Z",
"verified": true,
"phoneNumber": "+255621804189",
"firstName": "Test",
"lastName": "Shekimweri",
"fullName": "Test Shekimweri",
"identity": {
"idType": "NIN",
"idValue": "123456789012345"
}
}
Note: The
identityfield is returned when the hub has it. TheidValueis a 15-digit NIN when present.
Failed verification
{
"id": "d4e5f6g7-...-...-...-...",
"status": "failed",
"verificationType": "PHONE_NUMBER",
"identifier": "+255621804189",
"country": "TZ",
"verifiedAt": "2026-04-08T10:08:00.000Z",
"verified": false,
"error": {
"code": "SUBSCRIBER_NOT_FOUND",
"message": "No subscriber found for the provided phone number"
}
}
Note: A
200 OKHTTP response does not mean the verification succeeded. Always check thestatusfield.
Error handling
error.code |
Cause | Action |
|---|---|---|
SUBSCRIBER_NOT_FOUND |
Phone number not registered with the operator | Ask the user to verify their number is correct and active |
INVALID_PHONE_NUMBER |
Phone number format is invalid | Validate format (E.164 with or without +) before submitting |
INVALID_NETWORK_CODE |
networkCode not recognised |
Must be one of: 503, 504, 501, HAL |
NETWORK_CODE_REQUIRED |
Verification submitted without networkCode |
Add networkCode to the request |
PROVIDER_ERROR |
Upstream system returned an error | Retry with exponential backoff |
PROVIDER_TIMEOUT |
Upstream system timed out | Retry β transient error |
For the full error code reference, see Errors.
Next steps
- Bank Account in Tanzania β verify Tanzanian bank accounts
- Phone Number Overview β general phone verification guide
- Errors β complete error code reference
