Skip to content

Payment Callback

POST

Provide your callback URL when creating a wallet, activating API access, or generating a payment link. Moolre sends HTTP POST notifications to this URL for successful payments and failed payment attempts. Successful callbacks use P01; failed callbacks use P02 and include a failure reason. Payouts send no callback: use webhooks for them.

Handling successful and failed callbacks

  • Validate the callback and its expected secret before changing payment records. IP allowlisting is an additional safeguard, not a replacement for callback verification.
  • Match data.externalref to the payment attempt in your system. Handle duplicate notifications idempotently so the same callback does not apply the same business action twice.
  • For status 1, code P01, and data.txstatus 1, process the successful-payment outcome after validating the callback and transaction details.
  • For status 0, code P02, and data.txstatus 2, record the failed attempt and its reason. Do not mark the payment as paid, credit the wallet, or fulfil an order from this callback.
  • Use payername, payernetwork, and payerinstitution to show who paid and from which network on receipts and in reconciliation. Store them as reported; do not treat payername as identity verification.
  • Accept null transactionid, zero-valued amount/value strings, and empty optional references in failed callbacks. Do not require a transactionid to find the attempt when externalref is available.
  • Verify the X-Moolre-Signature header against the raw request body before you trust a callback (see Webhooks and callbacks). data.secret is deprecated and will be removed after 2027-03-31.
  • Dedupe on event_id: it is identical on every retry and resend. Answer 2xx quickly; a non-2xx answer or a timeout is retried for up to 72 hours.
  • This page is about callbacks. Webhooks (webhook 1 and webhook_url on the wallet) are separate, use another body, and also report payouts.
  • A callback arriving at your server is not itself proof of a successful payment. The payment outcome is in the payload; P02 is a payload code, not an HTTP status code.

Callback fields

The top-level fields describe the payment outcome. The transaction fields below are inside data. P02 is a payment failure code, not an HTTP status code.

Payment callback envelope and transaction fields
FieldDescriptionFormat
statusResult of the payment.
  • 1Successful
  • 0Failed
integer
codePayment outcome code: P01 (successful) or P02 (failed). Not an HTTP status code.string
messageOutcome message, such as Transaction Successful or Transaction Failed.string
dataTransaction details, including txstatus, externalref, and the payer’s name, network, and institution; failed callbacks may include reason and a null transactionid.object
goNavigation hint; null in these callback examples.null
event_idUnique id of this event: evt_ followed by 24 hex characters. It is identical on every retry and resend, so store it and ignore an id you already processed. Also sent in the X-Moolre-Event-Id header.string
eventEvent name: payment.succeeded or payment.failed here. Also sent in the X-Moolre-Event header.string
createdWhen the event was created, ISO 8601 UTC with Z.string
metaHolds notices: meta.notices is an array of advisories (always present, may be empty). It has no requestid. Currently WEBHOOK_SIGNATURE_AVAILABLE: verify the X-Moolre-Signature header instead of data.secret, which will be removed after 2027-03-31.object
data.txstatusTransaction status.
  • 0Pending
  • 1Successful
  • 2Failed
Integer
data.payerThe payer number associated with the payment attempt. A failed callback does not establish that funds were debited.String
data.payernameRegistered name on the payer’s account, as returned by the payment network. Use it for receipts and reconciliation, not as identity verification. May be empty or absent, for example in a failed callback.String
data.payernetworkNetwork the payer paid from, such as MTN, TELECEL, or AT. May be empty or absent, for example in a failed callback.String
data.payerinstitutionInstitution that processed the payment for the payer, such as MTN. For mobile money it usually matches payernetwork. May be empty or absent, for example in a failed callback.String
data.terminalidTerminal ID associated with the payment. Can be an empty string.String
data.accountnumberThe destination Moolre wallet account number. A failed callback does not mean this wallet was credited.String
data.nameMerchant reference name or identifier associated with the terminal. Can be an empty string.String
data.amountTransaction amount, encoded as a decimal string. Can be "0" in a failed callback.String (decimal)
data.valueTransaction value after applicable fees, encoded as a decimal string. Can be "0" in a failed callback.String (decimal)
data.transactionidMoolre transaction identifier. Can be null for a failed payment; use externalref to identify the payment attempt.String or null
data.externalrefThe reference supplied by your integration. Use it to correlate the callback with the payment attempt.String
data.thirdpartyrefTransaction reference from the payment institution. Can be an empty string.String
data.reasonFailure reason returned with a failed callback. May be absent from successful callbacks. Treat it as a diagnostic string, not a guaranteed list of separate causes.String (when supplied)
data.secretCallback verification secret. Validate it against the expected secret for your integration; never use the example placeholder as a real secret.String
data.tsTransaction timestamp (GMT), formatted as YYYY-MM-DD HH:mm:ss.String

Successful payment callback

A successful payment has status 1, code P01, and data.txstatus 1.

{
  "status": 1,
  "code": "P01",
  "message": "Transaction Successful",
  "data": {
    "txstatus": 1,
    "payer": "233XXXXXXXXX",
    "payername": "JANE DOE",
    "payernetwork": "MTN",
    "payerinstitution": "MTN",
    "terminalid": "",
    "accountnumber": "1000000000001",
    "name": "",
    "amount": "101",
    "value": "98.97",
    "transactionid": "10000001",
    "externalref": "ORDER-1001",
    "thirdpartyref": "3000000001",
    "secret": "YOUR_CALLBACK_SECRET",
    "ts": "2026-11-15 09:30:00"
  },
  "go": null,
  "event_id": "evt_0123456789abcdef01234567",
  "event": "payment.succeeded",
  "created": "2026-11-15T09:30:00Z",
  "meta": {
    "notices": [
      {
        "code": "WEBHOOK_SIGNATURE_AVAILABLE",
        "message": "Verify the X-Moolre-Signature header instead of data.secret; data.secret will be removed after 2027-03-31.",
        "docs": "https://docs.moolre.com/guides/webhooks"
      }
    ]
  }
}

Failed payment callback

A failed payment has status 0, code P02, and data.txstatus 2. data.reason explains the failure; data.transactionid can be null.

{
  "status": 0,
  "code": "P02",
  "message": "Transaction Failed",
  "data": {
    "txstatus": 2,
    "payer": "233XXXXXXXXX",
    "terminalid": "",
    "accountnumber": "1000000000001",
    "name": "",
    "amount": "0",
    "value": "0",
    "transactionid": null,
    "externalref": "ORDER-1002",
    "thirdpartyref": "",
    "reason": "LOW_BALANCE_OR_PAYEE_LIMIT_REACHED_OR_NOT_ALLOWED",
    "secret": "YOUR_CALLBACK_SECRET",
    "ts": "2026-11-15 09:31:00"
  },
  "go": null,
  "event_id": "evt_89abcdef0123456789abcdef",
  "event": "payment.failed",
  "created": "2026-11-15T09:31:00Z",
  "meta": {
    "notices": [
      {
        "code": "WEBHOOK_SIGNATURE_AVAILABLE",
        "message": "Verify the X-Moolre-Signature header instead of data.secret; data.secret will be removed after 2027-03-31.",
        "docs": "https://docs.moolre.com/guides/webhooks"
      }
    ]
  }
}

Callback Source IP Addresses

To help verify that incoming payment callbacks originate from Moolre, add the IP addresses listed below to your server's allowlist.

Moolre sends payment callbacks from these IP addresses. Allowlisting them helps protect your callback endpoint by restricting requests to approved sources.

Moolre payment callback source IP addresses
VersionSource addressCopy address
IPv4174.138.44.22
IPv4174.138.40.67
IPv4192.241.135.134
IPv62604:a880:400:d1:0:3:4cf0:c001
IPv62604:a880:400:d0::1a77:4001
IPv62604:a880:400:d0::4234:2001

Security Note: IP allowlisting adds an extra layer of security but should not be your only method of verification. Always validate the callback secret, verify the transaction details, and use HTTPS to secure callback communication.