How to Set Up a B2C Operator in the Safaricom M-PESA G2 Portal
If you are working with the Daraja B2C (Business to Customer) API, you've probably realized that having a working Paybill is only half the battle. To actually send money out (Disbursements), you need an "Initiator"—a specific digital identity authorized to move funds.
If you’re seeing errors like "Invalid Access Token" or "Initiator Information," here is the exact process to fix it in the M-PESA G2 Portal.
Access the G2 Portal
First, log into the M-PESA G2 Portal (org.ke.m-pesa.com). You must use your Organization Admin credentials. This is usually the primary account Safaricom sent you when your Paybill or Till was first created.Create the Operator (The "Initiator")
Go to User Management and select Create Operator.Username: Choose something distinct (like Devmaster2). This username is what you will put in your code as the InitiatorName.
The Secret Sauce (Role): This is where most people fail. You must assign the role of Business Manager or Business Contributor.
Why? Business Manager is best because it allows the API to both "Initiate" and "View" transaction status.
Set and Encrypt the Password
Once the operator is created, log in as that new user to set a permanent password.
Note: You don't put this plain password in your code. You must encrypt it using Safaricom’s Public Key Certificate to create your Security Credential.The Shortcut
Setting up these handshakes manually is time-consuming and prone to hardcoded errors. If you want to skip the manual encryption and complex Daraja authentication logic, you can use a unified gateway.
OptimaPay Bridge handles the token generation and security credentials automatically, allowing you to focus on your business while we handle the "pipes."
Check it out here: https://optimapaybridge.co.ke/
United States
NORTH AMERICA
Related News
What Does "Building in Public" Actually Mean in 2026?
19h ago
The Agentic Headless Backend: What Vibe Coders Still Need After the UI Is Done
19h ago
Why I’m Still Learning to Code Even With AI
21h ago
I gave Claude a persistent memory for $0/month using Cloudflare
1d ago
NYT: 'Meta's Embrace of AI Is Making Its Employees Miserable'
1d ago