{"info":{"_postman_id":"a7e52749-d4d6-43d5-81b2-85335dc41a7a","name":"MuvaTech Mpesa API Documentation","description":"<html><head></head><body><p>This document outlines APIs required for integrating with the Safaricom M-Pesa service, the purpose of each API, the type of sample data to be sent, and how to determine the success or failure of transactions. It also covers error codes and the structure of REST API responses.</p>\n<p>There are URLs required from the client which include confirmation and validation URL.<br><strong>1.Confirmation URL</strong></p>\n<p>Confirmation url is used to receive transaction callback.<br>Confirmation results posted on your URL will have the structure below.</p>\n<img src=\"https://content.pstmn.io/10c0611d-fbb1-4905-af38-b0eae03082b2/aW1hZ2UucG5n\" width=\"830\" height=\"167\">\n\n<p>2.<strong>Validation URL</strong></p>\n<p>Validation request is received by clients who have external validation enabled on their PayBill or BuyGoods and require validating a payment before M-PESA completes the transaction. You will receive validation request to validate on your validation URL.</p>\n<p>The valiation results posted on your URL after payment will have the structure below.</p>\n<img src=\"https://content.pstmn.io/19f40711-434d-47d7-bbe6-e605c61efb91/aW1hZ2UucG5n\" width=\"809\" height=\"362\">\n\n<p><strong>Validation Response</strong><br>After receiving the validation request, you are required to process it and respond to the API call and inform us whether to accept or reject the payment. We send the response we receive to M-PESA.<br>To accept. you send the JSON making sure the value of the ResultCode is 0(zero), but the value of ResultDesc is Accepted.</p>\n<img src=\"https://content.pstmn.io/d0dccba4-f6ce-4f6c-aab7-06851a5e7c1a/aW1hZ2UucG5n\" width=\"810\" height=\"109\">\n\n<p>To reject a transaction, send the same JSON above, but with the ResultCode set as C2B00011. BUT NOT 0. The ResultDesc should be set as Rejected as shown below</p>\n<img src=\"https://content.pstmn.io/4b4b881f-bcb1-427d-b153-be3904ac6dc4/aW1hZ2UucG5n\" width=\"808\" height=\"98\">\n\n  \n<p>Failed STK Callback  </p>\n<img src=\"https://content.pstmn.io/a732d19e-a41d-429e-adbb-c23898174383/aW1hZ2UucG5n\" alt=\"\" height=\"129\" width=\"574\">\n\n<p>Succesfull STK Callback  </p>\n<img src=\"https://content.pstmn.io/8c99f62f-bb72-4525-84ea-c41217e40c70/aW1hZ2UucG5n\" alt=\"\" height=\"125\" width=\"579\">\n\n<p>Failed B2C Callback  </p>\n<img src=\"https://content.pstmn.io/e547b852-549c-4312-9dd0-3bbba7824341/aW1hZ2UucG5n\" alt=\"\" height=\"129\" width=\"748\">\n\n<p>Succesful B2C Callback  </p>\n<img src=\"https://content.pstmn.io/3181082e-26dd-45af-8cc0-70fdb8d1abc9/aW1hZ2UucG5n\" alt=\"\" height=\"132\" width=\"531\"></body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"36018715","collectionId":"a7e52749-d4d6-43d5-81b2-85335dc41a7a","publishedId":"2sA3dyhAb1","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-08-02T08:09:41.000Z"},"item":[{"name":"initiate STK push","id":"6f5f1e4b-a4a5-40a8-8d50-d57e7aca1660","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"phoneNumber\": \"0715316525\",\n    \"amount\":\"10\",\n    \"transactionReference\": \"TXN-17337398003e760-06IMB51122M1122\"\n}\n","options":{"raw":{"language":"json"}}},"url":"https://payments.muva.tech/api/v1/payments/initiateSTKpush","description":"<p>This API is used in initiating an STK push</p>\n","urlObject":{"protocol":"https","path":["api","v1","payments","initiateSTKpush"],"host":["payments","muva","tech"],"query":[],"variable":[]}},"response":[{"id":"2082fdda-da64-408d-947d-a10549d7a7af","name":"initiate STK push","originalRequest":{"method":"POST","header":[{"key":"Origin","value":"https://payments.muva.tech","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"phoneNumber\": \"0715316525\",\n    \"amount\":\"10\",\n    \"transactionReference\": \"TXN-17337398003e760-06IMB51122M1122\"\n}\n","options":{"raw":{"language":"json"}}},"url":"{{produrl}}/api/v1/payments/initiateSTKpush"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.24.0 (Ubuntu)"},{"key":"Content-Type","value":"application/json"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 24 Feb 2025 11:22:51 GMT"},{"key":"X-RateLimit-Limit","value":"60"},{"key":"X-RateLimit-Remaining","value":"58"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"strict-origin-when-cross-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"responseCode\": 0,\n    \"transactionReference\": \"TXN-17337398003e760-06IMB51122M1122\",\n    \"responseMessage\": \"Success. Request accepted for processing\"\n}"}],"_postman_id":"6f5f1e4b-a4a5-40a8-8d50-d57e7aca1660"},{"name":"initiateB2C","id":"14cc3602-966f-43aa-ad2d-6c897a58ba3b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"phoneNumber\": \"0715316525\",\n    \"amount\": \"10\",\n    \"transactionReference\": \"TXN-1733318510934-MHK7Rxq\"\n}","options":{"raw":{"language":"json"}}},"url":"https://payments.muva.tech/api/v1/payments/initiateB2C","description":"<p>This API is used in initiating payment to a client from the organization</p>\n","urlObject":{"protocol":"https","path":["api","v1","payments","initiateB2C"],"host":["payments","muva","tech"],"query":[],"variable":[]}},"response":[{"id":"8d497b2c-fda9-46f7-af62-b43224dfbda1","name":"initiateB2C","originalRequest":{"method":"POST","header":[{"key":"Origin","value":"https://payments.muva.tech","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"phoneNumber\": \"0715316525\",\n    \"amount\": \"10\",\n    \"transactionReference\": \"TXN-1733318510934-MHK7Rxq\"\n}","options":{"raw":{"language":"json"}}},"url":"https://payments.muva.tech/api/v1/payments/initiateB2C"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.24.0 (Ubuntu)"},{"key":"Content-Type","value":"application/json"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 24 Feb 2025 11:35:09 GMT"},{"key":"X-RateLimit-Limit","value":"60"},{"key":"X-RateLimit-Remaining","value":"59"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"strict-origin-when-cross-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"responseCode\": 0,\n    \"transactionReference\": \"TXN-1733318510934-MHK7Rxq\",\n    \"responseMessage\": \"Request Accepted and Queued Successfully\"\n}"}],"_postman_id":"14cc3602-966f-43aa-ad2d-6c897a58ba3b"}]}