Files
android/docs/ooredooapi/01-number-validation.md
T

114 lines
1.9 KiB
Markdown

# Number Validation
Validate an Ooredoo mobile number and determine its account type (prepaid, postpaid, or hybrid).
---
## Endpoint
```
GET https://www.ooredoo.mv/ooredoo-prod/QuickPayPackage/v1/numberTypeValidation
```
---
## Request
### Query Parameters
| Parameter | Value | Notes |
|---|---|---|
| `action` | `cust_details` | Always `cust_details` |
| `msisdn` | `9607654321` | Full MSISDN — country code `960` + 7-digit local number |
### curl Example
```bash
curl --request GET \
--url 'https://www.ooredoo.mv/ooredoo-prod/QuickPayPackage/v1/numberTypeValidation?action=cust_details&msisdn=9609654321'
```
---
## Responses
### Success — Prepaid
```json
{
"custType": "PRE",
"msisdn": "9609654321"
}
```
| Field | Type | Description |
|---|---|---|
| `custType` | `string` | `"PRE"` = prepaid customer |
| `msisdn` | `string` | The MSISDN that was queried |
→ Offer **Raastas** top-up only.
---
### Success — Postpaid
```json
{
"custType": "POST",
"msisdn": "9609123456"
}
```
→ Offer **Ooredoo Bill Pay** only.
---
### Success — Hybrid
```json
{
"custType": "HYBRID",
"msisdn": "9609789012"
}
```
→ Offer both **Raastas** and **Ooredoo Bill Pay**. The user must select which service to use.
---
### Failure — Number Not Found
```json
{
"custType": null,
"errorMessage": "Data Not Found",
"msisdn": "9609000000"
}
```
| Field | Type | Description |
|---|---|---|
| `custType` | `null` | Number is not an Ooredoo subscriber |
| `errorMessage` | `string` | `"Data Not Found"` |
Treat `custType: null` as unsupported — fall back to Dhiraagu lookup.
---
## Result Mapping
| `custType` | Service(s) |
|---|---|
| `"PRE"` | Raastas only |
| `"POST"` | Ooredoo Bill Pay only |
| `"HYBRID"` | Raastas + Ooredoo Bill Pay (show chip selector) |
| `null` / absent | Unsupported — fall back to Dhiraagu lookup |
---
 
---
[← README](README.md)