Skip to main content

Pesapal Adaptor

About Pesapal​

Pesapal is a leading payment gateway service provider in East Africa, enabling businesses to accept payments from customers using various payment methods including mobile money, cards, and bank transfers. Pesapal supports payments in multiple currencies and provides secure, PCI/DSS compliant payment processing for e-commerce platforms, mobile applications, and other digital services.

Integration Options​

Pesapal supports integration through its REST API, which enables external services like OpenFn to:

  1. REST API: Submit payment orders, query transaction status, and manage payment workflows. This option is suited for e-commerce integrations, automated billing systems, or workflows that need to process payments and track their status. See functions for more on how to use this adaptor to work with the API.

  2. IPN (Instant Payment Notification): Receive real-time notifications when payment status changes. This option is suited for event-based workflows that need immediate updates on payment completion or failure.

API Versions​

Pesapal offers multiple API versions:

  • API 3.0 (JSON): The current version using JSON REST APIs with Bearer token authentication
  • API 2.0 (XML): Legacy version using XML and OAuth 1.0 authentication (deprecated)

This adaptor supports both versions, with API 3.0 being recommended for new integrations.

Authentication​

API 3.0 Authentication​

When integrating with Pesapal API 3.0 via OpenFn, the authentication method uses Consumer Key and Consumer Secret to generate a Bearer token:

{
"baseUrl": "https://pay.pesapal.com/v3",
"consumer_key": "your-consumer-key",
"consumer_secret": "your-consumer-secret"
}

For testing/sandbox environment:

{
"baseUrl": "https://cybqa.pesapal.com/pesapalv3",
"consumer_key": "your-sandbox-consumer-key",
"consumer_secret": "your-sandbox-consumer-secret"
}

API 2.0 Authentication (Legacy)​

For legacy integrations using API 2.0:

{
"baseUrl": "https://www.pesapal.com",
"consumer_key": "your-consumer-key",
"consumer_secret": "your-consumer-secret"
}

See this adaptor's Configuration docs for more on required authentication parameters.

See platform docs on managing credentials for how to configure a credential in OpenFn.

  1. Pesapal API 3.0 Documentation
  2. Pesapal Postman Collection
  3. Test Credentials
  4. Merchant Registration

Implementation Examples​

Coming soon!

Report or fix a problem with this adaptor

OpenFn adaptors are open source and we welcome contributions. See the Adaptors Wiki to learn how to update an adaptor, or ask on the OpenFn Community Forum.