Skip to main content

Documentation Index

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

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

The Moflay API gives your backend direct access to M-Pesa payment, customer, and transaction workflows over HTTPS.

Base URL

https://api.moflay.com/v1

Authentication

Send your API key in the Authorization header:
Authorization: Bearer mof_test_your_api_key
Use a sandbox key for sandbox data and a production key for live data. The API key determines the business, environment, and permissions for the request.

Core API areas

AreaPurpose
Express paymentsCreate M-Pesa Express STK push payment requests with POST /v1/express
PaymentsRead the current status of a payment attempt with GET /v1/payments/{id}
CustomersCreate, update, list, and delete customer records
TransactionsList transactions and fetch individual transaction records
WebhooksReceive signed payment and customer events in your backend

Payment status flow

  1. Call POST /v1/express.
  2. Store the returned paymentId and transactionId.
  3. Use GET /v1/payments/{id} for status checks (this reads Moflay’s stored state; see Transaction statuses).
  4. Use Moflay webhooks for production-grade asynchronous status updates.

Amounts

Send payment amounts as integer minor currency units. For example, amount: 1000 means KES 10.00.

Supporting behavior

  • Cursor-based pagination for list endpoints
  • Environment-specific API keys
  • Permission-based access control
  • Standardized JSON error responses
  • Rate limit headers on public API responses