Check the Incoming Payment Request status

You can query the status of a Payment Request by querying the Payment Request by its ID. If the Payment Request as been processed and a Incoming Payment Result exists for the Incoming Payment, the Incoming Payment Result will be included in the payload of the Incoming Payment in addition to the original Incoming Payment. If no Incoming Payment Result null will be assigned to the object.

Request and response (view schema in ‘raw’):

Accept: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q

  "data": {
    "id": "a652f86f-f2aa-4d70-baa2-ccfe4b78f4fc",
    "type": "incoming_payment",
    "attributes": {
      "initiation_time": "2020-10-19T09:24:48.622+03:00",
      "status": "Success",
      "event": {
        "type": "Incoming Payment Request",
        "resource": {
          "id": "52f86f-f2aa-4d70-baa2-ccfe4b78f4fc",
          "reference": "OJJ1MPU40Z",
          "origination_time": "2020-10-19T09:24:54+03:00",
          "sender_phone_number": "+254999999999",
          "amount": "100.0",
          "currency": "KES",
          "till_number": "K000000",
          "system": "Lipa Na M-PESA",
          "status": "Received",
          "sender_first_name": "Joe",
          "sender_middle_name": null,
          "sender_last_name": "Buyer"
        "errors": null
      "metadata": {
        "customer_id": "123456789",
        "reference": "123456",
        "notes": "Payment for invoice 12345"
      "_links": {
        "callback_url": "",
        "self": ""
payment_request_url = ''
k2stk ='access_token')

# Using Kopo Kopo Connect - (Recommended)
# To query a specific resource location url

# the location_url is the location resource url returned from creating a payment request
# Response will be in the following:
k2stk.k2_response_body # => response body
//  Using Kopo Kopo Connect - (Recommended)
const StkService = K2.StkService

var incomingPaymentsUrl = ''

  .getStatus({accessToken: 'myRand0mAcc3ssT0k3n', location: incomingPaymentsUrl})
  .then(response => { console.log(response) }) 
  .catch(error => { console.log(error) })
payment_request_url = ''

# Using Kopo Kopo Connect - (Recommended)
k2connect.initialize(CLIENT_ID, CLIENT_SECRET, BASE_URL)
stk_service = k2connect.ReceivePayments
stk_payload = stk_service.payment_request_status(ACCESS_TOKEN, stk_push_location)
# the stk_push_location is the location resource url returned from creating a payment request 
//  Using Kopo Kopo Connect - (Recommended)
$stk = $K2->StkService();

$options = [
  'location' => '',
  'accessToken' => 'myRand0mAcc3ssT0k3n',
$response = $stk->getStatus($options);

echo $response;

You have now successfully received an M-PESA payment from your user(s). Please note if you have also subscribed for the buygoods_transaction_received event webhook, you will also receive a notification of this transaction to the url specified in the webhook subscription.