Skip to main content
KulmiPay provides a browser checkout SDK for web apps that need a hosted checkout popup or inline checkout frame, and a PHP SDK for backend collection, payout, wallet, and refund workflows.
The npm kulmipay package is a browser checkout SDK. Do not use it as a secret-key backend SDK. For PHP backends, use the Composer package kulmipay/kulmipay-php.

Browser checkout SDK

The browser package is published on npm as kulmipay.

Install

Browser checkout button

Add a button with the kulmiPayButton class. The SDK reads the button’s data-* attributes and creates a checkout session when the customer clicks it.

React or bundled JavaScript

When installing from npm, import or require the package from your browser bundle.

Inline checkout

Use mode: "inline" when you want the checkout frame rendered inside a page element.

Environments

Self-hosted and local testing

Pass explicit base URLs when testing a local or self-hosted backend.
apiBaseURL resolves to /api/v1/checkout/. If you need full control, pass checkoutAPIURL with the complete endpoint URL.

Browser SDK options

PHP SDK

Use the PHP SDK in backend applications that need to create checkout sessions, start M-Pesa STK pushes, collect PesaLink payments, send money, manage wallets, or create and retrieve refunds.

Install

Configure

For sandbox, use sandbox keys and set sandbox to true:
For self-hosted deployments, pass the full API base URL:

Checkout

M-Pesa STK Push

Send Money

Supported payout helpers:

Wallets

Refunds

Next steps

Checkout

Create a checkout session and render hosted payment UI.

Send Money

Send funds to M-Pesa, PesaLink bank accounts, and KulmiPay wallets.