developed a USSD application using php and mysql.
Note : call the API's for every activities
we are starting with 1. Register first. the rest are coming soon

Welcome to Abrabo Pa
======================
1. Register
2. Pay Premium
3. Stop Auto Deduct
4. Claims
5. Policy Status
6. T&C
7. Helpline



1. Register
=================================
=================================
=================================
   enter full name 
   enter dateofbirth == > call Api to check if dateofbirth is valid : localhost/abrabo_pa_ussd/api/age.php

request : 
{
  "life_type": "Main Life", not "life_type": "Main Life" is defult
  "date_of_birth": "1967-04-11"
}

response : 
{
    "ok": true
}


   select gender (Male Or Fermale)

   ===> Do you want to add dependence Y/N
        

        if Y then  enter no of dependence ==> if 1 allow only one entery if 2 allow only 2 entery : note the maximum is 2
        dependence full name 
        dependence dateofbirth
        dependence gender
         
         if N then avoid  dependence

   Select Product == > call api to select all products :localhost/abrabo_pa_ussd/api/product.php

{
    "ok": true,
    "count": 4,
    "products": [
        {
            "product_index": 14957,
            "product_name": "Abrabo Pa Insurance"
        },
        {
            "product_index": 14965,
            "product_name": "Afentoboa"
        },
        {
            "product_index": 14967,
            "product_name": "Nimedee Ye"
        },
        {
            "product_index": 14966,
            "product_name": "Wo Daakye Nti"
        }
    ]
}


note : if i select "Abrabo Pa Insurance" then pick "product_index": 14957, to get the Sum assured

   Select Sum assured == > call api to select all the sum assured : localhost/abrabo_pa_ussd/api/sum_assured.php

request : {
  "product_index": 14957
}

response : 
{
    "ok": true,
    "product_index": 14957,
    "count": 6,
    "sum_assured": [
        2000,
        4000,
        6000,
        8000,
        10000,
        15000
    ]
}


note : if you select sum_assured : "2000"  pass both sum_assured & "product_index": 14957, to get  Premium
   

Select Premium  ==> call APi and put the dependent "no." entered eg. 2 : localhost/abrabo_pa_ussd/api/get_premium.php   

request : {
  "product_index": "14957",
  "sum_assured": "15000",
  "no": ""
}


response : 
{
    "ok": true,
    "product_index": 14957,
    "product_name": "Abrabo Pa Insurance",
    "total_premium": 18
}


now call API  : localhost/abrabo_pa_ussd_api/signup.php to insert into the database all the variable collected below is the request & response
note add the dependent too. 


request : {
  "mobile_money_number": "233244309547",
  "full_name": "John Mensah",
  "date_of_birth": "1990-05-12",
  "gender": "Male",
  "sum_assured": 2000,
  "product_id": 14957,
  "product_name": "Abrabo Pa Insurance",
  "total_premium": 2.4,
  "momo_network": "MTN",
  "addlife_mobile_money_number": ["233501111111", "233502222222"],
  "addlife_full_name": ["Mary Mensah", "Kofi Mensah"],
  "addlife_date_of_birth": ["1970-08-20", "1965-03-10"],
  "addlife_gender": ["Femal", "Male"],
  "addlife_relationship": ["Mother", "Father"]
}


response : 
{
    "ok": true,
    "message": "Subscription created successfully",
    "subscriptions_id": 42,
    "premium": 2.4,
    "additional_lives_inserted": 2
}


   
   
2. Pay Premium
=========================================
=========================================
=========================================


if i select 2 (Pay Premium) call the API : localhost/abrabo_pa_ussd/api/look_up.php
note : load only the policy_number for the user to select which policy_number for payment.

API :localhost/abrabo_pa_ussd/api/look_up.php
request :
{
  "mobile_money_number": "233244229547"
}

results : 
{
    "ok": true,
    "data": {
        "policy_number": "02260000000004",
        "total_premium": 69.44,
        "momo_network": "Telecel"
    }
}

Once i select (1) eg which is 02260000000004 : call API : localhost/abrabo_pa_ussd_api/pay_premium.php

let look_up.php:policy_number=pay_premium.php:policy_number , pay_premium.php : mobil_no = $phoneNumber ,

pay_premium.php:momo_network = $draft["momo_network"] ,pay_premium.php:amount = $draft["total_premium"] 


request : {
  "policy_number": "ABR02260000001",
  "mobil_no": "233244229547",
  "amount": "1",
  "momo_network": "VODAFONE"
}

results :
{"ok":true,"refNo":"4-ABR02260000001","gateway_http_code":200,"gateway_response":{"responseCode":"03","responseMessage":"Processing payment","uniwalletTransactionId":"1770803107223PO"}}

3. Stop Auto Deduct
========================================
========================================
========================================
if i select 3 (Stop Auto Deduct) call the API : localhost/abrabo_pa_ussd/api/look_up.php
note : load only the policy_number for the user to select which policy_number for payment.

API :localhost/abrabo_pa_ussd/api/look_up.php
request :
{
  "mobile_money_number": "233244229547"
}

results : 
{
    "ok": true,
    "data": {
        "policy_number": "02260000000004",
        "total_premium": 69.44,
        "momo_network": "Telecel"
    }
}


Once i select (1) eg which is 02260000000004 : call API : localhost/abrabo_pa_ussd/api/stop_autodebit.php

let look_up.php:policy_number=stop_autodebit.php:policy_number , mobil_no = $phoneNumber ,


request :  
{
  "policy_number": "ABR02260000001",
  "mobil_no": "233201345600"
}


results :
{
    "ok": false,
    "message": "Policy not found or mandate_id missing",
    "policy_number": "ABR02260000001"
}




4. Claims
========================================
========================================
========================================

if i select 4 (Claims) call the API : localhost/abrabo_pa_ussd/api/look_up.php then look_up.php:mobile_money_number = $phoneNumber
note : load only the policy_number for the user to select which policy_number for payment.

API :localhost/abrabo_pa_ussd/api/look_up.php
request :
{
  "mobile_money_number": "233244229547"
}

results : 
{
    "ok": true,
    "data": {
        "policy_number": "02260000000004",
        "total_premium": 69.44,
        "momo_network": "Telecel"
    }
}

Once i select (1) eg which is 02260000000004 : call API : localhost/abrabo_pa_ussd/api/claims_signup.php for signup
note : claims_signup.php:policy_number = look_up.php:policy_number so we dont capture, claims_signup.php:mobile_money_number = $phoneNumber so we dont capture

Now: Enter full_name_deceased , selet claim_type (Death (Main),Death(Parent/Parent-in-law),Accidental,Critical Illness) ,date_of_incident


API : localhost/abrabo_pa_ussd/api/claims_signup.php
====================================================
request : {
  "mobile_money_number": "233244229547",
  "policy_number": "ABR02260000001",
  "full_name_deceased": "Mercy Baah Adjei",
  "claim_type": "DEATH",
  "date_of_incident": "2026-02-07"
}

Results : {
    "ok": true,
    "status": "EXISTS",
    "claim_id": 11,
    "claim_number": "26020900006"
}



5. Policy Status
============================
============================
============================
if i select 5 (Policy Status) call the API : localhost/abrabo_pa_ussd/api/look_up.php then look_up.php:mobile_money_number = $phoneNumber
note : load only the policy_number for the user to select which policy_number.

API :localhost/abrabo_pa_ussd/api/look_up.php
=============================================
request :
{
  "mobile_money_number": "233244229547"
}

results : 
{
    "ok": true,
    "data": {
        "policy_number": "02260000000004",
        "total_premium": 69.44,
        "momo_network": "Telecel"
    }
}

Once i select (1) eg. which is 02260000000004 : call API : localhost/abrabo_pa_ussd/api/policy_status.php to view policy status
note : policy_status.php : policy_number =  look_up.php : policy_number

Request : ?policy_number=ABR02260000003

results : {
    "ok": true,
    "policy_number": "ABR02260000003",
    "status": "ACTIVE",
    "cover": "8000.00",
    "premium": 69.44,
    "paid": 416.64
}


6. T&C
=======================
=======================
=======================
if i select 6 (T&C) call the API :localhost/abrabo_pa_ussd_api/terms_condition.php

request : 
{
  "mobile_no": "233244229547"
}


results : 
{
    "ok": true,
    "message": "SMS sent successfully",
    "response": "{\"rate\":0.0243,\"messageId\":\"7034a8b2-75d3-455d-b5df-5304b502e651\",\"status\":0,\"networkId\":\"62001\",\"clientReference\":null,\"statusDescription\":\"request submitted successfully\"}"
}





