API keys authenticate your requests to the Moflay API. Create separate keys for each environment and grant only the permissions your integration needs.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.
Prerequisites
- A Moflay account and organization
- Access to the Moflay dashboard
Create an API key
Open the API Keys page
Go to API Keys in the dashboard.
Create the key
Give the key a clear name such as
checkout-service-sandbox, then assign only the permissions your service needs.Environment-specific prefixes
mof_test_: Sandbox API keysmof_live_: Production API keys
Available permissions
The current API permission set includes:| 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 |
express.pay to create the payment and
transactions.read to check the payment status.
Use the key in your app
Use the key with raw HTTP
Verify the result
Your API key is working if you can call an endpoint successfully in the same environment where the key was created.Troubleshooting
missing_api_key: Add theAuthorization: Bearer YOUR_API_KEYheader.invalid_api_key: Check that the key is valid and copied correctly.invalid_access: The key exists, but it does not have the permission required by that endpoint