Pesapal.com

IPN URL Registration Endpoint - Post Request

IPN stands for Instant Payment Notification. When a payment is made against a transaction, Pesapal will trigger an IPN call to the notification URL related to this transaction. This notification URL is usually located on your servers. These notifications allows you to be alerted in real time whenever there is a status change for any transaction.

An IPN is particular important as it allows you to be notified incase the following happens:

  • Your client gets disconnected after payment due to internet issues
  • Your client experiences server errors hence Pesapal and your application gets disconnected before callback URL is loaded.
  • Your client exits your application / closes the browser during payment.
  • The transaction is rejected.

As such, it's mandatory to have IPN configured to allow Pesapal to notify your servers when a status changes. It's also important to note that this IPN URL must be publicly available. In cases where you have strict server rules preventing external systems reaching your end, you must then whitelist all calls from our domain (pesapal.com). Please be informed that IP whitelisting is not feasible as our IP may change without notice.

Before sending Submit Order Requests to Pesapal API 3.0, you are expected to register your IPN URL. Upon registration, you receive a notification Id which is a mandatory field when submitting an order request to Pesapal API 3.0. This notification_id uniquely identifies the endpoint Pesapal will send alerts to whenever a payment status changes for each transaction processed via API 3.0

The URL to our IPN registration API is either:

Authentication

Bearer Token : Use token generated during authentication.

HTTP request headers

Accept: The response format, which is required for operations with a response body.
Content-Type: The request format, which is required for operations with a request body.

Parameter RequiredDescription
Accept Required Should be set to application/json
Content-Type Required Should be set to application/json

Request Parameters

ParameterTypeRequiredDescription
url String Required The notification url Pesapal with send a status alert to.
ipn_notification_type String Required GET or POST. This is the http request method Pesapal will use when triggering the IPN alert.

Sample Request
    {
        "id": "https://www.myapplication.com/ipn",
        "ipn_notification_type": "GET"
    }

Response Parameters

NameTypeDescription
url String The notification url Pesapal with send a status alert to.
created_date String Date and time the IPN URL was registered UTC
ipn_id String A unique identifier that's liked to the IPN endpoint URL. GUID
error Integer
status String Response code.

Sample Response
    {
        "url": "https://www.myapplication.com/ipn",
        "created_date": "2022-03-03T17:29:03.7208266Z",
        "ipn_id": "e32182ca-0983-4fa0-91bc-c3bb813ba750",
        "error": null,
        "status": "200"
      }  

You can also use our online forms below to register your IPN URLs.

Is this article helpful?