Reserved Account Webhooks

Reserved Account webhooks are sent to your server via the webhook url specified on your dashboard when you recieve money through a reserved account. As soon as a transaction is confirmed Marasoft Pay sends you a webhook that contains all the data for that transaction.


How to Integrate

1. Set up your server for receiving webhooks

Code Sample
    <?php

    // Retrieve the request's body and parse it as JSON
        $input = @file_get_contents("php://input");
        $event = json_decode($input);

    // Do something with $event
        http_response_code(200); // PHP 5.4 or greater
    ?>
    // Using Express
        app.post("/my/webhook/url", function(req, res) {

    // Retrieve the request's body
        var event = req.body;

    // Do something with event
        res.send(200);
    });

2. Webhook for reserved account collections are sent to the collection webhook url on your dashboard.


3. Sample webhook response for reserved account collections

Sample Response
{
    "channel": "RESERVED_ACCOUNT",
    "reserved_account_tag": "123",
    "reserved_account_number": "8028024XXX",
    "reserved_account_name": "MDT \/ AVNL - KENEDY JUDE",
    "reserved_account_reference": "7800770361678570908948903XXX",
    "transaction_amount": "300000",
    "settled_amount": "299960",
    "msft_ref": "090405230428144046819952590XXX|225550098_639918241682689XXX",
    "source_account_number": "1017432XXX",
    "source_account_name": "Shago-",
    "source_bank_code": "MONIEPOINT MICROFINANCE BANK",
    "narration": "1017432705\/8028024905\/MDT \/ AVNL - KE Session ID: 090405230428144046819952590167",
    "created_at": "2023-04-28 02:43:04"
}