Webhooks Events

For payments, our platform supports two primary payment-related events that developers can set up webhooks for:

PAYMENT RECEIVED

  • Description: This event is triggered whenever a customer makes a successful payment. The webhook will send details of the transaction, including the amount, payer information, and transaction status.

  • Use Case: Automate confirmation processes, update records, or trigger further actions in your system upon receiving a payment.

  • Sample Payload

{
  "eventType": "PAYMENT RECEIVED",
  "data": {
    "id": "0969231256LCP2C95",
    "status": "SUCCESS",
    "paymentReference": "9055ce7e-97bc-4c54-9164-83a899de6e26",
    "orderReference": "0969231256", // unique order reference
    "collectedAmount": "10000",
    "collectedCurrency": "TZS",
    "message": "Payment from 0969231256",
    "updatedAt": "2024-04-11T04:58:31.036Z",
    "createdAt": "2024-04-11T04:58:31.036Z",
    "customer": {
      "customerName": "Said Juma",
      "customerPhoneNumber": "255600000000",
      "email": "juma@email.com" // for customers with emails
    }
  }
}

PAYMENT FAILED

  • Description: This event is triggered when a payment attempt fails. The webhook will include information about the failure reason, the attempted transaction, and any relevant error codes.

  • Use Case: Notify customers of payment issues, log failed transactions, or prompt retries.

  • Sample payload

{
  "eventType": "PAYMENT FAILED",
  "data": {
    "id": "0969231256LCP2C95",
    "status": "FAILED",
    "orderReference": "0969231256", // unique order reference
    "message": "Insufficient balance",
    "updatedAt": "2024-04-11T04:58:31.036Z",
    "createdAt": "2024-04-11T04:58:31.036Z",
  }
}

Last updated