Skip to main content
Instant Payment Notifications (IPNs) allow FinConnect-powered apps to receive real-time payment status updates from the provider. When a customer completes or fails a payment, the provider sends an HTTP request to your registered IPN URL so your server can update the order status immediately.
Currently, only PesaPal supports IPN registration via FinConnect. Calling registerIpn() on a ClickPesa SDK instance will throw an error: "IPN registration not supported by this provider".

Register an IPN URL

Call sdk.registerIpn() with your publicly accessible callback URL and the notification type (GET or POST). The method authenticates with PesaPal, registers the URL, and returns an ipnId.
The returned ipnId is stored by PesaPal and used to identify your notification endpoint. You must pass it to every subsequent pay() call.

Set up your IPN handler

Your IPN handler must respond with HTTP 200 quickly. PesaPal sends OrderTrackingId, OrderMerchantReference, and OrderNotificationType as query parameters for GET-type notifications.
Use a dedicated /ipn route and return 200 as quickly as possible. Perform any database updates or downstream API calls asynchronously so the response is not delayed.
Your IPN URL must be publicly accessible — PesaPal cannot reach localhost. Use a tunneling service such as ngrok during local development to expose your server to the internet.

Connect IPN registration to payments

The full flow is: register the IPN URL, capture the returned ipnId, then pass it to pay(). FinConnect merges the ipnId into the request payload as notification_id automatically.

Azampay callback

Setting callback api

Azampay uses an HTTP POST Request to send back the transaction status. Finconnect helps to fetch the public key for verifying the signature to ensure the data sent isn’t tampered with. Call sdk.handlecallback() to fetch the public key and verify the signature automatically.