• Latest
  • All
  • How To

The Updated M-PESA Daraja API Integration Guide

December 17, 2024
My OneApp

Safaricom Makes My OneApp Data-Free With Latest Update

June 22, 2026
Safaricom

Safaricom Nears 60 Million Subscribers as Kenya Hits 84.1 Million Mobile Lines

June 22, 2026
FIFA World Cup 2026

Trionda Ball and Referee Cams Deliver First Major Tech Moments at World Cup 2026

June 19, 2026
Couple Joy: A Long-Distance Dating App That Builds Intimacy in Small Daily Acts

Couple Joy: A Long-Distance Dating App That Builds Intimacy in Small Daily Acts

June 19, 2026
DHgate Tablet Cases deals
KRA Extends Working Hours for Tax Return Filing as Deadline Nears

KRA Extends Working Hours for Tax Return Filing as Deadline Nears

June 18, 2026
viewers Desert DSTV, GOtv, StarTimes as Kenyan Pay TV Market Loses 73.2% of Subscribers

Kenyans’ Exodus From DSTV Continues, as Pay TV Sector Loses Over 85K Subscribers

June 19, 2026
Anthropic Claude

Claude Users Face Service Disruptions as Anthropic Suspends Fable 5

June 18, 2026
How mobile money agents grew into kenya's financial spine but the bank doesnt die

M-Pesa, Airtel Money Hit Over 600K Mobile Money Agents in Kenya

June 18, 2026
Kenya Internet Bandwidth Jumps to 28,130 Gbps: SEACOM Leads with 53% Quarter Growth

SEACOM 53.3% Bandwidth Growth Pushes Kenya’s Total Internet Capacity to 28,130 Gbps

June 18, 2026
The AI Gold Rush Goes Public

The AI Gold Rush Goes Public

June 17, 2026
NTSA Pilots Smart Driving License Enrollment at Huduma Center in Kimilili

NTSA Pilots Smart Driving License Enrollment at Huduma Center in Kimilili

June 17, 2026
bZ4X

Toyota Enters Kenya’s EV Market With New bZ4X Electric Crossover

June 17, 2026
Techweez | Tech News, Reviews, Deals, Tips and How To
  • News
  • Entertainment
  • Reviews
  • Features
  • Editorial
No Result
View All Result
Techweez | Tech News, Reviews, Deals, Tips and How To
  • News
  • Entertainment
  • Reviews
  • Features
  • Editorial
No Result
View All Result
Techweez | Tech News, Reviews, Deals, Tips and How To
No Result
View All Result

The Updated M-PESA Daraja API Integration Guide

Shadrack Matata by Shadrack Matata
December 17, 2024
in How To, News
Reading Time: 6 mins read
488
0

It is indisputable that M-Pesa is currently the most widely accepted and used mode of payment in Kenya. The service allows its users to store and transfer money through their mobile phones. Launched by Kenya’s largest mobile operator, Safaricom’s M-PESA has gained many subscribers since its inception in 2007. This Safaricom subsidiary is currently the 4th most valuable brand($245.6m) in Kenya according to a recent report by Brand Finance.

In Kenya alone, M-Pesa has over 30 million active users on monthly basis. Across the region, Safaricom’s mobile banking has at least 20 million other customers spread in markets across Tanzania, the Democratic Republic of Congo (DRC), Mozambique, Lesotho, Ghana, and Egypt. This exponential growth can be attributed to its new financial service innovations such as M-Shwari, KCB M-Pesa, Fuliza, and M-pesa global pay among others.

M-PESA products

Lipa Na Mpesa is arguably the most popular M-pesa product. It allows businesses and individuals to collect payments from their clients. With the volume of mobile money transactions surging to 175.8 million in June 2021, virtually every business needs to acquire an LNM Paybill/Till. Depending on the company’s need case, they can either acquire a Paybill or Till number. They almost function in a similar way only that the former allows users to enter the account number they are paying for.

To register a Paybill number, you need to visit a Safaricom shop with company registration documents like a certificate of incorporation, KRA PIN, and a Cancelled bank cheque confirming the company’s bank account details. However, it’s quite simple to acquire M-PESA Till number through the self-onboarding portal. It takes 24-48 working hours to process the request.

M-pesa paybill plate

M-pesa API (Daraja) Integration

With the rapid adoption of technology in Kenya, the payment needs go beyond acquiring an M-Pesa paybill or till number. Some business models require M-Pesa integration with their ERP systems, websites, or mobile apps. For instance, banks use M-Pesa paybills to enable their customers to deposit money from M-pesa to their bank accounts.

.

Popularly known as Daraja, M-PESA API offers many endpoints to facilitate seamless and secure payment integrations. They include C2B API, B2C API, and B2B API. Other endpoints include Transaction status and Balance API. Below is a step-by-step guide on how to integrate C2B M-Pesa shortcode with ERP, a website, or even a mobile app.

Step 1: Acquiring M-Pesa Till/Paybill Number

This is the first step. If you already have one, you can skip to the next step. To get a paybill or till number, assemble your KYC documents and visit the Safaricom shop or the self-onboarding portal.

Step 2: Get Head Office Number

Implementation of C2B requires a shortcode known as the head office number. For a paybill, the paybill number acts as the head office number. However, this does not apply to Till numbers.

A till can have two or three different shortcodes depending on how and where it settles funds. If a till settles funds to a bank account, it comes with two shortcodes namely: Till number and store number. In this case, the store number acts as the head office number.

In the unfortunate event that the Till settles funds to the Owner’s nominated M-pesa number, the till requires an upgrade to be eligible for integration. An upgrade simply means changing funds settlement from an M-Pesa number to a bank account. To upgrade, send a request to [email protected] or [email protected]. You must attach a canceled bank cheque or bank letter confirming bank account details. After a successful upgrade, the till gets a head office number, different from till and store numbers. This results in such a till having three different shortcodes.

NB: Getting the head office number for shortcodes(especially a till) acquired through a third party like banks and other middlemen is usually chaotic. It is advisable to apply the till/paybill number directly from Safaricom if you wish to use it for payment integrations.

Step 3: Creation in M-Pesa G2 portal

Once you have the head office number you are set to go. You are supposed to create a business administrator username that will later be used to go live in the Daraja portal. Fill administrator creation form available on-demand from the Safaricom M-Pesa business team. This form has to be duly filled, stamped, and signed by two directors. If you are a sole proprietor, you need to indicate the same. In that form, fill the head office number as the shortcode.

You need to attach documents like an admin national ID(both sides) and a letter from the company’s board. The Board’s resolution letter should clearly show that someone has been nominated to be their m-pesa business admin. Send a creation request to [email protected] or [email protected].

Tracking the admin creation request

You will immediately receive a tracking number for your request. In case of delay, you can contact M-Pesa Business support by email at [email protected] or call 2222 on your Safaricom line. Unfortunately, one has to be whitelisted first in order to be able to call the 2222 extension. They only whitelist M-Pesa nominated numbers.

Step 4: Creating Assistant roles

After getting G2 portal credentials, you need to log in here, change your password and create an assistant role user whose credentials will be used to go live in the Daraja portal.

M-pesa G2 portal login page

If you are not familiar with assistant roles, you can select default roles for a business manager. The account is always in pending active status until the assistant role user logs in. For a till you will need to create a child of the store number because the head office number does not receive callbacks.

Step 5: Create a Developer account on the Daraja portal

This is the second last step. Sign up on daraja portal . Click go live and select verification by shortcode. Enter the assistant user username, select desired API products, and go live. You will receive production URLs in your developer’s email address immediately.

After approval, a passkey is sent(to the developer’s email address) which is used to initiate payment requests automatically from the backend via STK PUSH.

Daraja portal screenshot

Step 6: Register callback URLs and code your logic

This is the final step. You can register callback URLs and code the logic for processing payment notifications in the language of your choice.

SendShare289Tweet181
Shadrack Matata

Shadrack Matata

Shadrack Matata is a Kenyan electrical engineer and senior software developer. He has vast knowledge in backend technologies, machine learning, artificial intelligence, Internet of Things, and cyber security.

Related Posts

My OneApp

Safaricom Makes My OneApp Data-Free With Latest Update

June 22, 2026
Safaricom

Safaricom Nears 60 Million Subscribers as Kenya Hits 84.1 Million Mobile Lines

June 22, 2026
FIFA World Cup 2026

Trionda Ball and Referee Cams Deliver First Major Tech Moments at World Cup 2026

June 19, 2026
Couple Joy: A Long-Distance Dating App That Builds Intimacy in Small Daily Acts

Couple Joy: A Long-Distance Dating App That Builds Intimacy in Small Daily Acts

June 19, 2026
KRA Extends Working Hours for Tax Return Filing as Deadline Nears

KRA Extends Working Hours for Tax Return Filing as Deadline Nears

June 18, 2026
viewers Desert DSTV, GOtv, StarTimes as Kenyan Pay TV Market Loses 73.2% of Subscribers

Kenyans’ Exodus From DSTV Continues, as Pay TV Sector Loses Over 85K Subscribers

June 19, 2026

Latest

My OneApp

Safaricom Makes My OneApp Data-Free With Latest Update

June 22, 2026
Safaricom

Safaricom Nears 60 Million Subscribers as Kenya Hits 84.1 Million Mobile Lines

June 22, 2026
FIFA World Cup 2026

Trionda Ball and Referee Cams Deliver First Major Tech Moments at World Cup 2026

June 19, 2026
Couple Joy: A Long-Distance Dating App That Builds Intimacy in Small Daily Acts

Couple Joy: A Long-Distance Dating App That Builds Intimacy in Small Daily Acts

June 19, 2026
KRA Extends Working Hours for Tax Return Filing as Deadline Nears

KRA Extends Working Hours for Tax Return Filing as Deadline Nears

June 18, 2026
viewers Desert DSTV, GOtv, StarTimes as Kenyan Pay TV Market Loses 73.2% of Subscribers

Kenyans’ Exodus From DSTV Continues, as Pay TV Sector Loses Over 85K Subscribers

June 19, 2026

Best devices

Best Infinix Phones of 2025

Best Infinix Phones of 2025: Budget Prices With Premium Features

December 31, 2025

The Best Infinix Accessories Worth Buying in 2025

November 26, 2025

Best Budget Wireless Earbuds To Buy in Kenya (2025)

October 8, 2025

Samsung Galaxy A36 5G vs Samsung Galaxy A56 5G: Comparison Review

August 29, 2025

Infinix Hot 60 Pro+ vs Infinix Hot 60i: Comparison Review

August 22, 2025

Best Budget Smartwatches To Buy in Kenya 2025

February 13, 2025

Techweez is where tomorrow’s tech stories break today, thanks to intelligent analysis, real-world insight, and visionary storytelling.

Follow Us

Editorials

Couple Joy: A Long-Distance Dating App That Builds Intimacy in Small Daily Acts

Airbuds: The App That Turns Your Music Into a Social Feed

Kenya Might Need to Crack Down on Wealth Porn Like China

Techweez and Gearhaus Score BAKE Awards 2026 Nominations

Death by AI: Opportunities That Were Disrupted by Automation

CBK Approved 200+ Digital Lenders, But That’s Not the Real Story

More News

Claude Users Face Service Disruptions as Anthropic Suspends Fable 5

M-Pesa, Airtel Money Hit Over 600K Mobile Money Agents in Kenya

SEACOM 53.3% Bandwidth Growth Pushes Kenya’s Total Internet Capacity to 28,130 Gbps

The AI Gold Rush Goes Public

NTSA Pilots Smart Driving License Enrollment at Huduma Center in Kimilili

Toyota Enters Kenya’s EV Market With New bZ4X Electric Crossover

  • Terms Of Use
  • Techweez Brand
  • Privacy & Policy
  • Contact Us

© 2024 Techweez - Palahala Media Group may earn a commission when you buy through links on our sites.
A Palahala Media Group Brand. All rights reserved.
.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In

Add New Playlist

Techweez | Tech News, Reviews, Deals, Tips and How To
Crunchy Cookies 🍪 Ahead!

Hey there! Just a heads-up: we're big fans of cookies - both the digital and edible kind! 🍪 We use our cookies and some from third parties to ensure your browsing experience on our site is smooth sailing and secure.

 

But wait, there's more! We also use cookies to gather stats and insights on how you navigate our site. It's like getting a behind-the-scenes peek at your digital adventures!

 

Don't worry, you're in control. You can adjust your cookie settings anytime to suit your preferences. Feeling curious? Dive into our Privacy Policy for all the juicy details. Happy browsing! 🚀

Functional Always active
Listen, this legal stuff is about as exciting as watching paint dry. But it basically says we only use your stuff for what you asked us to do, and nobody else gets to peek!
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
It's those sneaky cookie crumbs websites leave behind to count visitors, like counting ants at a picnic! Totally harmless, just for fun facts. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
Hey there! Just letting you know we use some fancy gizmos to remember your preferences. This way, we can show you ads that are, well, not completely bananas.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Make cookies
{title} {title} {title}
Techweez | Tech News, Reviews, Deals, Tips and How To
Crunchy Cookies 🍪 Ahead!
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
Listen, this legal stuff is about as exciting as watching paint dry. But it basically says we only use your stuff for what you asked us to do, and nobody else gets to peek!
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
It's those sneaky cookie crumbs websites leave behind to count visitors, like counting ants at a picnic! Totally harmless, just for fun facts. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
Hey there! Just letting you know we use some fancy gizmos to remember your preferences. This way, we can show you ads that are, well, not completely bananas.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Make cookies
{title} {title} {title}
No Result
View All Result
  • News
  • Reviews
  • Features
  • Editorial
  • Automotive
  • Entertainment

© 2024 Techweez - Palahala Media Group may earn a commission when you buy through links on our sites.
A Palahala Media Group Brand. All rights reserved.
.