PayproPaypro
  • 🇮🇩 Indonesia
  • 🇵🇰 Pakistan
  • 🇻🇳 Vietnam
  • 🇵🇭 Philippines
  • 🇰🇪 Kenya
  • 🇪🇬 Egypt
  • 🇧🇷 Brazil
  • 🇲🇽 Mexico
  • 🇮🇩 Indonesia
  • 🇵🇰 Pakistan
  • 🇻🇳 Vietnam
  • 🇵🇭 Philippines
  • 🇰🇪 Kenya
  • 🇪🇬 Egypt
  • 🇧🇷 Brazil
  • 🇲🇽 Mexico
  • Kenya

    • Overview
    • Error Code
    • Payment API
    • Payment Casher
    • Payout API
    • Payment Query API
    • Payout Query API
    • Mpesa Query API
    • Payment Notify API
    • Balance Inquiry API

Mpesa Query API

    Tips

    • All requests are Post requests, and the data format is json
    Brief Description
    • Check transaction results by MPESA transaction codes
    Request URL
    • /api/queryResultByCode
    Request Method
    • Post
    Header
    Namerequiredtypedesc
    merchantNoYesstring-
    Body
    Namerequiredtypedesc
    codeYesstringMPESA transaction codes
    timestampYesstringTimestamp (1715941383720)
    signYesstringExcept for the sign field, all remaining fields should be sorted alphabetically by their first letter, combined into key1=value1key2=value2, and encrypted using the app secret as salt via MD5. The final sign value should be in lowercase.
    Request Parameter Example
    {
        "code": "SHL2A6WAQU",
    	"timestamp":"2222222222",
    	"sign": "000000000"
    }
    
    
    Response Result
    Namerequiredtypedesc
    msgYesstringRequest result (when returning success, it only indicates that the request was successful and cannot be used for merchant-side logic judgment)
    codeYesstringRequest response code (when returning 0000, it only indicates that the request was successful and cannot be used for merchant-side logic judgment). For specific error codes, please refer to the business error code enumeration.
    timestampYesstringTransaction time
    successYesstringTransaction result
    dataYesObjectReturn object
    data.platFormTradeNoYesstringMPESA transaction codes
    data.amountYesstringtransaction amount
    data.statusYesstringRequest result, merchants can use this for logic processing. When the result is 0000, it indicates a successful transaction; 0015 indicates processing; all other codes indicate errors and can be treated as failures.
    data.messageYesstringError description
    data.mpesaReceiptNumberYesstringMPESA transaction codes
    data.successTimeYesstringTransaction success time (Kenya time)
    {
        "msg": "success",
        "code": "0000",
        "timestamp": 1719830071094,
        "success": true,
        "data": {
            "platFormTradeNo": "5286e98841194687a95d25b5f3be346d",
            "tradeNo": "00000020",
            "amount": 3.0000,
            "status": "00029",
    		"mpesaReceiptNumber": "SHL2S6WAAU",
            "message": "REJECTED_TRANSACTION",
            "successTime": "2024-07-01 18:34:31"
        }
    }
    
    
    Last Updated:
    Contributors: wsc
    Prev
    Payout Query API
    Next
    Payment Notify API