1.4.4 Recurring Billing

The endpoint is:

The parameters needed for this are as follows:

Parameter Name Data Type(Data Length) Description Channel(MPESA)
sid alphanumeric (64) The sid from the initiator request responses Y
vid alphanumeric(12) The iPay Merchant vendor id Y
email alphanumeric(30) Customer Email Address Y
cardid alphanumeric(64) The tokenized card id that is sent on email Y
phone alphanumeric(15) Customer Telephone number. if no phone number is used.PAD a default number Y
hash alphanumeric(64) A digital signature hash of the data for verification. Y

The hash is generated from a datastring which is a concatenation of the parameters: sid, vid, email, cardid and phone it is a HMAC with the sha256 hashing algorithm. Sample PHP script of the same is show below:

//your SECRET KEY 
$key "SECretKey";
$datastring $sid.$vid.$cardid.$phone.$email;

$generated_hash hash_hmac('sha256',$datastring $key);


Expected Response on Successfull card transaction.

"p1":"","p2":"","p3":"","p4":"","msisdn_id":"John Doe","msisdn_idnum":"123456",