Overview

The OneKhusa Payment Gateway Webhooks for Collections provide an easy way for merchants to receive real-time updates whenever customers make payments. Instead of manually checking for new payments, webhooks automatically notify your system as soon as a payment event occurs.

Webhook Configuration

Step 1: Access OneKhusa Portal

  1. Login at https://app.onekhusa.com
  2. Go to DevelopersWebhooks
  3. Open Webhook Configuration page

Step 2: Configure Your Webhook

Configure your webhook endpoint with the required information below.

Required Information

Request Headers
Header NameDescriptionExample
X-OneKhusa-Webhook-EventThe request should include this header indicating the event typepayment.success, payment.reverse
X-OneKhusa-Webhook-SignatureA secret signature used to verify the authenticity of webhook notificationsa1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6
Webhook signatures should not be shared with unauthorised users.

Webhook Events

1. Payment Success Event

event_code
string
default:"payment.success"
Event Code: payment.success
  • Description: Triggered when a payment transaction is successfully completed
  • When Sent: After the payment has been processed and funds have been transferred

2. Payment Reverse Event

event_code
string
default:"payment.reverse"
Event Code: payment.reverse
  • Description: Triggered when a payment collection transaction is reversed or refunded
  • When Sent: After the reversal has been processed and funds have been returned to the customer

3. Request To Pay Success Event

event_code
string
default:"payrequest.success"
Event Code: payrequest.success
  • Description: Triggered when a request-to-pay transaction is successfully completed
  • When Sent: After the payment has been processed and funds have been credited to the merchant account

4. Request To Pay Reverse Event

event_code
string
default:"payrequest.reverse"
Event Code: payrequest.reverse
  • Description: Triggered when a request-to-pay transaction is reversed
  • When Sent: After the reversal has been processed and funds have been returned to the customer, the merchant account is debited

Webhook Payload Structure

All webhook payloads follow the same JSON structure with two main sections: Webhook and Transaction.

Complete Payload Example

 {  
    "connectorId": "892353",
    "sourceAccountNumber": "74629183",
    "sourceAccountName": "OneKhusa Suppliers Ltd",
    "sourceInstitution": "National Bank of Malawi",
    "sourceReferenceNumber": "SRC4K8L2M9Q1Z",
    "beneficiaryAccountNumber": "102345678901",
    "transactionReferenceNumber": "250905SLFVXD",
    "transactionDescription": "Payment for invoice INV-2025-1010",
    "transactionAmount": 320500.75,
    "transactionFee": 1000.00,
    "transactionDate": "2025-10-10T14:50:00Z",
    "transactionStatusCode": "S",
    "transactionCode": "BAM",
    "responseCode": "S100"
  }


Field Descriptions

FieldTypeDescriptionExample
ConnectorIdstringUnique 6-digit identifier for the connector247482
SourceAccountNumberstringThe account number from which the payment originates74629183
SourceAccountNamestringThe name registered on the payer’s accountOneKhusa Suppliers Ltd
SourceInstitutionstringThe financial institution or bank that holds the payer’s accountNational Bank of Malawi
SourceReferenceNumberstringA unique reference identifier provided by the payer’s bank for this transactionSRC4K8L2M9Q1Z
BeneficiaryAccountNumberstringThe account number of the receiving merchant or beneficiary102345678901
TransactionReferenceNumberstringA unique transaction reference generated by the system to identify the transactionTXN7D3P8L5Q2X
TransactionDescriptionstringA short description or purpose of the transactionPayment for invoice INV-2025-1010
TransactionAmountdecimalThe total monetary value of the transaction320500.75
TransactionFeedecimalThe fee charged for processing the transaction1000.00
TransactionDatedatetimeThe exact date and time when the transaction was processed (ISO 8601 format)2025-10-10T14:50:00Z
TransactionStatusCodestringIndicates the current status of the transactionS (Success), F (Failed)
TransactionCodestringAn internal transaction code used for classification or processingBAM, MWM
ResponseCodeStringThe code set after the collection transaction is processed. Refer to Transaction Responses for more details.S100
TimedAccountNumberStringThe generated unique temporary (short-lived) account number tied to a request-to-pay transaction11005533
ReferenceNumberStringThe unique reference number generated by the merchant system tied to a request-to-pay transaction1020XDFS76GS777
SourceDescriptionStringThe transaction description generated by the merchant system for the service/product(s) purchased by the customer tied to a request-to-pay transactionSamsung 85inch TV purchase