1.3 REST API Initiator request Response

The REST API returns an initial response for processing which you will use to POST to iPay to finalise the transactions

On successful posting the API should return the following response

{
  "header_status": 200,
  "status": 1,
  "data": {
    "sid": "87491e89-a997-401f-8816-3422fa0219b9",
    "oid":"001",
    "amount":"200",
    "account":"GA257298",
    "payment_channels": [
      {
        "name": "MPESA",
        "paybill": "510800"
      },
      {
        "name": "AIRTEL",
        "paybill": "510800"
      }
    ]
  },
  "hash":"75bc1fa140b731be4829b887d2b8d62f038c741b9672c743eba226a9e2f2858a"
}

To validate the response hash The hash is generated by concatenation of the account, amount, oid, sid, mpesa, paybill, airtel, airtel_paybill.


<?php
    $sign_datastring 
$account.$amount.$oid.$sid.$mpesa.$paybill.$airtel.$airtel_paybill;
    
with the above example the string will be

    
//This datastring is signed with the same algorithm and the same security key used in the create api ie
    
hash_hmac("sha256"$sign_datastring"key");
    
/**********************************************************************************************************/
?>