Production credentials link your live Safaricom Daraja app to Moflay so STK Push requests use your real till or paybill.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 organization with access to the production environment
- A valid till or paybill from your M-Pesa business onboarding (live shortcode)
- Access to the Safaricom Daraja developer portal
Part A: Obtain values from Safaricom
Safaricom’s portal labels and steps change over time. Use developer.safaricom.co.ke and the official API documentation inside the portal as the source of truth—not third-party tutorials. At a high level, you will:- Register or sign in to the Daraja developer portal (often a company account for production use).
- Create or open an app tied to your integration and enable the Lipa na M-Pesa Online / STK Push (or equivalent) product for that app.
- Complete any go-live or production onboarding steps the portal requires for live traffic.
- Collect the following for your live app (names may appear slightly differently in the portal):
| Value | Purpose |
|---|---|
| Consumer key | OAuth2 client id for Daraja |
| Consumer secret | OAuth2 client secret; with the key, used to obtain a bearer access token |
| Business shortcode | Your live till or paybill number used in API requests |
| Passkey | Used with the shortcode (and timestamp) to build the STK password field |
| Shortcode type | Whether the shortcode is a till or paybill (or the type Moflay expects in the dashboard) |
Part B: Add credentials to Moflay
Open the production environment
Go to Credentials in the Moflay dashboard and switch from sandbox to production.
Enter the live Daraja values
Paste your consumer key, consumer secret, shortcode, and passkey. Choose the correct short code type (for example till or paybill).
Save the configuration
Save so Moflay encrypts and stores the credentials for your business in production.
Why Moflay does not ask for a Callback URL here
Moflay sets Safaricom’s STKCallBackURL automatically when initiating each payment. Your server should listen for Moflay webhooks, not raw Daraja callbacks. See Daraja callbacks.
Important behavior
- Moflay exchanges OAuth tokens with Daraja using the stored key and secret—you do not implement token requests yourself.
- Your backend should consume Moflay webhooks for lifecycle events (for example
payment.completed). See Webhook events.
Verify the result
Your production setup is complete when:- Credentials save successfully in the production environment
- Credentials show as active and valid in the dashboard
- A
mof_live_API key authenticates successfully - A controlled live payment test completes end to end
Troubleshooting
- Payment request fails immediately: Recheck consumer key, consumer secret, shortcode, passkey, and shortcode type. See Credential security if you suspect leakage or rotation issues.
- Sandbox works but production does not: Confirm you switched both the credentials page and your API key to production.
- Your backend never sees final status: Configure Moflay webhooks and verify signature verification. See Daraja callbacks for how status is determined.