Skip to main content

Documentation Index

Fetch the complete documentation index at: https://moflay.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Moflay dashboard for M-Pesa payments

What is Moflay?

Moflay is a developer infrastructure layer for M-Pesa payments. Daraja gives access to M-Pesa. Moflay gives developers the production layer around that access: a clean API, SDK, signed webhooks, transaction records, logs, dashboard visibility, and managed credentials for your own till or paybill.

Built around Daraja

Moflay uses Daraja as the M-Pesa access layer and adds the developer workflow your app needs around it.

Made for production apps

Move beyond a working STK Push demo with webhooks, payment states, reconciliation records, environments, and dashboard tools.

Problems Moflay solves

The problem: A direct M-Pesa integration usually needs Daraja credentials, token handling, environment setup, callbacks, and payment state management before your app can safely accept payments.Moflay’s solution: Save your credentials in Moflay, create an API key, and call one payment API while Moflay handles the Daraja workflow around the request.
The problem: Safaricom callbacks are part of the payment flow, but your product still needs clean events, retries, signature verification, and idempotent handling.Moflay’s solution: Moflay receives the Safaricom callback, updates the payment state, and sends signed webhooks such as payment.completed and payment.failed to your backend.
The problem: Your app needs to know whether a payment is pending, completed, failed, or still waiting for a final result.Moflay’s solution: Moflay stores payment and transaction records that are easier to reconcile from the dashboard, API, or webhook events.
The problem: When a payment fails, developers need enough context to understand what happened without digging through scattered logs.Moflay’s solution: Use the dashboard to inspect customers, transactions, API keys, credentials, environments, and webhook behavior in one place.

Core features

M-Pesa Express payments

STK Push API

Create M-Pesa Express payment requests from your backend.

Node.js SDK

Use @moflay/sdk for a faster TypeScript and Node.js integration.

Raw HTTP

Call the REST API directly from any language or backend framework.

Environments and credentials

Sandbox

Test payments safely before you move to production.

Production

Use live Daraja credentials when you are ready to process real payments.

Managed credentials

Store Daraja credentials by business and environment.

Webhooks and records

Signed webhooks

Receive payment and customer events in your backend.

Transactions

Read transaction records for reporting and reconciliation.

Customers

Create, list, update, and delete customer records.

How Moflay works

1

Your app creates a payment

Your backend calls Moflay with the phone number, amount, description, and optional customer details.
2

Moflay talks to Daraja

Moflay uses the Daraja credentials saved for the selected environment to send the M-Pesa Express request.
3

The customer approves the prompt

The customer confirms the payment from the M-Pesa prompt on their phone.
4

Moflay records the result

Safaricom sends the callback to Moflay. Moflay updates the payment and transaction state.
5

Your backend receives an event

Moflay sends a signed webhook to your backend so your app can update its own order, invoice, wallet, or access state.

Integration options

Use the Node.js SDK when you want the fastest path in a TypeScript or JavaScript backend.
npm install @moflay/sdk
Start with Make your first payment.

Quick start

1

Create your account

Create a Moflay account and organization from the Moflay dashboard.
2

Create an API key

Generate a sandbox API key with the permissions your backend needs.Learn more in Create an API key.
3

Send a sandbox payment

Use the SDK or raw HTTP API to send your first M-Pesa Express payment.Start with Make your first payment.
4

Set up webhooks

Configure a webhook endpoint so your backend can receive signed payment events.Read the Webhook overview.
5

Prepare for production

Add and verify your live Daraja credentials, then complete the go-live checklist.Use the Go-live checklist.

Why choose Moflay?

Cleaner integration

Use one API or SDK instead of building every Daraja workflow directly inside your app.

Less payment plumbing

Let Moflay handle credentials, callbacks, webhook delivery, and transaction records around the payment flow.

Pricing model

Pay per successful transaction

Moflay charges when payments succeed, so costs follow usage.

No setup or monthly platform fee

Start building without a fixed monthly software fee.
Contact Moflay if you need custom pricing for high-volume or enterprise use cases.

Ready to start?

Create account

Create your Moflay account and organization.

Make your first payment

Send a sandbox M-Pesa Express payment with the SDK.

Read how Moflay works

Understand how Moflay fits between your app, Daraja, and M-Pesa.

Explore the API

Review authentication, endpoints, errors, rate limits, and pagination.