{"id":861,"date":"2026-09-12T11:15:34","date_gmt":"2026-09-12T11:15:34","guid":{"rendered":"https:\/\/zamacore.com\/blog\/m-pesa-integration-exception-handling-kenya\/"},"modified":"2026-09-12T11:15:34","modified_gmt":"2026-09-12T11:15:34","slug":"m-pesa-integration-exception-handling-kenya","status":"publish","type":"post","link":"https:\/\/zamacore.com\/blog\/m-pesa-integration-exception-handling-kenya\/","title":{"rendered":"M-Pesa Integration Kenya: Specify Exceptions Before Development"},"content":{"rendered":"<p><!-- reviewed-blog-2026-09-12-zamacore --><\/p>\n<p>An M-Pesa integration project needs more than a successful payment demonstration. Finance teams need to know what happens when a notification arrives twice, a customer uses the wrong reference or an invoice remains unpaid after money is received. Define these cases before approving a development scope.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/zamacore.com\/blog\/m-pesa-integration-exception-handling-kenya\/#Start_with_a_payment-to-invoice_map\" >Start with a payment-to-invoice map<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/zamacore.com\/blog\/m-pesa-integration-exception-handling-kenya\/#Test_duplicate_and_delayed_notifications\" >Test duplicate and delayed notifications<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/zamacore.com\/blog\/m-pesa-integration-exception-handling-kenya\/#Make_manual_corrections_reviewable\" >Make manual corrections reviewable<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/zamacore.com\/blog\/m-pesa-integration-exception-handling-kenya\/#Brief_ZamaCore_with_real_exceptions\" >Brief ZamaCore with real exceptions<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Start_with_a_payment-to-invoice_map\"><\/span>Start with a payment-to-invoice map<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>List the source transaction identifier, account reference, amount, time and destination invoice. Decide which record is authoritative when two systems disagree. A useful discovery session follows one payment from receipt through allocation, a customer balance and the finance report. Avoid relying on a customer&#39;s screenshot as the sole payment record.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Test_duplicate_and_delayed_notifications\"><\/span>Test duplicate and delayed notifications<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Ask the implementation team to replay the same notification and show that it does not create a second receipt. Then test a notification that arrives after an invoice has been changed. The system needs a clear exception state, a responsible reviewer and enough history to explain the eventual allocation. Retry behaviour should be agreed as part of the integration scope.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Make_manual_corrections_reviewable\"><\/span>Make manual corrections reviewable<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A correction should identify the original transaction, reason, operator and resulting allocation. Ask how access to corrections is restricted and how finance can export unresolved items. Do not treat an unmatched payment as an automatic failure or silently assign it to a tenant with a similar name. Define reconciliation ownership across the business and software supplier.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Brief_ZamaCore_with_real_exceptions\"><\/span>Brief ZamaCore with real exceptions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Bring anonymised examples of duplicate messages, incorrect references and split payments to a project consultation. ZamaCore&#39;s public offering includes M-Pesa workflows and business systems. Ask for a scoped demonstration and acceptance criteria covering your accounting process, integration dependencies and support responsibilities. Agree which controls are standard and which require custom development.<\/p>\n<p>Explore <a href=\"https:\/\/zamacore.com\/\">ZamaCore<\/a> to discuss the requirements in this guide.<\/p>\n<p>Further reading: <a href=\"https:\/\/developer.safaricom.co.ke\/\" target=\"_blank\" rel=\"noopener\">Safaricom Daraja developer portal<\/a>. Confirm requirements for your own operation with the responsible provider or organisation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Explore M-Pesa Integration Exception Handling Kenya. Compare workflow requirements, test exceptions and prepare a focused enquiry with ZamaCore.<\/p>\n","protected":false},"author":1,"featured_media":860,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-861","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-business-systems"],"_links":{"self":[{"href":"https:\/\/zamacore.com\/blog\/wp-json\/wp\/v2\/posts\/861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zamacore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zamacore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zamacore.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zamacore.com\/blog\/wp-json\/wp\/v2\/comments?post=861"}],"version-history":[{"count":0,"href":"https:\/\/zamacore.com\/blog\/wp-json\/wp\/v2\/posts\/861\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zamacore.com\/blog\/wp-json\/wp\/v2\/media\/860"}],"wp:attachment":[{"href":"https:\/\/zamacore.com\/blog\/wp-json\/wp\/v2\/media?parent=861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zamacore.com\/blog\/wp-json\/wp\/v2\/categories?post=861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zamacore.com\/blog\/wp-json\/wp\/v2\/tags?post=861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}