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
- Login at https://app.onekhusa.com
- Go to Developers → Webhooks
- Open Webhook Configuration page
Step 2: Configure Your Webhook
Configure your webhook endpoint with the required information below.Required Information
| Field | Description | Example |
|---|---|---|
| Callback URL | Your secure HTTPS endpoint for receiving webhook notifications | https://yourdomain.com/webhooks/khusa |
| Event Type | The types of events you want your webhook to listen for | payment.success and payment.reverse |
Callback URL Requirements
Ensure your webhook endpoint meets the following requirements:
- HTTPS Protocol: The URL must use HTTPS for secure communication
- Public Accessibility: The URL must be publicly accessible and reachable from the internet
- POST Request Support: The endpoint should accept HTTP POST requests with JSON payloads
- Response Confirmation: Respond with HTTP 200 OK to confirm successful receipt of the webhook
Webhook Events
1. Payment Success Event
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:
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
Event Types Summary
| Event Type | Event Code | Description | When Triggered |
|---|---|---|---|
| Payment Success | payment.success | Indicates that the payment transaction is completed successfully | After successfully processing the payment |
| Payment Reverse | payment.reverse | Indicates that the payment transaction is reversed | After successfully processing the reversal |
Webhook Payload Structure
All webhook payloads follow the same JSON structure with two main sections: Webhook and Transaction.Complete Payload Example
- Payment Success
- Payment Reverse
Field Descriptions
| Field | Type | Description | Example |
|---|---|---|---|
SourceAccountNumber | string | The account number from which the payment originates | 74629183 |
SourceAccountName | string | The name registered on the payer’s account | OneKhusa Suppliers Ltd |
SourceInstitution | string | The financial institution or bank that holds the payer’s account | National Bank of Malawi |
SourceReferenceNumber | string | A unique reference identifier provided by the payer’s bank for this transaction | SRC4K8L2M9Q1Z |
BeneficiaryAccountNumber | string | The account number of the receiving merchant or beneficiary | 102345678901 |
TransactionReferenceNumber | string | A unique transaction reference generated by the system to identify the transaction | TXN7D3P8L5Q2X |
TransactionDescription | string | A short description or purpose of the transaction | Payment for invoice INV-2025-1010 |
TransactionAmount | decimal | The total monetary value of the transaction | 320500.75 |
TransactionFee | decimal | The fee charged for processing the transaction | 1000.00 |
TransactionDate | datetime | The exact date and time when the transaction was processed (ISO 8601 format) | 2025-10-10T14:50:00Z |
TransactionStatusCode | string | Indicates the current status of the transaction | S (Success), F (Failed) |
TransactionCode | string | An internal transaction code used for classification or processing | BAM, MWM |