POST: B2C STATUS

Use this endpoint to query for the status of a B2C transaction that was initiated.

Query Status

POST https://payherokenya.com/intasend/b2c_status

Transaction response returns a field labeled tracking_id. We use tracking_id to check for the status of the transaction.

Below are code examples for transaction status querying using the tracking_id.

Body

Response

{
  "file_id": "0444E50",
  "tracking_id": "3d94c15f-89d6-4b95-9268",
  "batch_reference": null,
  "status": "Completed",
  "status_code": "BC100",
  "transactions": [
    {
      "transaction_id": "0L5PJMK",
      "status": "Successful",
      "status_code": "TS100",
      "request_reference_id": "edbe40be-7dd8-4de7-99c4",
      "provider": "MPESA-B2C",
      "bank_code": null,
      "name": null,
      "account": "254708344101",
      "account_type": null,
      "account_reference": null,
      "provider_reference": "SI57K4TDSD",
      "provider_account_name": "  CUSTOMER NAME",
      "amount": "50.00",
      "charge": "10.00",
      "narrative": null,
      "file_id": "0444E50",
      "currency": "KES",
      "created_at": "2024-09-05T19:51:56.559481+03:00",
      "updated_at": "2024-09-05T19:52:13.428109+03:00"
    }
  ],
  "actual_charges": "10.00",
  "paid_amount": "50.00",
  "failed_amount": 0,
  "wallet": {
    "wallet_id": "12345",
    "label": "YOUR NAME",
    "can_disburse": true,
    "currency": "KES",
    "wallet_type": "WORKING",
    "current_balance": 1057.41,
    "available_balance": 1057.41,
    "updated_at": "2024-09-05T19:51:58.423464+03:00"
  },
  "charge_estimate": 10,
  "total_amount_estimate": 60,
  "total_amount": 50,
  "transactions_count": 1,
  "created_at": "2024-09-05T19:51:56.488273+03:00",
  "updated_at": "2024-09-05T19:53:00.335550+03:00",
  "external_reference": "test3636363"
}

Sample Request Code: PHP

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://payherokenya.com/intasend/b2c_status',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "api_username":"232323sadsasasas",
    "tracking_id":"3d94c15f-89d6-4b95-9268"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;

Last updated