The biggest part of your M-Pesa API integration cost is not a Safaricom API fee. Safaricom’s Daraja documentation, as of November 2026, lists no charge for opening a developer account, testing in the sandbox or going live. What you pay Safaricom is the normal M-Pesa tariff on your Paybill, Till or B2C account, transaction by transaction. What you pay a developer is the build, and that depends entirely on scope.
M-Pesa integration means connecting your website, app, POS or accounting system directly to M-Pesa, so payments are requested, confirmed and recorded by software instead of by someone reading SMS messages. Safaricom does this through Daraja, its developer portal, which it describes as “a web platform that offers access to Safaricom and M-PESA APIs”. Daraja is the M-Pesa API.
Key Takeaways
- Daraja itself has no listed fee. Your recurring cost is the M-Pesa tariff on your Paybill, Till or B2C account, so pick the account type before the developer writes a line of code.
- On a Business Till, Safaricom charges the business up to 0.55% per collection, capped at KSh 200. Since August 2026, collections of KSh 500 and below are free (up from KSh 200).
- On a Paybill you choose who pays: the customer, the business, or a split (“Mgao”). Payments of KSh 100 and below carry no charge on any of the three.
- You cannot go live without a live shortcode and an M-Pesa Org portal user with the Business Administrator or Business Manager role. Sort this with Safaricom first; it is usually the slowest step.
- Build for callbacks that never arrive. Daraja discards results if your server is down, so plan to use the Transaction Status or Pull Transactions API from day one.
What is M-Pesa integration and what does the Daraja API do?
Without integration, someone matches each M-Pesa SMS to an order by hand. With integration, your system pushes a payment prompt to the customer’s phone, receives a notification when money lands, and records it against the right invoice.
Safaricom’s Getting Started guide explains that the APIs are RESTful, use JSON, and are asynchronous: you send a request, Safaricom acknowledges it, and the actual result arrives later at a callback URL on your server.
You build in the sandbox, with test shortcodes and no real money, then move to production at go-live.
Which M-Pesa APIs are available on Daraja?
The Daraja API catalogue lists well over 20 APIs as of November 2026. Most businesses only ever need four or five. These are the ones that matter for collecting and paying money, with Safaricom’s own description of each.
| API | What Safaricom says it does | What it means for you |
|---|---|---|
| Authorization | Generates an access token used when calling the other APIs | Every call starts here. Tokens expire hourly, so your code must refresh them. |
| M-Pesa Express (STK Push) | Lets a business initiate a Paybill or Buy Goods payment from the customer’s account | The customer only enters their PIN. Fewer wrong amounts and wrong account numbers. Best for online checkout. |
| M-Pesa Express Query | Checks the status of an M-Pesa Express payment | Your fallback when the STK Push callback is late or missing. |
| Customer to Business (C2B) | Sends real-time notifications for payments made to your Paybill or Till | Captures payments customers make themselves through the M-Pesa app, USSD or SIM toolkit. |
| Business to Customer (B2C) | Sends money from a business to an M-Pesa customer | Refunds, payouts, commissions, casual wages. Needs a B2C or “one account” shortcode. |
| Transaction Status | Checks the status of a transaction; Safaricom calls it “a secondary reconciliation mechanism when Callbacks are not received” | Your safety net for reconciliation. |
| Pull Transactions | Retrieves a list of C2B transactions for a recent period | Lets you recover payments your server missed. |
| Reversal | Reverses a recent C2B transaction | Useful for wrong payments, but restrict who can trigger it. |
The catalogue also lists Account Balance, Dynamic QR, Tax Remittance to KRA, Bill Manager and M-Pesa Ratiba for standing orders, among others. Add them only when a real process needs them.
How much does M-Pesa API integration cost in Kenya?
There are three separate costs.
- Daraja access. Safaricom’s documentation lists no fee for creating a Daraja account, building sandbox apps or going live.
- M-Pesa transaction tariffs. These are the same charges any business pays on its Paybill, Till or B2C account, whether payments arrive by API or not.
- The build and its upkeep. A developer’s or agency’s fee, plus hosting for the server that receives callbacks. This varies widely with scope, so it is agreed per project. Nobody can quote it honestly before knowing what you need.
What does a Till (Buy Goods) cost the business?
Safaricom’s M-Pesa Business Till page states that the business owner is charged “a maximum of 0.55% and not more than KSh. 200 per transaction” on money collected, and that customers pay nothing except at fuel stations. The page still says “collections of KSh. 200 and below are FREE”, but in August 2026 Safaricom doubled the free threshold to KSh 500, with collections above KSh 500 still charged 0.55%, capped at KSh 200 (The Standard, 2 August 2026). Tariffs change, so confirm with Safaricom on the day you decide.
Do the sum for your business. Take your average payment and your monthly number of payments.
- Average payment KSh 2,000: 2,000 × 0.0055 = KSh 11 per payment, at most.
- 300 payments a month: 300 × 11 = KSh 3,300 a month, at most.
- The KSh 200 cap kicks in at 200 ÷ 0.0055 = about KSh 36,364. Above that, every payment costs the same KSh 200.
What does a Paybill cost the business?
A Paybill gives you a choice of who pays. Safaricom’s Paybill Standard Tariff, linked from its Paybill page, offers three options: the Business Bouquet (the customer bears all charges), the Customer Bouquet (the business bears all charges) and the Mgao tariff (charges are split). You sign the tariff you choose as part of the application.
| Payment amount (KSh) | Customer Bouquet: business pays | Mgao: business pays / customer pays | What it means for you |
|---|---|---|---|
| 1 to 100 | 0 | 0 / 0 | Small payments are free on every option. |
| 101 to 500 | 5 | 0 / 5 | Mgao costs you nothing here; the customer pays the KSh 5. |
| 1,501 to 2,500 | 15 | 5 / 10 | Mgao cuts your share by two-thirds. |
| 7,501 to 10,000 | 42 | 25 / 17 | The split shifts towards the business as amounts grow. |
| 45,001 to 250,000 | 108 | 84 / 24 | KSh 108 is the highest charge on the table. |
Do the sum for your business. Say most of your payments are KSh 2,000 and you receive 300 a month.
- Customer Bouquet: 300 × 15 = KSh 4,500 a month paid by you.
- Mgao: 300 × 5 = KSh 1,500 paid by you, and 300 × 10 = KSh 3,000 paid by your customers.
- Business Bouquet: KSh 0 paid by you, KSh 4,500 paid by your customers.
My view: for consumer-facing businesses, charging customers the full fee on a Paybill is a false saving. Customers notice, and some will pay you in cash or go elsewhere. Run your own numbers, but do not default to the Business Bouquet without thinking about it.
What does B2C (paying customers) cost?
On Safaricom’s Bulk Payment (B2C) Tariff Form, linked from the Bulk Payments page, payments to registered M-Pesa users cost the business KSh 0 up to KSh 100, KSh 5 from KSh 101 to KSh 1,500, KSh 9 from KSh 1,501 to KSh 5,000, KSh 11 from KSh 5,001 to KSh 20,000 and KSh 13 from KSh 20,001 to KSh 250,000. If you also cover the recipient’s withdrawal charge, a KSh 3,000 payout costs KSh 61 instead of KSh 9.
If you plan to send 200 refunds of KSh 1,200 a month: 200 × 5 = KSh 1,000 a month in B2C charges.
What do I need to go live with the M-Pesa API?
Going live is a business task, not a coding task. Safaricom’s own M-Pesa Express documentation says so with unusual frankness: “here Dev you need help from the business teams”.
According to the Daraja Getting Started and M-Pesa Express pages, you need:
- A live M-Pesa account: a Paybill, a Till, or a B2C shortcode. For B2C you need a Bulk Disbursement account or a “one account” that can both receive and pay out, per the B2C documentation.
- Access to the M-Pesa Org portal with an operator holding the Business Administrator or Business Manager role. The documentation says to contact M-PESABusiness@Safaricom.co.ke to create an administrator.
- Bank settlement on your shortcode. Safaricom says the first step before portal access is setting your shortcode’s settlement option to Bank through a Head Office application, which you request from the same M-Pesa Business team.
- The go-live details: your shortcode, your organisation name (shortened, no symbols) and the case-sensitive M-Pesa username. The one-time password goes to the phone number on that user’s portal profile, which must be a Safaricom line.
After a successful go-live, Safaricom emails production endpoints to the developer, moves the app to production with new keys, and, for M-Pesa Express, emails the production passkey.
What documents does Safaricom ask for when opening the account?
The Lipa na M-Pesa KYC Requirements 2026, linked from the account opening page, lists documents by business type. Two of the most common:
| Business type | Key documents Safaricom lists | What it means for you |
|---|---|---|
| Sole proprietor | Signed application form and terms, business registration certificate or business permit, ID of the owner and contact person; for bank settlement, the owner’s KRA PIN certificate and bank details | Usually the quickest route. |
| Limited company | Signed application form and terms, certificate of incorporation, board authorisation or minutes signed by two directors, KRA PINs for the company and its directors, shareholders and beneficial owners, a CR12 not older than 30 days, IDs, beneficial ownership form, bank details | Order a fresh CR12 before you apply. An old one gets the application sent back. |
The same document requires a signed Tariff Guide for a Paybill, a company profile and active website for e-commerce businesses, and a valid licence for regulated businesses.
How do I set up M-Pesa API integration step by step?
- Choose the account type from your own numbers. Use the tariff sums above with your real average payment and monthly volume. Decide Till or Paybill, and whether you need B2C.
- Open or confirm the M-Pesa account. Gather the documents for your business type and apply. Safaricom’s Buy Goods page says till applications are processed within 24 hours.
- Get Org portal access. Ask the M-Pesa Business team for the Business Administrator, then create a Business Manager and any API operator users.
- Create a Daraja account and a sandbox app at developer.safaricom.co.ke. Note the consumer key and secret, and keep them out of your code.
- Build the callback server. It must accept POST requests over HTTPS on a public domain or IP. Whitelist Safaricom’s callback IP addresses, which are listed in the Getting Started guide.
- Test every failure, not just success. Simulate cancelled prompts, wrong PINs, timeouts and duplicate callbacks in the sandbox.
- Go live through the GO LIVE tab with your shortcode, organisation name and operator username.
- Register production C2B URLs once, carefully. In production, registering URLs is a one-time call. Changing them means deleting them under self-service and re-registering, or emailing Safaricom support.
- Reconcile daily for the first month. Compare your system’s records against the Org portal statement every day until they match without effort.
If you want payments flowing straight into invoices and KRA records, our guide to business payment automation from M-Pesa to eTIMS covers that next layer, and automating KRA eTIMS invoicing without errors goes deeper on the tax side.
What are the most common M-Pesa API integration mistakes?
- Assuming the callback always arrives. The Getting Started guide states that if your server is unavailable, Safaricom’s gateway logs a 503 error and discards the result. Without a Transaction Status or Pull Transactions check, those payments silently disappear from your records.
- Treating C2B validation as a settlement check. Validation runs before a payment completes, lets you accept or reject it (for example, a wrong account number), and expects a response within about 8 seconds. The confirmation URL is the one notified after the payment completes. Validation is off by default and must be activated by emailing Safaricom, per the C2B documentation. If you enable it and your server cannot answer, M-Pesa applies your default “Completed” or “Cancelled” setting.
- Using test tools in production. Safaricom says production URLs must be HTTPS, must not use tunnelling or testing services such as ngrok or requestbin, and must avoid words such as “M-PESA”, “Safaricom”, “exec”, “SQL” or “query”.
- Sending a second STK Push too soon. The error “Unable to lock subscriber” means a prompt is still open on that phone. Safaricom’s advice is to wait at least one minute between requests.
- Getting till parameters wrong. For a till, M-Pesa Express needs the Head Office or store number used at go-live as BusinessShortCode and the till number as PartyB, with “CustomerBuyGoodsOnline”. Mixing these up returns “Merchant does not exist”.
- Ignoring field limits and rate limits. AccountReference is limited to 12 characters and TransactionDesc to 13. Too many calls trigger “Spike Arrest Violation” or “Quota Violation” errors.
Customer phone numbers and names are personal data under Kenya’s Data Protection Act, so store only what you need and secure it. Our overview of AI and compliance in Kenya is a sensible starting point.
Quick Glossary
Shortcode: The number that identifies your business on M-Pesa: a Paybill number, a till’s store or Head Office number, or a B2C account number. Callback URL: The web address on your server where M-Pesa sends the final result of a payment request. Consumer key and secret: The pair of credentials Daraja issues for each app, used to request an access token. Security credential: Your API operator’s password encrypted with Safaricom’s public certificate, required for B2C, Transaction Status and Reversal calls. Sandbox: Safaricom’s test environment, with test shortcodes and no real money.
Frequently asked questions
Is the M-Pesa Daraja API free?
Safaricom’s Daraja documentation lists no fee for the account, sandbox or go-live, as of November 2026. You still pay normal M-Pesa transaction tariffs on your Paybill, Till or B2C account, and any developer and hosting costs for the build.
What is the M-Pesa API price per transaction?
There is no separate per-call API price in Safaricom’s documentation. The charge per payment is your account’s tariff: up to 0.55% (capped at KSh 200) on a Business Till, or KSh 0 to KSh 108 on a Paybill depending on the amount and the tariff option you signed.
Can I use STK Push with a till number?
Yes. Safaricom’s M-Pesa Express FAQ confirms it. The catch is the parameters: the shortcode used at go-live goes in BusinessShortCode and the till number goes in PartyB.
What is the maximum amount for M-Pesa Express?
Safaricom’s M-Pesa Express FAQ lists a maximum of KSh 250,000 per transaction, a daily transaction value limit of KSh 500,000 and a minimum of KSh 1.
Do I need a developer for M-Pesa API integration?
Usually, yes. Safaricom’s documentation assumes someone who can run an HTTPS server that receives callbacks, store credentials securely and encrypt the security credential with Safaricom’s certificate. If your goal is only to accept payments at a counter, a till with no integration may be all you need for now.
Further Reading
- Business payment automation in Kenya: M-Pesa to eTIMS: what happens after the money arrives, from receipts to tax records.
- WhatsApp Business API pricing in Kenya: send M-Pesa payment confirmations on WhatsApp and what each message costs.
- Automation ROI: know your payback period: work out whether an integration pays for itself with your own numbers.
- How a Kenyan SME can automate KRA eTIMS invoicing: the compliance side of connecting payments to invoices.
The bottom line
The M-Pesa API costs nothing to access, but the account you connect it to does, and the build is real work. Choose your Till or Paybill tariff from your own numbers, get the Org portal administrator sorted before development starts, and design for missed callbacks from day one.
If you want to map out what your M-Pesa integration should do before you talk to any developer, see how we approach business automation, or WhatsApp us on 0184 113 200. We scope first and quote in writing.