- Payouts
- Collections
When to use webhooks
Webhooks are event-based and enable real-time updates of third-party systems as they are triggered and sent out immediately when specific events related to the transaction happen. They’re useful for methods and events that occur outside your application’s control, such as:- Getting paid via mobile money or USSD
- Pending payment transactions to successful
Webhook notifications include an authentication header with your public key encoded in base64 format. This can be used to validate that a webhook notification was sent from us.Idempotency: Process transactions based on their unique transaction_reference to avoid duplicate actions.
Validating Webhook Payloads with HMAC
Our webhook notifications include a header called x-payaza-signature which is an HMAC SHA512 signature generated from the event payload using your secret key. To ensure the integrity and authenticity of webhook events:- Always validate the x-payaza-signature before processing any event.
- Compute an HMAC SHA512 hash using the received payload and your secret key. The secret key doesn’t need to be base64 encoded
- Compare the generated hash with the x-payaza-signature in the request header.
- Ensure that the event is processed only if the computed hash matches the received signature
HMAC Sample
How To Set Up Your Webhook URL
- Log in to your Payaza dashboard
- Click on the Settings option which is located on the left side-bar of the dashboard
- Click on the Developers option from the dropdown menu.
- Navigate to add your respective webhook URL to each transaction type.
- Select the Update Webhooks button to update your webhook URLs
Payaza Webhook Notification Samples
Transfer
Successful transfer
Failed transfer
Collections
This webhook notifies your server when a collection event occurs (funds received, failed, status updates). Use it to update order state, reconcile payments, trigger downstream flows, or notify customers.Collection webhook
Field Reference
| Name | Format | Description |
|---|---|---|
transaction_reference | string | Unique reference assigned to the transaction |
transaction_status | string | Status for the transaction. Values: Funds Received, Transaction Failed This describes the event that triggered the webhook. |
virtual_account_number | string | The virtual account number used to collect funds (present for Virtual Account collection flows). |
transaction_fee | double | Fee charged on the transaction |
amount_received | double | Amount received on this transaction |
initiated_date | string (datetime) | When the payer initiated the transaction. |
current_status_date | string (datetime) | Timestamp when the current webhook status was recorded. |
received_from | array | Contains the Payer’s details |
└── account_name | string | Payer account name |
└── account_number | string | Payer account number (may be null for some channels). |
└── bank_name | string | Payer bank name (may be null for some channels). |
merchant_reference | string | Your merchant reference (returns for VA & Checkout collection). |
status | string | Status of operation. Values: Completed, Failed |
session_id | string | Session identifier for the payment flow |
channel | string | Collection channel.BENIN_COLLECTIONS, EFT_COLLECTIONS, GH_MOBILEMONEY, CAMEROUN_COLLECTIONS, CIV_COLLECTIONS, KENYA_COLLECTIONS, UGANDA_COLLECTIONS, TANZANIA_COLLECTIONS, VirtualAccount, Card, Apple Pay, Google Pay |
branch | boolean | Whether a branch-collected payment is involved (true/false). |
currency_code | string | ISO-4217 currency code. Examples: XOF, GHS, KES, UGX, TZS, NGN, ZAR, XAF, USDT, USDC. |
business_fk | integer | Internal business/merchant foreign key |
business_branch_fk | integer | Returns when branch value is true |
customer | array | The customer’s information |
└── email_address | string | Customer’s email address |
└── first_name | string | Customer’s first name |
└── last_name | string | Customer’s last name |
└── mobile_number | string | Customer’s mobile number |
request_amount | double | The amount passed in the payload request |
amount_validation | string | Validation of amount paid. Values: EXACT, UNDERPAYMENT, OVERPAYMENT |