Webhooks
Environment: Live
Payout, settlement, collection and bulk payout results sent to your webhook_url: events, codes, the hooks list, pages, signatures and a sample of each.
# Webhooks
Payout, settlement, collection and bulk payout results sent to your webhook_url: events, codes, the hooks list, pages, signatures and a sample of each.
## Webhooks and callbacks are two different things
Callbacks are what Moolre has always sent to a callback URL: one POST per collection, payment link payment, bulk batch or settlement. They have not changed. They are described in Webhooks and callbacks and on the Payment callback page.
Webhooks are new. You switch them on per wallet, they go to their own address, and they cover money out as well as money in: payouts, settlements, collections and bulk payouts, all in one layout. Nothing is sent until you switch them on, and callbacks keep arriving as before. If you use both, handle each payment once: match it by externalref or transactionid.
| | Callbacks | Webhooks |
| --- | --- | --- |
| Switched on by | A callback URL on the wallet, payment link or batch | webhook = 1 and webhook_url on the wallet |
| Sent to | callback | webhook_url |
| Covers | Collections, checkout and payment links, bulk batch completion, settlements | Payouts, settlements, collections (checkout and links included), bulk batch completion |
| Single payouts | Not sent | payout.succeeded, payout.failed, payout.reversed |
| Body | One transaction in data | data.hooks: a list of transactions, exactly as the status check returns them |
| Event details | event, event_id and created at the top level | event, event_id and created inside data |
| Verified with | X-Moolre-Signature (data.secret until 2027-03-31) | X-Moolre-Signature |
- [Webhooks and callbacks](https://docs.moolre.com/guides/webhooks-and-callbacks)
- [Payment callback](https://docs.moolre.com/api/payments/webhook)
## Step by step: switch webhooks on
- webhook 1 needs a webhook_url, sent in the same request or stored earlier (APGW16 otherwise).
- Sent without accountname, callback, api and settlement, these three fields change nothing else, on a wallet of any currency.
- Only transactions made after you switch on are sent. Nothing old is replayed.
- webhook, callback and email are independent: switch on any of them, or all.
- Account Status shows webhook, webhook_url and email.
1. Create a POST route on an https URL on port 443 with a valid public certificate, for example https://shop.example.com/moolre/hooks. Use a different route from your callback.
2. Call Update Account with webhook_url set to that URL and webhook set to 1. You can also do it in the Moolre app, on the wallet.
3. Read the wallet secret (on the wallet in the Moolre app, or the secret field of a full Update Account reply). It is the same secret that signs callbacks. A wallet that had none gets one when you switch webhooks on; an existing secret never changes.
4. Call Send test webhook and check that data.delivered is true.
5. To stop, send webhook 0. Sending an empty webhook_url also switches webhooks off.
```curl
curl https://api.moolre.com/open/account/update \
-H "Content-Type: application/json" \
-H "X-API-USER: $MOOLRE_USER" \
-H "X-API-KEY: $MOOLRE_KEY" \
-d '{
"type": 1,
"accountnumber": "1000000000001",
"webhook": 1,
"webhook_url": "https://shop.example.com/moolre/hooks"
}'
```
- [Update Account](https://docs.moolre.com/api/accounts/update)
- [Send test webhook](https://docs.moolre.com/api/webhooks/test)
- [Email alerts](https://docs.moolre.com/guides/email-alerts)
## Events
Every webhook has an event and a code. The status at the top level is 1 for the good outcome and 0 for failures and reversals.
- A settlement is a payout Moolre makes for you to your settlement account. It sends settlement.* and never payout.* as well. Its externalref is empty, because you did not create it.
- A reversal is sent when a payout or settlement that was already reported as paid is reversed and the money goes back to the wallet.
- An item of a bulk payout sends payout.succeeded or payout.failed like any payout. bulk_payout.completed adds one message when the whole batch is final.
- There is no webhook for invoices or for a payment link that expires. A payment made through an invoice or a link arrives as payment.succeeded; read Invoice Status or Payment Status for the rest.
| event | code | Sent when |
| --- | --- | --- |
| payout.succeeded | P11 | Payouts (single, or items of a bulk payout) were paid |
| payout.failed | P12 | Payouts failed and the money is back in the wallet |
| payout.reversed | P13 | A payout already reported as paid was reversed |
| settlement.succeeded | P21 | Settlements were paid |
| settlement.failed | P22 | Settlements failed and the money is back in the wallet |
| settlement.reversed | P23 | A settlement already reported as paid was reversed |
| payment.succeeded | P01 | Money was received: mobile money, Payment ID, bank, checkout and payment links |
| payment.failed | P02 | Collections failed. No money moved |
| bulk_payout.completed | BLK40 | Every payout of a batch is final |
| webhook.test | WHT00 | You called Send test webhook |
## The body
status, code, message, go and meta are at the top level. Everything else is inside data: event, event_id, created (ISO 8601 UTC), accountnumber, page, pages and hooks. Notices are in meta.notices, which is empty when there are none. There is no data.secret.
Each entry of data.hooks is the full reply you would get from Transfer Status or Payment Status for that transaction: status, code, message, data and go, with code SS01 for a successful transaction and SS02 for a failed one. Read hook.data.txstatus (1 paid, 2 failed), hook.data.transactionid and hook.data.externalref.
txtype is 1 for money in and 2 for money out. Amounts are strings. A failed collection has no transaction: transactionid is empty and the amounts are 0.00, so match it by externalref.
```json
{
"status": 1,
"code": "P11",
"message": "Payouts successful",
"data": {
"event": "payout.succeeded",
"event_id": "evt_0123456789abcdef01234567",
"created": "2026-11-25T13:40:20Z",
"accountnumber": "1000000000001",
"page": 1,
"pages": 1,
"hooks": [
{
"status": 1,
"code": "SS01",
"message": "Transaction Successful",
"data": {
"txstatus": 1,
"txtype": 2,
"accountnumber": "1000000000001",
"payer": "",
"payee": "0240000001",
"amount": "250",
"value": "250",
"fee": "1",
"networkfee": "0",
"transactionid": "10000001",
"externalref": "PAY-1001",
"thirdpartyref": "3000000001",
"ts": "2026-11-25 13:40:12",
"created_at": "2026-11-25T13:40:12Z"
},
"go": null
},
{
"status": 1,
"code": "SS01",
"message": "Transaction Successful",
"data": {
"txstatus": 1,
"txtype": 2,
"accountnumber": "1000000000001",
"payer": "",
"payee": "0240000002",
"amount": "115.5",
"value": "115.5",
"fee": "1",
"networkfee": "0",
"transactionid": "10000002",
"externalref": "PAY-1002",
"thirdpartyref": "3000000002",
"ts": "2026-11-25 13:40:12",
"created_at": "2026-11-25T13:40:12Z"
},
"go": null
}
]
},
"go": null,
"meta": {
"notices": []
}
}
```
## Pages
Moolre looks for newly final transactions about every ten seconds and sends one webhook per wallet and event. A single transaction goes out on its own: Moolre never waits to fill a page.
When more than 100 transactions of one event become final at the same time, they are split into pages of up to 100. page is the number of this page and pages is how many there are. Each page is a complete webhook with its own event_id, its own signature and its own retries, so a page that fails does not hold up the others, and pages can arrive in any order.
| Became final together | You receive |
| --- | --- |
| 1 paid payout | payout.succeeded, page 1 of 1, one hook |
| 250 paid payouts | payout.succeeded pages 1 of 3 (100), 2 of 3 (100) and 3 of 3 (50) |
| 250 paid and 30 failed payouts | The three pages above, and payout.failed page 1 of 1 (30) |
> **You do not need to collect all the pages:** Every hook stands on its own. Process the hooks of a page as soon as you have stored its event_id.
## Request headers
| Header | Meaning |
| --- | --- |
| X-Moolre-Signature | t=<unix seconds>,v1=<hex>. v1 is the HMAC-SHA256 of "<t>.<raw body>" keyed with your wallet secret. A new signature is created for every attempt. |
| X-Moolre-Event-Id | The event id, also in the body: event_id on callbacks, data.event_id on webhooks. It stays the same across retries and resends: dedupe on it. |
| X-Moolre-Event | The event name, also in the body: event on callbacks, data.event on webhooks. |
| X-Moolre-Delivery-Attempt | Attempt number, starting at 1. |
| User-Agent | Moolre-Webhooks/1 |
| Content-Type | application/json |
## Verify the signature
The signature is the same as on callbacks: HMAC-SHA256 with your wallet secret over "<t>.<raw body>", compared with v1 in constant time, with t no more than 5 minutes from your clock. Use the raw body: parsing and re-serialising the JSON breaks the signature. Only after that, read data.
```nodejs
import crypto from 'node:crypto';
import express from 'express';
const SECRET = process.env.MOOLRE_WALLET_SECRET; // your wallet callback secret
const TOLERANCE_SECONDS = 300;
function verifyMoolreSignature(rawBody, header, secret) {
const parts = Object.fromEntries(
String(header || '').split(',').map((p) => p.trim().split('=', 2)),
);
const t = Number(parts.t);
if (!Number.isInteger(t) || !parts.v1) return false;
if (Math.abs(Date.now() / 1000 - t) > TOLERANCE_SECONDS) return false; // stale: replay protection
const expected = crypto.createHmac('sha256', secret).update(t + '.' + rawBody).digest('hex');
const a = Buffer.from(expected);
const b = Buffer.from(parts.v1);
return a.length === b.length && crypto.timingSafeEqual(a, b);
}
const app = express();
// The signature covers the exact bytes Moolre sent, so read the raw body. Do not parse JSON first.
app.post('/moolre/webhook', express.raw({ type: '*/*' }), (req, res) => {
const raw = req.body.toString('utf8');
if (!verifyMoolreSignature(raw, req.get('X-Moolre-Signature'), SECRET)) return res.sendStatus(400);
const { data } = JSON.parse(raw);
// Already stored data.event_id? Answer 200 and stop: this is a retry or a resend.
for (const hook of data.hooks) queueWork(data.event, hook.data); // your own queue: one job per transaction
res.sendStatus(200); // acknowledge fast, do the slow work afterwards
});
```
```python
import hashlib
import hmac
import os
import time
from flask import Flask, request
SECRET = os.environ["MOOLRE_WALLET_SECRET"] # your wallet callback secret
TOLERANCE_SECONDS = 300
app = Flask(__name__)
def verify_moolre_signature(raw_body: bytes, header: str, secret: str) -> bool:
parts = dict(p.strip().split("=", 1) for p in (header or "").split(",") if "=" in p)
t, v1 = parts.get("t", ""), parts.get("v1", "")
if not t.isdigit() or not v1:
return False
if abs(time.time() - int(t)) > TOLERANCE_SECONDS: # stale: replay protection
return False
signed = t.encode() + b"." + raw_body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, v1)
@app.post("/moolre/webhook")
def webhook():
raw = request.get_data() # the exact bytes Moolre sent, not re-serialised JSON
if not verify_moolre_signature(raw, request.headers.get("X-Moolre-Signature", ""), SECRET):
return "", 400
data = request.get_json()["data"]
# Already stored data["event_id"]? Answer 200 and stop: this is a retry or a resend.
for hook in data["hooks"]:
queue_work(data["event"], hook["data"]) # your own queue: one job per transaction
return "", 200
```
```php
<?php
$secret = getenv('MOOLRE_WALLET_SECRET'); // your wallet callback secret
$tolerance = 300;
function verify_moolre_signature(string $rawBody, string $header, string $secret, int $tolerance): bool
{
$t = null;
$signatures = [];
foreach (explode(',', $header) as $part) {
$kv = explode('=', trim($part), 2);
if (count($kv) !== 2) { continue; }
if ($kv[0] === 't') { $t = $kv[1]; }
if ($kv[0] === 'v1') { $signatures[] = $kv[1]; }
}
if ($t === null || !ctype_digit($t) || !$signatures) { return false; }
if (abs(time() - (int) $t) > $tolerance) { return false; } // stale: replay protection
$expected = hash_hmac('sha256', $t . '.' . $rawBody, $secret);
foreach ($signatures as $signature) {
if (hash_equals($expected, $signature)) { return true; }
}
return false;
}
$raw = file_get_contents('php://input'); // the exact bytes Moolre sent
if (!verify_moolre_signature($raw, $_SERVER['HTTP_X_MOOLRE_SIGNATURE'] ?? '', $secret, $tolerance)) {
http_response_code(400);
exit;
}
$data = json_decode($raw, true)['data'];
// Already stored $data['event_id']? Answer 200 and stop: this is a retry or a resend.
foreach ($data['hooks'] as $hook) {
queue_work($data['event'], $hook['data']); // your own queue: one job per transaction
}
http_response_code(200);
```
```go
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"io"
"math"
"net/http"
"os"
"strconv"
"strings"
"time"
)
const toleranceSeconds = 300
func verifyMoolreSignature(raw []byte, header, secret string) bool {
var t, v1 string
for _, part := range strings.Split(header, ",") {
kv := strings.SplitN(strings.TrimSpace(part), "=", 2)
if len(kv) != 2 {
continue
}
switch kv[0] {
case "t":
t = kv[1]
case "v1":
v1 = kv[1]
}
}
ts, err := strconv.ParseInt(t, 10, 64)
if err != nil || v1 == "" {
return false
}
if math.Abs(float64(time.Now().Unix()-ts)) > toleranceSeconds { // stale: replay protection
return false
}
mac := hmac.New(sha256.New, []byte(secret))
mac.Write([]byte(t + "."))
mac.Write(raw)
expected := hex.EncodeToString(mac.Sum(nil))
return hmac.Equal([]byte(expected), []byte(v1))
}
func webhook(w http.ResponseWriter, r *http.Request) {
raw, _ := io.ReadAll(r.Body) // the exact bytes Moolre sent
if !verifyMoolreSignature(raw, r.Header.Get("X-Moolre-Signature"), os.Getenv("MOOLRE_WALLET_SECRET")) {
w.WriteHeader(http.StatusBadRequest)
return
}
var body struct {
Data struct {
Event string `json:"event"`
EventID string `json:"event_id"`
Hooks []struct {
Data map[string]any `json:"data"`
} `json:"hooks"`
} `json:"data"`
}
if json.Unmarshal(raw, &body) != nil { // import "encoding/json"
w.WriteHeader(http.StatusBadRequest)
return
}
// Already stored body.Data.EventID? Answer 200 and stop: this is a retry or a resend.
for _, hook := range body.Data.Hooks {
queueWork(body.Data.Event, hook.Data) // your own queue: one job per transaction
}
w.WriteHeader(http.StatusOK)
}
```
```c
using System;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
public static class MoolreWebhook
{
private const int ToleranceSeconds = 300;
public static bool Verify(string rawBody, string header, string secret)
{
string t = null, v1 = null;
foreach (var part in (header ?? "").Split(','))
{
var kv = part.Trim().Split('=', 2);
if (kv.Length != 2) continue;
if (kv[0] == "t") t = kv[1];
if (kv[0] == "v1") v1 = kv[1];
}
if (!long.TryParse(t, out var ts) || string.IsNullOrEmpty(v1)) return false;
if (Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - ts) > ToleranceSeconds) return false; // stale: replay protection
using var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret));
var expected = hmac.ComputeHash(Encoding.UTF8.GetBytes(t + "." + rawBody));
byte[] given;
try { given = Convert.FromHexString(v1); } catch (FormatException) { return false; }
return CryptographicOperations.FixedTimeEquals(expected, given);
}
}
// In an ASP.NET Core endpoint, read the raw body with Request.Body before any model binding,
// call MoolreWebhook.Verify(raw, Request.Headers["X-Moolre-Signature"], secret), then dedupe on data.event_id and handle each entry of data.hooks.
```
- [Callbacks: verification step by step](https://docs.moolre.com/guides/webhooks-and-callbacks#build-endpoint)
- [Verify with an SDK](https://docs.moolre.com/sdks#webhooks)
## Handle each transaction exactly once
- Do not rely on arrival order.
- Return 2xx for an event you already processed, so Moolre stops retrying it.
- For a high-value action, confirm with Transfer Status or Payment Status.
1. Create a table webhook_events with event_id as its primary key. Insert data.event_id (also in X-Moolre-Event-Id) first; if it is already there, answer 200 and stop.
2. For each hook, find your own record by hook.data.externalref (or transactionid for settlements and payments you did not start).
3. Change it only if it is not already in that final state, and check the amount.
4. Answer 2xx within a few seconds, and do the slow work afterwards.
```nodejs
async function handle(data) {
const inserted = await db.query(
'INSERT INTO webhook_events (event_id, received_at) VALUES (?, NOW()) ON DUPLICATE KEY UPDATE event_id = event_id',
[data.event_id],
);
if (inserted.affectedRows === 0) return; // seen before: acknowledge and ignore
for (const { data: tx } of data.hooks) {
switch (data.event) {
case 'payout.succeeded':
await db.query("UPDATE payouts SET status = 'paid', moolre_id = ? WHERE externalref = ? AND status <> 'paid'", [tx.transactionid, tx.externalref]);
break;
case 'payout.failed':
case 'payout.reversed':
await db.query("UPDATE payouts SET status = 'failed' WHERE externalref = ?", [tx.externalref]); // the money is back in the wallet
break;
case 'payment.succeeded':
await db.query("UPDATE orders SET status = 'paid' WHERE externalref = ? AND status <> 'paid'", [tx.externalref]);
break;
}
}
}
```
## A sample of every webhook
All values are examples. payout.succeeded is shown above, under The body.
## payout.failed
The recipient was not paid and the money is back in the wallet. A failed externalref cannot be used again.
```json
{
"status": 0,
"code": "P12",
"message": "Payouts failed",
"data": {
"event": "payout.failed",
"event_id": "evt_1123456789abcdef01234567",
"created": "2026-11-25T13:40:20Z",
"accountnumber": "1000000000001",
"page": 1,
"pages": 1,
"hooks": [
{
"status": 1,
"code": "SS02",
"message": "Transaction Failed",
"data": {
"txstatus": 2,
"txtype": 2,
"accountnumber": "1000000000001",
"payer": "",
"payee": "0240000003",
"amount": "80",
"value": "80",
"fee": "1",
"networkfee": "0",
"transactionid": "10000003",
"externalref": "PAY-1003",
"thirdpartyref": "",
"ts": "2026-11-25 13:40:12",
"created_at": "2026-11-25T13:40:12Z"
},
"go": null
}
]
},
"go": null,
"meta": {
"notices": []
}
}
```
## payout.reversed
A payout reported as paid earlier was reversed by Moolre. The status check now shows it as failed.
```json
{
"status": 0,
"code": "P13",
"message": "Payouts reversed",
"data": {
"event": "payout.reversed",
"event_id": "evt_2123456789abcdef01234567",
"created": "2026-11-25T13:40:20Z",
"accountnumber": "1000000000001",
"page": 1,
"pages": 1,
"hooks": [
{
"status": 1,
"code": "SS02",
"message": "Transaction Failed",
"data": {
"txstatus": 2,
"txtype": 2,
"accountnumber": "1000000000001",
"payer": "",
"payee": "0240000001",
"amount": "250",
"value": "250",
"fee": "1",
"networkfee": "0",
"transactionid": "10000001",
"externalref": "PAY-1001",
"thirdpartyref": "3000000001",
"ts": "2026-11-25 13:40:12",
"created_at": "2026-11-25T13:40:12Z"
},
"go": null
}
]
},
"go": null,
"meta": {
"notices": []
}
}
```
## settlement.succeeded
Sent once the settlement is final.
```json
{
"status": 1,
"code": "P21",
"message": "Settlements successful",
"data": {
"event": "settlement.succeeded",
"event_id": "evt_3123456789abcdef01234567",
"created": "2026-11-25T13:40:20Z",
"accountnumber": "1000000000001",
"page": 1,
"pages": 1,
"hooks": [
{
"status": 1,
"code": "SS01",
"message": "Transaction Successful",
"data": {
"txstatus": 1,
"txtype": 2,
"accountnumber": "1000000000001",
"payer": "",
"payee": "0240000001",
"amount": "1200",
"value": "1200",
"fee": "0",
"networkfee": "0",
"transactionid": "10000020",
"externalref": "",
"thirdpartyref": "3000000020",
"ts": "2026-11-25 13:40:12",
"created_at": "2026-11-25T13:40:12Z"
},
"go": null
}
]
},
"go": null,
"meta": {
"notices": []
}
}
```
## settlement.failed
```json
{
"status": 0,
"code": "P22",
"message": "Settlements failed",
"data": {
"event": "settlement.failed",
"event_id": "evt_4123456789abcdef01234567",
"created": "2026-11-25T13:40:20Z",
"accountnumber": "1000000000001",
"page": 1,
"pages": 1,
"hooks": [
{
"status": 1,
"code": "SS02",
"message": "Transaction Failed",
"data": {
"txstatus": 2,
"txtype": 2,
"accountnumber": "1000000000001",
"payer": "",
"payee": "0240000001",
"amount": "1200",
"value": "1200",
"fee": "0",
"networkfee": "0",
"transactionid": "10000021",
"externalref": "",
"thirdpartyref": "",
"ts": "2026-11-25 13:40:12",
"created_at": "2026-11-25T13:40:12Z"
},
"go": null
}
]
},
"go": null,
"meta": {
"notices": []
}
}
```
## settlement.reversed
```json
{
"status": 0,
"code": "P23",
"message": "Settlements reversed",
"data": {
"event": "settlement.reversed",
"event_id": "evt_5123456789abcdef01234567",
"created": "2026-11-25T13:40:20Z",
"accountnumber": "1000000000001",
"page": 1,
"pages": 1,
"hooks": [
{
"status": 1,
"code": "SS02",
"message": "Transaction Failed",
"data": {
"txstatus": 2,
"txtype": 2,
"accountnumber": "1000000000001",
"payer": "",
"payee": "0240000001",
"amount": "1200",
"value": "1200",
"fee": "0",
"networkfee": "0",
"transactionid": "10000020",
"externalref": "",
"thirdpartyref": "3000000020",
"ts": "2026-11-25 13:40:12",
"created_at": "2026-11-25T13:40:12Z"
},
"go": null
}
]
},
"go": null,
"meta": {
"notices": []
}
}
```
## payment.succeeded
Mobile money, Payment ID, bank, checkout and payment link collections.
```json
{
"status": 1,
"code": "P01",
"message": "Payments successful",
"data": {
"event": "payment.succeeded",
"event_id": "evt_6123456789abcdef01234567",
"created": "2026-11-25T13:40:20Z",
"accountnumber": "1000000000001",
"page": 1,
"pages": 1,
"hooks": [
{
"status": 1,
"code": "SS01",
"message": "Transaction Successful",
"data": {
"txstatus": 1,
"txtype": 1,
"accountnumber": "1000000000001",
"payer": "233240000001",
"payee": "ACME SHOP",
"amount": "101",
"value": "98.97",
"fee": "2.03",
"networkfee": "0",
"transactionid": "10000010",
"externalref": "ORDER-1001",
"thirdpartyref": "3000000010",
"ts": "2026-11-25 13:40:12",
"created_at": "2026-11-25T13:40:12Z"
},
"go": null
}
]
},
"go": null,
"meta": {
"notices": []
}
}
```
## payment.failed
No money moved. Payment Status shows the same transaction, and the payment callback carries the reason.
```json
{
"status": 0,
"code": "P02",
"message": "Payments failed",
"data": {
"event": "payment.failed",
"event_id": "evt_7123456789abcdef01234567",
"created": "2026-11-25T13:40:20Z",
"accountnumber": "1000000000001",
"page": 1,
"pages": 1,
"hooks": [
{
"status": 1,
"code": "SS02",
"message": "Transaction Failed",
"data": {
"txstatus": 2,
"txtype": 1,
"accountnumber": "1000000000001",
"payer": "233240000001",
"payee": "",
"amount": "0.00",
"value": "0.00",
"fee": "0.00",
"networkfee": "0.00",
"transactionid": "",
"externalref": "ORDER-1002",
"thirdpartyref": "",
"ts": "2026-11-25 13:40:12",
"created_at": "2026-11-25T13:40:12Z"
},
"go": null
}
]
},
"go": null,
"meta": {
"notices": []
}
}
```
## bulk_payout.completed
data.batch is the batch summary. Each hook also has index, receiver and state. A payout still pending after 72 hours (data.batch.unresolved true) has code SS08 and txstatus 0: check it with Transfer Status. A batch of 500 payouts arrives as five pages of 100.
```json
{
"status": 1,
"code": "BLK40",
"message": "Bulk payout completed",
"data": {
"event": "bulk_payout.completed",
"event_id": "evt_8123456789abcdef01234567",
"created": "2026-11-25T13:40:20Z",
"accountnumber": "1000000000001",
"page": 1,
"pages": 1,
"batch": {
"batchid": "bat_3f9c2a1d7e5b4c60",
"batchref": "PAYROLL-2026-11",
"currency": "GHS",
"status": "completed",
"unresolved": false,
"total_amount": "150.00",
"counts": {
"total": 2,
"queued": 0,
"submitted": 0,
"pending": 0,
"succeeded": 1,
"failed": 1
},
"succeeded_amount": "100.00",
"failed_amount": "50.00",
"completed": "2026-11-25T13:40:19Z"
},
"hooks": [
{
"status": 1,
"code": "SS01",
"message": "Transaction Successful",
"data": {
"txstatus": 1,
"txtype": 2,
"accountnumber": "1000000000001",
"payer": "",
"payee": "0240000001",
"amount": "100",
"value": "100",
"fee": "1",
"networkfee": "0",
"transactionid": "10000001",
"externalref": "PAY-1",
"thirdpartyref": "3000000001",
"ts": "2026-11-25 13:40:12",
"created_at": "2026-11-25T13:40:12Z",
"index": 0,
"receiver": "0240000001",
"state": "succeeded"
},
"go": null
},
{
"status": 1,
"code": "SS02",
"message": "Transaction Failed",
"data": {
"txstatus": 2,
"txtype": 2,
"accountnumber": "1000000000001",
"payer": "",
"payee": "0240000002",
"amount": "50",
"value": "50",
"fee": "1",
"networkfee": "0",
"transactionid": "10000002",
"externalref": "PAY-2",
"thirdpartyref": "",
"ts": "2026-11-25 13:40:12",
"created_at": "2026-11-25T13:40:12Z",
"index": 1,
"receiver": "0240000002",
"state": "failed"
},
"go": null
}
]
},
"go": null,
"meta": {
"notices": []
}
}
```
## webhook.test
Sent by Send test webhook, in the same layout with one sample transaction. The event, the code WHT00, the zero amount and the reference WEBHOOK-TEST mark it as a test: acknowledge it and ignore it.
```json
{
"status": 1,
"code": "WHT00",
"message": "Webhook test",
"data": {
"event": "webhook.test",
"event_id": "evt_9123456789abcdef01234567",
"created": "2026-11-25T13:40:20Z",
"accountnumber": "1000000000001",
"page": 1,
"pages": 1,
"hooks": [
{
"status": 1,
"code": "SS01",
"message": "Transaction Successful",
"data": {
"txstatus": 1,
"txtype": 1,
"accountnumber": "1000000000001",
"payer": "233240000001",
"payee": "ACME SHOP",
"amount": "0",
"value": "0",
"fee": "0",
"networkfee": "0",
"transactionid": "0",
"externalref": "WEBHOOK-TEST",
"thirdpartyref": "",
"ts": "2026-11-25 13:40:12",
"created_at": "2026-11-25T13:40:12Z"
},
"go": null
}
]
},
"go": null,
"meta": {
"notices": []
}
}
```
## Retries, deliveries and resends
A webhook that is not answered with a 2xx status within 20 seconds is retried on this schedule, then marked dead. The event_id and the body never change; the signature is created fresh for every attempt.
Webhook deliveries lists every callback and webhook sent to your wallet with its state, Resend webhook puts one back in the queue with the same event_id, and Send test webhook sends webhook.test to your webhook_url.
| Attempt | When |
| --- | --- |
| 1 | Immediately, when the event happens |
| 2 | 1 minute after attempt 1 failed |
| 3 | 5 minutes after attempt 2 failed |
| 4 | 30 minutes after attempt 3 failed |
| 5 | 2 hours after attempt 4 failed |
| 6 | 6 hours after attempt 5 failed |
| 7 | 24 hours after attempt 6 failed |
| 8 | 48 hours after attempt 7 failed |
| 9 | 72 hours after attempt 8 failed. If this one fails too the event is dead |
- [Webhook deliveries](https://docs.moolre.com/api/webhooks/deliveries)
- [Resend webhook](https://docs.moolre.com/api/webhooks/resend)
- [Send test webhook](https://docs.moolre.com/api/webhooks/test)
- [Callback source IP addresses](https://docs.moolre.com/guides/callback-source-ip-addresses)
## Checklist
- [ ] webhook_url is an https URL on port 443, separate from your callback.
- [ ] The signature is verified on the raw body, with a 5-minute time window.
- [ ] You dedupe on data.event_id and match each hook by externalref or transactionid.
- [ ] You loop over data.hooks: never read a transaction from data itself.
- [ ] A payment that reaches you as a callback and as a webhook is credited once.
- [ ] You handle payout.reversed as well as payout.failed.
- [ ] You ignore webhook.test.
- [ ] You monitor Webhook deliveries for dead events.