Pesapal.com

WIRELESS CONNECTIVITY

Achieving seamless integration with your Point of Sale (POS) is possible through wireless transmission of payment details to your designated endpoint.

The initiation of this request will originate from the POS devices, and upon a successful transaction, the relevant information will be transmitted to your specified endpoint, allowing you to efficiently settle the bill on your end.

This guide covers both endpoints you need to implement: one to receive transaction notifications from Pesapal and one to verify a transaction before settling it in your system.

To facilitate the reception of payments within their external systems, merchants are required to provide Pesapal with a secure URL using SSL encryption. Pesapal will then initiate an HTTP POST request to the merchant system, sending the transaction details with the specified parameters.

Implementation overview:

1. Transaction Notification Endpoint

Pesapal sends completed transaction details to the merchant endpoint.

2. Transaction Verification Endpoint

Merchant verifies the transaction status using the confirmation_code received from the notification payload.

ENDPOINT 1: Transaction Notification-Post Request

After a customer completes a payment on a Pesapal terminal, Pesapal sends an HTTP POST request to your SSL-secured endpoint containing the transaction details. You must provide Pesapal with your endpoint URL in advance.

For security purposes, Pesapal will include authentication credentials in the request headers when sending transaction notifications to the merchant endpoint. Merchants should validate these credentials before processing the received transaction information.

Header Data Type Description
Consumerkey String Merchant application username.
Consumersecret String Merchant application password.
Request parameters
Parameter Data Type Description Example
first_name String Represents the first name of the customer John
last_name String Represents the last name of the customer Doe
phone String Represents the phone number of the customer if provided 0712345678
amount Decimal Represents the amount paid by the customer 1.00
payment_option String Represents the payment option used by the customer e.g. Visa, MasterCard, Mpesa Visa
transaction_date datetime Represents the date and time when the transaction was completed 2019-08-14T14:41:21.4612553Z
currency String Represents the currency used during the transaction KES, USD
merchant_reference String Represents the merchant reference if it was provided by the merchant 1234
id int Represents the Pesapal unique transaction ID 12
confirmation_code String Represents the payment confirmation code received for M-Pesa or card payments QWE1234
Sample Request
{
  "id":10463,
  "first_name":"joe",
  "last_name":"doe",
  "phone":"+254712345678",
  "amount":1.0,
  "payment_option":"Visa",
  "transaction_date":"2022-02-04T14:19:05.0210431Z",
  "currency":"KES",
  "merchant_reference":"TEST",
  "confirmation_code":"test10"
}

Once you have received and processed the notification, respond to Pesapal with an HTTP 200:

Expected Json Response
{
  "status":"200",
  "message":"Ok"
}

ENDPOINT 2: Transaction Verification-Post Request

After receiving a notification (Endpoint 1), call this Pesapal-hosted endpoint to independently confirm the transaction status before completing any order, service activation, or settlement. The verification response is the final source of truth.

Endpoint:{{baseUrl}}/api/transactions/verifytransaction.

An API key and IP whitelisting are required. Share your server's IP address with Pesapal to receive your key before going live.

Authentication:

Include your API key on every request to this endpoint using the APIKey header as shown below:

Header APIKey
APIKey Your API key xxx
Request Body Parameter
Parameter Type Description
confirmation_code String The confirmation_code received in the Endpoint 1 notification payload (e.g. QWE1234).

Sample Request
{
    "confirmation_code": "QWE1234"
}
Sample Response
{
    "amount": 1.00,
    "posting_status": 0,
    "transaction_date": "2026-06-17T07:19:53.767",
    "status": 1,
    "status_description": "completed",
    "currency": "KES",
    "merchant_ref": "test",
    "payment_option": "MasterCard",
    "confirmation_code": "QWE1234",
    "posting_status_description": "Success"
}
NB: For a tailored solution corresponding to the above payload, please reach out to [email protected]. Our dedicated team is ready to provide assistance and support.
Is this article helpful?