The Moflay API uses API keys to authenticate public API requests. Send the key as a Bearer token in theDocumentation Index
Fetch the complete documentation index at: https://docs.moflay.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header.
API key prefixes
| Prefix | Environment |
|---|---|
mof_test_ | Sandbox |
mof_live_ | Production |
Create and store keys
Create keys in the API Keys dashboard. Copy the raw key when it is created and store it in your secret manager or deployment environment variables.Permissions
Each key has a permission set. Current public API permissions include:| Permission | Allows |
|---|---|
express.pay | Create M-Pesa Express payment requests |
customers.read | Read customer records |
customers.write | Create, update, or delete customer records |
transactions.read | Read transactions and payment status |
Authentication errors
Missing API key
If you do not include theAuthorization header, the API returns 401 Unauthorized.
Invalid API key
If the key is incorrect, malformed, or not found, the API returns403 Forbidden.
Insufficient permissions
If the key does not have the permission required by an endpoint, the API returns422 Unprocessable Entity.