Webhooks
Webhooks are a means of getting notified of events in the Kopo Kopo application. To receive webhooks, you need to create a webhook subscription. See developer guide
Create a webhook subscription
POST https://sandbox.kopokopo.com/api/v2/webhook_subscriptions
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: "< product >/< product-version > < comment >"
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"event_type": "buygoods_transaction_received",
"url": "https://myapplication.com/webhooks",
"scope": "till",
"scope_reference": "555555",
"enable_daraja_payload": false
}
# Using K2Connect - https://github.com/kopokopo/k2-connect-ruby (Recommended)
require 'k2-connect-ruby'
app_token = K2AccessToken.new('your_client_id', 'your_client_secret').request_token
subscription = K2Subscribe.new(app_token)
event_subscription = {
event_type: "b2b_transaction_received",
url: "callback_url",
scope: "till",
scope_reference: "555555",
enable_daraja_payload: false
}
subscription.webhook_subscribe(event_subscription)
subscription.location_url # => "https://sandbox.kopokopo.com/api/v2/webhook_subscriptions/5af4c10a-f6de-4ac8-840d-42cb65454216"
import k2connect
payload = {
"access_token": ACCESS_TOKEN,
"event_type": 'buygoods_transaction_received',
"webhook_endpoint": 'https://webhook.site/52fd1913-778e-4ee1-bdc4-74517abb758d',
"scope": 'till',
"scope_reference": '112233',
"enable_daraja_payload": True
}
k2connect.initialize(CLIENT_ID, CLIENT_SECRET, BASE_URL)
webhook_service = k2connect.Webhooks
subscription_location = webhook_service.create_subscription(payload)
subscription_location # => "https://sandbox.kopokopo.com/api/v2/webhook_subscriptions/5af4c10a-f6de-4ac8-840d-42cb65454216"
const Webhooks = K2.Webhooks
var requestBody = {
eventType: 'buygoods_transaction_received',
url: 'https://myawesomeapplication.com/destination',
scope: 'till',
scopeReference: '555555', // Your till number
accessToken: 'my_access_token',
enableDarajaPayload: false
}
Webhooks
.subscribe(subscribeOptions)
.then(response => { console.log(response) })
.catch(error => { console.log(error) })
// => 'https://sandbox.kopokopo.com/webhook-subscriptions/5af4c10a-f6de-4ac8-840d-42cb65454216'
<?
$webhooks = $K2->Webhooks();
$response = $webhooks->subscribe([
'eventType' => 'buygoods_transaction_received',
'url' => 'https://myawesomeapplication.com/destination',
'scope' => 'till',
'scopeReference' => '555555', // Your till number
'accessToken' => 'my_access_token',
'enableDarajaPayload' => 'false'
]);
if($response['status'] == 'success')
{
echo "The resource location is:" . json_encode($response['location']);
}
// => 'https://sandbox.kopokopo.com/webhook-subscriptions/5af4c10a-f6de-4ac8-840d-42cb65454216'
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
HTTP Request
POST https://sandbox.kopokopo.com/api/v2/webhook_subscriptions
Request Parameters (JSON)
| Parameter | Required | Type | Description |
|---|---|---|---|
| event_type | yes | string | The type of event you are subscribing to. Should be one of: buygoods_transaction_received, buygoods_transaction_reversed, b2b_transaction_received, b2b_transaction_reversed,settlement_transfer_completed, card_transaction_received, card_transaction_voided, card_transaction_reversed |
| url | yes | string | The HTTPS end point to send the webhook. MUST be secured with HTTPS (TLS) |
| scope | yes | string | The scope of the webhook subscription. Could be either company or till |
| scope_reference | yes | string | If the scope is till the scope reference is required and it should be your till number |
| enable_daraja_payload | no | Boolean | Configuration used to determine the payload structure that the webhook notifications will use. Either the Daraja API payload structure (true) or the K2Connect API payload structure (false). Defaulted to false. |
Daraja payload is only applicable for buygoods_transaction_received and b2b_transaction_received event types.
HTTP Response
Successful Response
Upon successful creation of the webhook subscription, HTTP Status Code 201 with the URL of the subscription in the Location Header of the HTTP Response.
HTTP/1.1 201 Created
Location: https://sandbox.kopokopo.com/api/v2/webhook_subscriptions/d76265cd-0951-e511-80da-0aa34a9b2388
Error Response
This will have a HTTP Status code indicating the error and it might have a json that contains the error code and an error message specifying the error that occured. Please note that the error response might not be present depending on the type of error that occured.
If the error json response is present, it will look as follows:
HTTP/1.1 400 Bad Request
{ "error_code": 400, "error_message": "Invalid scope reference" }
Validating webhooks
- Ruby
- Python
- JavaScript
- PHP
- Dart
webhook_test = K2Client.new(ENV["API_KEY"])
webhook_test.parse_request(request)
webhook_payload = webhook_test.hash_body
processed_payload = K2ProcessWebhook.process(webhook_payload, secret, webhook_test.k2_signature)
k2connect.initialize(CLIENT_SECRET, CLIENT_SECRET, BASE_URL)
result_handler = k2connect.ResultHandler
processed_payload = result_handler.process(request)
const Webhooks = K2.Webhooks
//Router or whatever server you are using
// This is the endpoint you used when subscribing
router.post('/buygoodsreceived', function(req, res, next){
// This will both validate and process the payload for you
Webhooks
.webhookHandler(req, res)
.then( response => {
console.log(response)
})
.catch( error => {
console.log(error)
})
})
<?
$webhooks = $K2->Webhooks();
$webhook_payload = file_get_contents('php://input');
// This will both validate and process the payload for you
$response = $webhooks->webhookHandler($webhook_payload, $_SERVER['HTTP_X_KOPOKOPO_SIGNATURE']);
echo json_encode($response);
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Before processing webhook events, make sure that they originated from Kopo Kopo.Each request is signed with the api_key you got when creating an oauth application on the platform.
The signature is contained in the X-KopoKopo-Signature header and is a SHA256 HMAC hash of the request body with
the key being your API Key.
Buygoods Transaction Received
Notifies your application when a Buygoods Transaction has been received.
Buygoods Transaction Received webhook notifications are in two formats:
-
K2Connect Payload structure
-
Daraja Payload structure
POST https://www.your-application.com/payments/webhook
Content-Type: application/json
User-Agent: < product >/< product-version > < comment >
X-KopoKopo-Signature: a5d74a17a55554edc4e9999c59e460c61aa7f81a
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"topic": "buygoods_transaction_received",
"id": "2133dbfb-24b9-40fc-ae57-2d7559785760",
"created_at": "2026-05-01T10:43:20+03:00",
"event": {
"type": "Buygoods Transaction",
"resource": {
"id": "458712f-gr76y-24b9-40fc-ae57-2d35785760",
"amount": "100.0",
"status": "Received",
"system": "Lipa Na M-PESA",
"currency": "KES",
"reference": "OJM6Q1W84K",
"till_number": "000000",
"sender_phone_number": "+254999999999",
"hashed_sender_phone" : "cbc504704d2c654f8bf08de98945980b77567d8c611d355ca3aef480c960ad9c",
"origination_time": "2026-05-01T10:43:19+03:00",
"sender_first_name": "Jane",
"sender_last_name": null,
"sender_middle_name": null
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/2133dbfb-24b9-40fc-ae57-2d7559785760",
"resource": "https://sandbox.kopokopo.com/financial_transaction/458712f-gr76y-24b9-40fc-ae57-2d35785760"
}
}
{
"topic": "buygoods_transaction_received",
"id": "2133dbfb-24b9-40fc-ae57-2d7559785760",
"created_at": "2026-05-01T10:43:20+03:00",
"event": {
"type": "Buygoods Transaction",
"resource": {
"id": "458712f-gr76y-24b9-40fc-ae57-2d35785760",
"amount": "100.0",
"status": "Received",
"system": "Lipa Na M-PESA",
"currency": "KES",
"reference": "OJM6Q1W84K",
"till_number": "000000",
"sender_phone_number": "+254999999999",
"origination_time": "2026-05-01T10:43:19+03:00",
"sender_last_name": "Doe",
"sender_first_name": "Jane",
"sender_middle_name": null
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/2133dbfb-24b9-40fc-ae57-2d7559785760",
"resource": "https://sandbox.kopokopo.com/financial_transaction/458712f-gr76y-24b9-40fc-ae57-2d35785760"
}
}
{
"topic": "buygoods_transaction_received",
"id": "2133dbfb-24b9-40fc-ae57-2d7559785760",
"created_at": "2026-05-01T10:43:20+03:00",
"event": {
"type": "Buygoods Transaction",
"resource": {
"id": "458712f-gr76y-24b9-40fc-ae57-2d35785760",
"amount": "100.0",
"status": "Received",
"system": "Lipa Na M-PESA",
"currency": "KES",
"reference": "OJM6Q1W84K",
"till_number": "000000",
"sender_phone_number": "+254999999999",
"origination_time": "2026-05-01T10:43:19+03:00",
"sender_last_name": "Doe",
"sender_first_name": "Jane",
"sender_middle_name": null
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/2133dbfb-24b9-40fc-ae57-2d7559785760",
"resource": "https://sandbox.kopokopo.com/financial_transaction/458712f-gr76y-24b9-40fc-ae57-2d35785760"
}
}
{
"topic": "buygoods_transaction_received",
"id": "2133dbfb-24b9-40fc-ae57-2d7559785760",
"created_at": "2026-05-01T10:43:20+03:00",
"event": {
"type": "Buygoods Transaction",
"resource": {
"id": "458712f-gr76y-24b9-40fc-ae57-2d35785760",
"amount": "100.0",
"status": "Received",
"system": "Lipa Na M-PESA",
"currency": "KES",
"reference": "OJM6Q1W84K",
"till_number": "000000",
"sender_phone_number": "+254999999999",
"origination_time": "2026-05-01T10:43:19+03:00",
"sender_last_name": "Doe",
"sender_first_name": "Jane",
"sender_middle_name": null
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/2133dbfb-24b9-40fc-ae57-2d7559785760",
"resource": "https://sandbox.kopokopo.com/financial_transaction/458712f-gr76y-24b9-40fc-ae57-2d35785760"
}
}
<?
// The payload from the k2-connect-php SDK will look like this.
[
"status" => "success",
"data" => [
"id" => "cac95329-9fa5-42f1-a4fc-c08af7b868fb",
"topic" => "buygoods_transaction_received",
"created_at" => "2018-06-20T22:45:12.790Z",
"eventType" =>"Buygoods Transaction",
"resourceId" => "52f86f-f2aa-4d70-baa2-ccfe4b78f4fc",
"status" => "Received",
"reference" => '123456789',
"originationTime" => "2017-01-20T22:45:12.790Z",
"senderPhoneNumber" => "+2549703119050",
"amount" => 20000,
"currency" => "KES",
"tillNumber" => "000000",
"system" => "Lipa Na M-PESA",
"senderFirstName" => "John",
"senderMiddleName" => "O",
"senderLastName" => "Doe",
"linkSelf" => "https://sandbox.kopokopo.com/webhook_events/cac95329-9fa5-42f1-a4fc-c08af7b868fb",
"linkResource" => "https://sandbox.kopokopo.com/financial_transaction/458712f-gr76y-24b9-40fc-ae57-2d35785760",
]
]
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
K2Connect Webhook Parameters (JSON)
Parameters contained in a buygoods_transaction_received webhook;
| Parameter | Type | Description |
|---|---|---|
| id | String | The ID of the Webhook Event |
| topic | String | The topic of the webhook. buygoods_transaction_received in this instance. |
| created_at | String | The timestamp of when the webhook event was created. |
| _links | JSON | A JSON object containing links to the Webhook Event and the corresponding Buygoods Transaction resource |
Event JSON
| Parameter | Type | Description |
|---|---|---|
| type | String | The type of transaction (Buygoods Transaction) |
| resource | JSON | The resource corresponding to the event. In this case this is a Buygoods Transaction |
Resource (Buygoods Transaction) JSON
| Parameter | Type | Description |
|---|---|---|
| id | String | The api reference of the transaction |
| reference | String | The mpesa reference |
| status | String | The status of the transaction |
| origination_time | String | The transaction timestamp |
| sender_phone_number | String | The phone number that sent the payment |
| hashed_sender_phone | String | The hashed phone number that sent the payment |
| amount | Float | The amount of the transaction |
| currency | String | Currency |
| till_number | String | The till number to which the payment was made |
| system | String | The mobile money system |
| sender_first_name | String | First name of payer |
| sender_middle_name | String | Middle name of payer |
| sender_last_name | String | Last name of payer |
Daraja Webhook Parameters (JSON)
POST https://www.your-application.com/payments/webhook
Content-Type: application/json
User-Agent: < product >/< product-version > < comment >
X-KopoKopo-Signature: a5d74a17a55554edc4e9999c59e460c61aa7f81a
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"TransactionType": "Buygoods",
"TransID": "OJM6Q1W84K",
"TransTime": "20260501191515",
"TransAmount": "100.0",
"BusinessShortCode": "000000",
"BillRefNumber": "",
"InvoiceNumber": "",
"OrgAccountBalance": "",
"ThirdPartyTransId": "",
"MSISDN": "rbFvT0GstruVPN/B68z6yWD973VhweR31G8fhM5bxo=",
"FirstName": "Jane",
"MiddleName": null,
"LastName": null
}
{
"TransactionType": "Buygoods",
"TransID": "OJM6Q1W84K",
"TransTime": "20260501191515",
"TransAmount": "100.0",
"BusinessShortCode": "000000",
"BillRefNumber": "",
"InvoiceNumber": "",
"OrgAccountBalance": "",
"ThirdPartyTransId": "",
"MSISDN": "rbFvT0GstruVPN/B68z6yWD973VhweR31G8fhM5bxo=",
"FirstName": "Jane",
"MiddleName": null,
"LastName": null
}
{
"TransactionType": "Buygoods",
"TransID": "OJM6Q1W84K",
"TransTime": "20260501191515",
"TransAmount": "100.0",
"BusinessShortCode": "000000",
"BillRefNumber": "",
"InvoiceNumber": "",
"OrgAccountBalance": "",
"ThirdPartyTransId": "",
"MSISDN": "rbFvT0GstruVPN/B68z6yWD973VhweR31G8fhM5bxo=",
"FirstName": "Jane",
"MiddleName": null,
"LastName": null
}
{
"TransactionType": "Buygoods",
"TransID": "OJM6Q1W84K",
"TransTime": "20260501191515",
"TransAmount": "100.0",
"BusinessShortCode": "000000",
"BillRefNumber": "",
"InvoiceNumber": "",
"OrgAccountBalance": "",
"ThirdPartyTransId": "",
"MSISDN": "rbFvT0GstruVPN/B68z6yWD973VhweR31G8fhM5bxo=",
"FirstName": "Jane",
"MiddleName": null,
"LastName": null
}
<?
// The payload from the k2-connect-php SDK will look like this.
[
"status" => "success",
"data" => [
"TransactionType": "Buygoods",
"TransID": "OJM6Q1W84K",
"TransTime": "20260501191515",
"TransAmount": "100.0",
"BusinessShortCode": "000000",
"BillRefNumber": "",
"InvoiceNumber": "",
"OrgAccountBalance": "",
"ThirdPartyTransId": "",
"MSISDN": "rbFvT0GstruVPN/B68z6yWD973VhweR31G8fhM5bxo=",
"FirstName": "Jane",
"MiddleName": null,
"LastName": null
]
]
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Parameters contained in a buygoods_transaction_received daraja webhook;
| Parameter | Type | Description |
|---|---|---|
| TransactionType | String | The type of transaction (Buygoods in this instance) |
| TransID | String | The transaction reference. |
| TransTime | String | The timestamp in the format YYYYMMDDhhmmss of when the transaction occurred. |
| TransAmount | Float | The amount of the transaction |
| BusinessShortCode | String | The till number to which the payment was made to |
| BillRefNumber | String | Empty |
| InvoiceNumber | String | Empty |
| OrgAccountBalance | String | Empty |
| ThirdPartyTransId | String | Empty |
| MSISDN | String | The hashed phone number that sent the payment |
| FirstName | String | First name for customer who sent the payment |
| MiddleName | String | Empty |
| LastName | String | Empty |
Values are displayed in accordance with data protection rules, hence MiddleName and LastName will not be available.
B2B Transaction Received
Notifies your application when a B2B (External Till to Till transaction) has been received. These are payments received from other tills and not subscribers.
B2B Transaction Received webhook notifications are in two formats:
-
K2Connect Payload structure
-
Daraja Payload structure
POST https://www.your-application.com/payments/webhook
Content-Type: application/json
User-Agent: < product >/< product-version > < comment >
X-KopoKopo-Signature: a5d74a17a55554edc4e9999c59e460c61aa7f81a
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"topic": "b2b_transaction_received",
"id": "bcfb7175-bc7f-46e8-9727-eb46e6f88ef1",
"created_at": "2020-10-29T08:18:45+03:00",
"event": {
"type": "External Till to Till Transaction",
"resource": {
"id": "fbygwu7175-bc7f-46e8-9727-f88edyy",
"amount": "313",
"status": "Complete",
"system": "Lipa Na Mpesa",
"currency": "KES",
"reference": "OJQ8USH5XK",
"till_number": "000000",
"sending_till": "890642",
"origination_time": "2020-10-29T08:18:45+03:00"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/bcfb7175-bc7f-46e8-9727-eb46e6f88ef1",
"resource": "https://sandbox.kopokopo.com/financial_transaction/fbygwu7175-bc7f-46e8-9727-f88edyy"
}
}
{
"topic": "b2b_transaction_received",
"id": "bcfb7175-bc7f-46e8-9727-eb46e6f88ef1",
"created_at": "2020-10-29T08:18:45+03:00",
"event": {
"type": "External Till to Till Transaction",
"resource": {
"id": "fbygwu7175-bc7f-46e8-9727-f88edyy",
"amount": "313",
"status": "Complete",
"system": "Lipa Na Mpesa",
"currency": "KES",
"reference": "OJQ8USH5XK",
"till_number": "000000",
"sending_till": "000001",
"origination_time": "2020-10-29T08:18:45+03:00"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/bcfb7175-bc7f-46e8-9727-eb46e6f88ef1",
"resource": "https://sandbox.kopokopo.com/financial_transaction/fbygwu7175-bc7f-46e8-9727-f88edyy"
}
}
{
"topic": "b2b_transaction_received",
"id": "bcfb7175-bc7f-46e8-9727-eb46e6f88ef1",
"created_at": "2020-10-29T08:18:45+03:00",
"event": {
"type": "External Till to Till Transaction",
"resource": {
"id": "fbygwu7175-bc7f-46e8-9727-f88edyy",
"amount": "313",
"status": "Complete",
"system": "Lipa Na Mpesa",
"currency": "KES",
"reference": "OJQ8USH5XK",
"till_number": "000000",
"sending_till": "000001",
"origination_time": "2020-10-29T08:18:45+03:00"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/bcfb7175-bc7f-46e8-9727-eb46e6f88ef1",
"resource": "https://sandbox.kopokopo.com/financial_transaction/fbygwu7175-bc7f-46e8-9727-f88edyy"
}
}
{
"topic": "b2b_transaction_received",
"id": "bcfb7175-bc7f-46e8-9727-eb46e6f88ef1",
"created_at": "2020-10-29T08:18:45+03:00",
"event": {
"type": "External Till to Till Transaction",
"resource": {
"id": "fbygwu7175-bc7f-46e8-9727-f88edyy",
"amount": "313",
"status": "Complete",
"system": "Lipa Na Mpesa",
"currency": "KES",
"reference": "OJQ8USH5XK",
"till_number": "000000",
"sending_till": "000001",
"origination_time": "2020-10-29T08:18:45+03:00"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/bcfb7175-bc7f-46e8-9727-eb46e6f88ef1",
"resource": "https://sandbox.kopokopo.com/financial_transaction/fbygwu7175-bc7f-46e8-9727-f88edyy"
}
}
<?
// The payload from the k2-connect-php SDK will look like this.
[
"status" => "success",
"data" => [
"id" => "cac95329-9fa5-42f1-a4fc-c08af7b868fb",
"topic" => "b2b_transaction_received",
"createdAt" => "2018-06-20T22:45:12.790Z",
"eventType" =>"External Till to Till Transaction",
"resourceId" => "52f86f-f2aa-4d70-baa2-ccfe4b78f4fc",
"status" => "Received",
"system" => "Lipa Na Mpesa",
"reference" => '123456789',
"originationTime" => "2017-01-20T22:45:12.790Z",
"sendingTill" => "+2549703119050",
"amount" => 20000,
"currency" => "KES",
"tillNumber" => "000000",
"linkSelf" => "https://sandbox.kopokopo.com/webhook_events/cac95329-9fa5-42f1-a4fc-c08af7b868fb",
"linkResource" => "https://sandbox.kopokopo.com/financial_transaction/458712f-gr76y-24b9-40fc-ae57-2d35785760",
]
]
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Notifies your application when a B2b (External Till to Till transaction) has been received. These are payments recieved from other tills and not subscribers.
K2Connect Webhook Parameters (JSON)
Parameters contained in a b2b_transaction_received webhook;
| Parameter | Type | Description |
|---|---|---|
| id | String | The ID of the Webhook Event |
| topic | String | The topic of the webhook. b2b_transaction_received in this instance. |
| created_at | String | The timestamp of when the webhook event was created. |
| _links | JSON | A JSON object containing links to the Webhook Event and the corresponding B2B Transaction resource |
Event JSON
| Parameter | Type | Description |
|---|---|---|
| type | String | The type of transaction (B2B Transaction) |
| resource | JSON | The resource corresponding to the event. In this case this is a Buygoods Transaction |
Resource (Buygoods Transaction) JSON
| Parameter | Type | Description |
|---|---|---|
| id | String | The api reference of the transaction |
| reference | String | The mpesa reference |
| origination_time | String | The transaction timestamp |
| sending_till | String | The till number of the sender |
| status | String | The status of the transaction |
| amount | Float | The amount of the transaction |
| currency | String | Currency |
| till_number | String | The till number to which the payment was made |
| system | String | The mobile money system |
Daraja Webhook Parameters (JSON)
POST https://www.your-application.com/payments/webhook
Content-Type: application/json
User-Agent: < product >/< product-version > < comment >
X-KopoKopo-Signature: a5d74a17a55554edc4e9999c59e460c61aa7f81a
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"TransactionType": "Organization To Organization Transfer",
"TransID": "OJM6Q1W84K",
"TransTime": "20260501191515",
"TransAmount": "100.0",
"BusinessShortCode": "000000",
"BillRefNumber": "",
"InvoiceNumber": "",
"OrgAccountBalance": "",
"ThirdPartyTransId": "",
"MSISDN": "112233",
"FirstName": "Organization name",
"MiddleName": null,
"LastName": null
}
{
"TransactionType": "Organization To Organization Transfer",
"TransID": "OJM6Q1W84K",
"TransTime": "20260501191515",
"TransAmount": "100.0",
"BusinessShortCode": "000000",
"BillRefNumber": "",
"InvoiceNumber": "",
"OrgAccountBalance": "",
"ThirdPartyTransId": "",
"MSISDN": "112233",
"FirstName": "Organization name",
"MiddleName": nil,
"LastName": nil
}
{
"TransactionType": "Organization To Organization Transfer",
"TransID": "OJM6Q1W84K",
"TransTime": "20260501191515",
"TransAmount": "100.0",
"BusinessShortCode": "000000",
"BillRefNumber": "",
"InvoiceNumber": "",
"OrgAccountBalance": "",
"ThirdPartyTransId": "",
"MSISDN": "112233",
"FirstName": "Organization name",
"MiddleName": null,
"LastName": null
}
{
"TransactionType": "Organization To Organization Transfer",
"TransID": "OJM6Q1W84K",
"TransTime": "20260501191515",
"TransAmount": "100.0",
"BusinessShortCode": "000000",
"BillRefNumber": "",
"InvoiceNumber": "",
"OrgAccountBalance": "",
"ThirdPartyTransId": "",
"MSISDN": "112233",
"FirstName": "Organization name",
"MiddleName": null,
"LastName": null
}
<?
// The payload from the k2-connect-php SDK will look like this.
[
"status" => "success",
"data" => [
"TransactionType": "Organization To Organization Transfer",
"TransID": "OJM6Q1W84K",
"TransTime": "20260501191515",
"TransAmount": "100.0",
"BusinessShortCode": "000000",
"BillRefNumber": "",
"InvoiceNumber": "",
"OrgAccountBalance": "",
"ThirdPartyTransId": "",
"MSISDN": "112233",
"FirstName": "Organization name",
"MiddleName": null,
"LastName": null
]
]
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Parameters contained in a b2b_transaction_received webhook;
| Parameter | Type | Description |
|---|---|---|
| TransactionType | String | The type of transaction (Organization To Organization Transfer in this instance) |
| TransID | String | The transaction reference. |
| TransTime | String | The timestamp in the format YYYYMMDDhhmmss of when the transaction occurred. |
| TransAmount | Float | The amount of the transaction |
| BusinessShortCode | String | The till number to which the payment was made to |
| BillRefNumber | String | Empty |
| InvoiceNumber | String | Empty |
| OrgAccountBalance | String | Empty |
| ThirdPartyTransId | String | Empty |
| MSISDN | String | Till number or paybill number that sent the payment |
| FirstName | String | Organization name for till or paybill that sent payment |
| MiddleName | String | Empty |
| LastName | String | Empty |
Buygoods Transaction Reversed
POST https://www.your-application.com/payments/webhook
Content-Type: application/json
User-Agent: < product >/< product-version > < comment >
X-KopoKopo-Signature: a5d74a17a55554edc4e9999c59e460c61aa7f81a
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"topic": "buygoods_transaction_reversed",
"id": "98adf21e-5721-476a-8643-609b4a6513a2",
"created_at": "2020-10-29T08:06:49+03:00",
"event": {
"type": "Buygoods Transaction",
"resource": {
"id": "86345adf21e-5721-476a-8643-609b4a863",
"amount": "233",
"status": "Reversed",
"system": "Lipa Na Mpesa",
"currency": "KES",
"reference": "OJM6Q1W84K",
"till_number": "000000",
"origination_time": "2020-10-29T08:06:49+03:00",
"sender_last_name": "Doe",
"sender_first_name": "Jane",
"sender_middle_name": "",
"sender_phone_number": "+254999999999"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/98adf21e-5721-476a-8643-609b4a6513a2",
"resource": "https://sandbox.kopokopo.com/financial_transaction/86345adf21e-5721-476a-8643-609b4a863"
}
}
{
"topic": "buygoods_transaction_reversed",
"id": "98adf21e-5721-476a-8643-609b4a6513a2",
"created_at": "2020-10-29T08:06:49+03:00",
"event": {
"type": "Buygoods Transaction",
"resource": {
"id": "86345adf21e-5721-476a-8643-609b4a863",
"amount": "233",
"status": "Reversed",
"system": "Lipa Na Mpesa",
"currency": "KES",
"reference": "OJM6Q1W84K",
"till_number": "000000",
"origination_time": "2020-10-29T08:06:49+03:00",
"sender_last_name": "Doe",
"sender_first_name": "Jane",
"sender_middle_name": "",
"sender_phone_number": "+254999999999"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/98adf21e-5721-476a-8643-609b4a6513a2",
"resource": "https://sandbox.kopokopo.com/financial_transaction/86345adf21e-5721-476a-8643-609b4a863"
}
}
{
"topic": "buygoods_transaction_reversed",
"id": "98adf21e-5721-476a-8643-609b4a6513a2",
"created_at": "2020-10-29T08:06:49+03:00",
"event": {
"type": "Buygoods Transaction",
"resource": {
"id": "86345adf21e-5721-476a-8643-609b4a863",
"amount": "233",
"status": "Reversed",
"system": "Lipa Na Mpesa",
"currency": "KES",
"reference": "OJM6Q1W84K",
"till_number": "000000",
"origination_time": "2020-10-29T08:06:49+03:00",
"sender_last_name": "Doe",
"sender_first_name": "Jane",
"sender_middle_name": "",
"sender_phone_number": "+254999999999"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/98adf21e-5721-476a-8643-609b4a6513a2",
"resource": "https://sandbox.kopokopo.com/financial_transaction/86345adf21e-5721-476a-8643-609b4a863"
}
}
{
"topic": "buygoods_transaction_reversed",
"id": "98adf21e-5721-476a-8643-609b4a6513a2",
"created_at": "2020-10-29T08:06:49+03:00",
"event": {
"type": "Buygoods Transaction",
"resource": {
"id": "86345adf21e-5721-476a-8643-609b4a863",
"amount": "233",
"status": "Reversed",
"system": "Lipa Na Mpesa",
"currency": "KES",
"reference": "OJM6Q1W84K",
"till_number": "000000",
"origination_time": "2020-10-29T08:06:49+03:00",
"sender_last_name": "Doe",
"sender_first_name": "Jane",
"sender_middle_name": "",
"sender_phone_number": "+254999999999"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/98adf21e-5721-476a-8643-609b4a6513a2",
"resource": "https://sandbox.kopokopo.com/financial_transaction/86345adf21e-5721-476a-8643-609b4a863"
}
}
<?
// The payload from the k2-connect-php SDK will look like this.
[
"status" => "success",
"data" => [
"id" => "cac95329-9fa5-42f1-a4fc-c08af7b868fb",
"topic" => "buygoods_transaction_reversed",
"created_at" => "2018-06-20T22:45:12.790Z",
"eventType" =>"Buygoods Transaction",
"resourceId" => "52f86f-f2aa-4d70-baa2-ccfe4b78f4fc",
"status" => "Received",
"reference" => '123456789',
"originationTime" => "2017-01-20T22:45:12.790Z",
"senderPhoneNumber" => "+2549703119050",
"amount" => 20000,
"currency" => "KES",
"tillNumber" => "000000",
"system" => "Lipa Na M-PESA",
"senderFirstName" => "John",
"senderMiddleName" => "O",
"senderLastName" => "Doe",
"linkSelf" => "https://sandbox.kopokopo.com/webhook_events/cac95329-9fa5-42f1-a4fc-c08af7b868fb",
"linkResource" => "https://sandbox.kopokopo.com/financial_transaction/458712f-gr76y-24b9-40fc-ae57-2d35785760",
]
]
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Notifies your application when a Buygoods Transaction has been reversed
Buygoods Transaction Reversed Webhook Parameters (JSON)
Parameters contained in a buygoods_transaction_reversed webhook;
| Parameter | Type | Description |
|---|---|---|
| id | String | The ID of the Webhook Event |
| topic | String | The topic of the webhook. buygoods_transaction_reversed in this instance. |
| created_at | String | The timestamp of when the webhook event was created. |
| _links | JSON | A JSON object containing links to the Webhook Event and the corresponding Buygoods Transaction resource |
Event JSON
| Parameter | Type | Description |
|---|---|---|
| type | String | The type of transaction (Buygoods Transaction) |
| resource | JSON | The resource corresponding to the event. In this case this is a Buygoods Transaction |
Resource (Buygoods Transaction) JSON
| Parameter | Type | Description |
|---|---|---|
| id | String | The api reference of the transaction |
| reference | String | The mpesa reference |
| status | String | The status of the transaction |
| origination_time | String | The transaction timestamp |
| sender_phone_number | String | The phone number that sent the payment |
| amount | Float | The amount of the transaction |
| currency | String | Currency |
| till_number | String | The till number to which the payment was made |
| system | String | The mobile money system |
| sender_first_name | String | First name of payer |
| sender_middle_name | String | Middle name of payer |
| sender_last_name | String | Last name of payer |
B2B Transaction Reversed
POST https://www.your-application.com/payments/webhook
Content-Type: application/json
User-Agent: < product >/< product-version > < comment >
X-KopoKopo-Signature: a5d74a17a55554edc4e9999c59e460c61aa7f81a
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"topic": "b2b_transaction_reversed",
"id": "98adf21e-5721-476a-8643-609b4a6513a2",
"created_at": "2020-10-29T08:06:49+03:00",
"event": {
"type": "External Till To Till Reversal Transaction",
"resource": {
"id": "86345adf21e-5721-476a-8643-609b4a863",
"reference": "OJM6Q1W84K",
"origination_time": "2020-10-29T08:06:49+03:00",
"sending_till": "Sending till",
"amount": "233",
"currency": "KES",
"till_number": "000000",
"system": "M-PESA",
"status": "Reversed"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/98adf21e-5721-476a-8643-609b4a6513a2",
"resource": "https://sandbox.kopokopo.com/financial_transaction/86345adf21e-5721-476a-8643-609b4a863"
}
}
{
"topic": "b2b_transaction_reversed",
"id": "98adf21e-5721-476a-8643-609b4a6513a2",
"created_at": "2020-10-29T08:06:49+03:00",
"event": {
"type": "External Till To Till Reversal Transaction",
"resource": {
"id": "86345adf21e-5721-476a-8643-609b4a863",
"reference": "OJM6Q1W84K",
"origination_time": "2020-10-29T08:06:49+03:00",
"sending_till": "Sending till",
"amount": "233",
"currency": "KES",
"till_number": "000000",
"system": "M-PESA",
"status": "Reversed"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/98adf21e-5721-476a-8643-609b4a6513a2",
"resource": "https://sandbox.kopokopo.com/financial_transaction/86345adf21e-5721-476a-8643-609b4a863"
}
}
{
"topic": "b2b_transaction_reversed",
"id": "98adf21e-5721-476a-8643-609b4a6513a2",
"created_at": "2020-10-29T08:06:49+03:00",
"event": {
"type": "External Till To Till Reversal Transaction",
"resource": {
"id": "86345adf21e-5721-476a-8643-609b4a863",
"reference": "OJM6Q1W84K",
"origination_time": "2020-10-29T08:06:49+03:00",
"sending_till": "Sending till",
"amount": "233",
"currency": "KES",
"till_number": "000000",
"system": "M-PESA",
"status": "Reversed"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/98adf21e-5721-476a-8643-609b4a6513a2",
"resource": "https://sandbox.kopokopo.com/financial_transaction/86345adf21e-5721-476a-8643-609b4a863"
}
}
{
"topic": "b2b_transaction_reversed",
"id": "98adf21e-5721-476a-8643-609b4a6513a2",
"created_at": "2020-10-29T08:06:49+03:00",
"event": {
"type": "External Till To Till Reversal Transaction",
"resource": {
"id": "86345adf21e-5721-476a-8643-609b4a863",
"reference": "OJM6Q1W84K",
"origination_time": "2020-10-29T08:06:49+03:00",
"sending_till": "Sending till",
"amount": "233",
"currency": "KES",
"till_number": "000000",
"system": "M-PESA",
"status": "Reversed"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/98adf21e-5721-476a-8643-609b4a6513a2",
"resource": "https://sandbox.kopokopo.com/financial_transaction/86345adf21e-5721-476a-8643-609b4a863"
}
}
<?
// The payload from the k2-connect-php SDK will look like this.
[
"status" => "success",
"data" => [
"id" => "cac95329-9fa5-42f1-a4fc-c08af7b868fb",
"topic" => "b2b_transaction_reversed",
"created_at" => "2018-06-20T22:45:12.790Z",
"eventType" =>"External Till To Till Reversal Transaction",
"resourceId" => "52f86f-f2aa-4d70-baa2-ccfe4b78f4fc",
"reference" => "OJM6Q1W84K",
"origination_time" => "2020-10-29T08:06:49+03:00",
"sending_till" => "Sending till",
"amount" => "233",
"currency" => "KES",
"till_number" => "000000",
"system" => "M-PESA",
"status" => "Reversed"
"linkSelf" => "https://sandbox.kopokopo.com/webhook_events/cac95329-9fa5-42f1-a4fc-c08af7b868fb",
"linkResource" => "https://sandbox.kopokopo.com/financial_transaction/458712f-gr76y-24b9-40fc-ae57-2d35785760",
]
]
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Notifies your application when a B2B Transaction has been reversed
B2B Transaction Reversed Webhook Parameters (JSON)
Parameters contained in a b2b_transaction_reversed webhook;
| Parameter | Type | Description |
|---|---|---|
| id | String | The ID of the Webhook Event |
| topic | String | The topic of the webhook. b2b_transaction_reversed in this instance. |
| created_at | String | The timestamp of when the webhook event was created. |
| _links | JSON | A JSON object containing links to the Webhook Event and the corresponding Buygoods Transaction resource |
Event JSON
| Parameter | Type | Description |
|---|---|---|
| type | String | The type of transaction (External Till To Till Reversal Transaction) |
| resource | JSON | The resource corresponding to the event. In this case this is a B2B Transaction Reversal |
Resource (Buygoods Transaction) JSON
| Parameter | Type | Description |
|---|---|---|
| id | String | The api reference of the transaction |
| reference | String | The mpesa reference |
| status | String | The status of the transaction |
| origination_time | String | The transaction timestamp |
| sending_till | String | The till number that sent the payment |
| amount | Float | The amount of the transaction |
| currency | String | Currency |
| till_number | String | The till number to which the payment was made |
| system | String | The mobile money system |
Settlement Transfer Completed
POST https://www.your-application.com/settlement_transfers/webhook
Content-Type: application/json
User-Agent: < product >/< product-version > < comment >
X-KopoKopo-Signature: a5d74a17a55554edc4e9999c59e460c61aa7f81a
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"topic": "settlement_transfer_completed",
"id": "052b7b2a-745b-4ca1-866b-b92d4a1418c3",
"created_at": "2021-01-27T11:00:08+03:00",
"event": {
"type": "Settlement Transfer",
"resource": {
"id": "270b7b2a-745b-6735752-b92d4a141847-5d33",
"amount": "49452.0",
"status": "Transferred",
"currency": "KES",
"destination": {
"type": "Bank Account",
"resource": {
"reference": "34a273d1-fedc-4610-8ab6-a1ba4828f317",
"account_name": "Test Account",
"account_number": "1234",
"bank_branch_ref": "ea2e79f7-35a1-486e-9e18-fe06589a9d7d",
"settlement_method": "EFT"
}
},
"disbursements": [
{
"amount": "24452.0",
"status": "Transferred",
"origination_time": "2021-01-27T10:57:58.623+03:00",
"transaction_reference": null
},
{
"amount": "25000.0",
"status": "Transferred",
"origination_time": "2021-01-27T10:57:58.627+03:00",
"transaction_reference": null
}
],
"origination_time": "2021-01-27T10:57:58.444+03:00"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/052b7b2a-745b-4ca1-866b-b92d4a1418c3",
"resource": "https://sandbox.kopokopo.com/transfer_batch/270b7b2a-745b-6735752-b92d4a141847-5d33"
}
}
{
"topic": "settlement_transfer_completed",
"id": "052b7b2a-745b-4ca1-866b-b92d4a1418c3",
"created_at": "2021-01-27T11:00:08+03:00",
"event": {
"type": "Settlement Transfer",
"resource": {
"id": "270b7b2a-745b-6735752-b92d4a141847-5d33",
"amount": "49452.0",
"status": "Transferred",
"currency": "KES",
"destination": {
"type": "Bank Account",
"resource": {
"reference": "34a273d1-fedc-4610-8ab6-a1ba4828f317",
"account_name": "Test Account",
"account_number": "1234",
"bank_branch_ref": "ea2e79f7-35a1-486e-9e18-fe06589a9d7d",
"settlement_method": "EFT"
}
},
"disbursements": [
{
"amount": "24452.0",
"status": "Transferred",
"origination_time": "2021-01-27T10:57:58.623+03:00",
"transaction_reference": null
},
{
"amount": "25000.0",
"status": "Transferred",
"origination_time": "2021-01-27T10:57:58.627+03:00",
"transaction_reference": null
}
],
"origination_time": "2021-01-27T10:57:58.444+03:00"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/052b7b2a-745b-4ca1-866b-b92d4a1418c3",
"resource": "https://sandbox.kopokopo.com/transfer_batch/270b7b2a-745b-6735752-b92d4a141847-5d33"
}
}
{
"topic": "settlement_transfer_completed",
"id": "052b7b2a-745b-4ca1-866b-b92d4a1418c3",
"created_at": "2021-01-27T11:00:08+03:00",
"event": {
"type": "Settlement Transfer",
"resource": {
"id": "270b7b2a-745b-6735752-b92d4a141847-5d33",
"amount": "49452.0",
"status": "Transferred",
"currency": "KES",
"destination": {
"type": "Bank Account",
"resource": {
"reference": "34a273d1-fedc-4610-8ab6-a1ba4828f317",
"account_name": "Test Account",
"account_number": "1234",
"bank_branch_ref": "ea2e79f7-35a1-486e-9e18-fe06589a9d7d",
"settlement_method": "EFT"
}
},
"disbursements": [
{
"amount": "24452.0",
"status": "Transferred",
"origination_time": "2021-01-27T10:57:58.623+03:00",
"transaction_reference": null
},
{
"amount": "25000.0",
"status": "Transferred",
"origination_time": "2021-01-27T10:57:58.627+03:00",
"transaction_reference": null
}
],
"origination_time": "2021-01-27T10:57:58.444+03:00"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/052b7b2a-745b-4ca1-866b-b92d4a1418c3",
"resource": "https://sandbox.kopokopo.com/transfer_batch/270b7b2a-745b-6735752-b92d4a141847-5d33"
}
}
{
"topic": "settlement_transfer_completed",
"id": "052b7b2a-745b-4ca1-866b-b92d4a1418c3",
"created_at": "2021-01-27T11:00:08+03:00",
"event": {
"type": "Settlement Transfer",
"resource": {
"id": "270b7b2a-745b-6735752-b92d4a141847-5d33",
"amount": "49452.0",
"status": "Transferred",
"currency": "KES",
"destination": {
"type": "Bank Account",
"resource": {
"reference": "34a273d1-fedc-4610-8ab6-a1ba4828f317",
"account_name": "Test Account",
"account_number": "1234",
"bank_branch_ref": "ea2e79f7-35a1-486e-9e18-fe06589a9d7d",
"settlement_method": "EFT"
}
},
"disbursements": [
{
"amount": "24452.0",
"status": "Transferred",
"origination_time": "2021-01-27T10:57:58.623+03:00",
"transaction_reference": null
},
{
"amount": "25000.0",
"status": "Transferred",
"origination_time": "2021-01-27T10:57:58.627+03:00",
"transaction_reference": null
}
],
"origination_time": "2021-01-27T10:57:58.444+03:00"
}
},
"_links": {
"self": "https://sandbox.kopokopo.com/webhook_events/052b7b2a-745b-4ca1-866b-b92d4a1418c3",
"resource": "https://sandbox.kopokopo.com/transfer_batch/270b7b2a-745b-6735752-b92d4a141847-5d33"
}
}
<?
// The payload from the k2-connect-php SDK will look like this.
[
"status" => "success",
"data" => [
"topic" => "settlement_transfer_completed",
"id" => "a25cc04b-e503-44e8-a002-05ff2fc3297b",
"eventType" => "Settlement Transfer",
"resourceId" => "48674c51-2546-4844-adc8-d1a267fcbc58",
"createdAt" => "2020-11-02T09:47:03+03:00",
"originationTime" => "2026-05-01T12:57:38.272+03:00",
"amount" => "786",
"currency" => "KES",
"status" => "Transferred",
"destinationType" => "Bank Account",
"destinationReference" => "34a273d1-fedc-4610-8ab6-a1ba4828f317",
"accountName" => "Test Account",
"accountNumber" => "1234",
"bankBranchRef" => "ea2e79f7-35a1-486e-9e18-fe06589a9d7d",
"settlementMethod" => "EFT",
"disbursements" => [
[
"amount" => "24452.0",
"status" => "Transferred",
"origination_time" => "2021-01-27T10:57:58.623+03:00",
"transaction_reference" => null
],
[
"amount" => "25000.0",
"status" => "Transferred",
"origination_time" => "2021-01-27T10:57:58.627+03:00",
"transaction_reference" => null
]
],
"linkSelf" => "https://sandbox.kopokopo.com/webhook_events/a25cc04b-e503-44e8-a002-05ff2fc3297b",
"linkResource" => "https://sandbox.kopokopo.com/transfer_batch/48674c51-2546-4844-adc8-d1a267fcbc58"
]
]
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Settlement Transfer Completed Webhook Parameters (JSON)
Parameters contained in a settlement_transfer_completed webhook;
| Parameter | Type | Description |
|---|---|---|
| id | String | The ID of the Webhook Event |
| topic | String | The topic of the webhook. settlement_transfer_completed in this instance. |
| created_at | String | The timestamp of when the webhook event was created. |
| _links | JSON | A JSON object containing links to the Webhook Event and the corresponding Transfer Batch resource |
Event JSON
| Parameter | Type | Description |
|---|---|---|
| type | String | The type of transaction (Settlement Transfer) |
| resource | JSON | The resource corresponding to the event. In this case this is a Settlement Transfer |
Resource (Buygoods Transaction) JSON
| Parameter | Type | Description |
|---|---|---|
| id | String | The api reference of the transaction |
| status | String | The status of the transaction |
| amount | Float | The total amount of the transaction |
| currency | String | Currency |
| destination | JSON | The destination of the settlement transfer |
| disbursements | JSON | These are the disbursements in that particular transfer batch |
Destination JSON
| Parameter | Type | Description |
|---|---|---|
| type | String | The destination type |
| resource | JSON | The destination resource |
Destination Resource (Mobile Wallet) JSON
| Parameter | Type | Description |
|---|---|---|
| reference | String | The destination reference |
| first_name | String | First name of the recipient |
| last_name | String | Last name of recipient |
| String | Email of recipient | |
| phone_number | String | Phone number |
| network | String | The mobile network to which the phone number belongs |
Destination Resource (Bank Account) JSON
| Parameter | Type | Description |
|---|---|---|
| reference | String | The destination reference |
| account_name | String | The name as indicated on the bank account |
| bank_branch_ref | String | An identifier identifying the destination bank branch |
| account_number | String | The bank account number. Details on bank account number validation rules are here |
| settlement_method | String | EFT or RTS |
Disbursements JSON(Could be multiple)
| Parameter | Type | Description |
|---|---|---|
| status | String | The status of the disbursement |
| amount | String | The amount of the disbursement |
| origination_time | String | Timestamp of when the transaction took place |
| transaction_reference | String | The reference from the transaction. i.e mpesa reference It is null for eft transactions |
Card Transaction Received
POST https://www.your-application.com/customers/webhook
Content-Type: application/json
User-Agent: < product >/< product-version > < comment >
X-KopoKopo-Signature: a5d74a17a55554edc4e9999c59e460c61aa7f81a
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"topic": "card_transaction_received",
"id": "4b981325-abf8-4f6e-ba2c-f1bf682687ca",
"created_at": "2025-06-19T15:18:03+03:00",
"event": {
"type": "Card Transaction",
"resource": {
"id": "00f5311d-8b93-433f-987e-08278a64e1a9",
"amount": "1000.0",
"status": "Received",
"system": "LittlePay",
"settled": false,
"currency": "KES",
"reference": "PENDINGCARD-1750335484",
"till_number": "7600314301",
"origination_time": "2025-06-19T15:18:03+03:00",
"customer_cc_number": "450875XXXXXX1019"
}
},
"_links": {
"self": "https://api.kopokopo.com/webhook_events/4b981325-abf8-4f6e-ba2c-f1bf682687ca",
"resource": "https://api.kopokopo.com/financial_transaction/00f5311d-8b93-433f-987e-08278a64e1a9"
}
}
Pending
Pending
Pending
Pending
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Notifies your application when a Card Transaction has been received.
Card Transaction Received Webhook Parameters (JSON)
Parameters contained in a card_transaction_received webhook;
| Parameter | Type | Description |
|---|---|---|
| id | String | The ID of the Webhook Event |
| topic | String | The topic of the webhook. card_transaction_received in this instance. |
| created_at | String | The timestamp of when the webhook event was created. |
| _links | JSON | A JSON object containing links to the Webhook Event and the corresponding Card Transaction resource |
Event JSON
| Parameter | Type | Description |
|---|---|---|
| type | String | The type of transaction (Card Transaction) |
| resource | JSON | The resource corresponding to the event. In this case this is a Card Transaction |
Resource (Card Transaction) JSON
| Parameter | Type | Description |
|---|---|---|
| id | String | The api reference of the transaction |
| reference | String | The card transaction reference |
| status | String | The status of the transaction |
| origination_time | String | The transaction timestamp |
| customer_cc_number | String | The customer's card number that sent the payment |
| amount | Float | The amount of the transaction |
| currency | String | Currency |
| till_number | String | The till number/terminal to which the payment was made |
| system | String | The card system |
| settled | String | Flag indicating whether or not the card payment was settled |
Processing of card_transaction_received webhooks are to be integrated into K2Connect SDKs in the near future.
Card Transaction Voided
POST https://www.your-application.com/customers/webhook
Content-Type: application/json
User-Agent: < product >/< product-version > < comment >
X-KopoKopo-Signature: a5d74a17a55554edc4e9999c59e460c61aa7f81a
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"topic": "card_transaction_voided",
"id": "4b981325-abf8-4f6e-ba2c-f1bf682687ca",
"created_at": "2025-06-19T15:18:03+03:00",
"event": {
"type": "Card Void Transaction",
"resource": {
"id": "00f5311d-8b93-433f-987e-08278a64e1a9",
"amount": "1000.0",
"status": "Complete",
"system": "LittlePay",
"currency": "KES",
"reference": "PENDINGCARD-1750335484",
"till_number": "7600314301",
"origination_time": "2025-06-19T15:18:03+03:00",
"customer_cc_number": "450875XXXXXX1019"
}
},
"_links": {
"self": "https://api.kopokopo.com/webhook_events/4b981325-abf8-4f6e-ba2c-f1bf682687ca",
"resource": "https://api.kopokopo.com/financial_transaction/00f5311d-8b93-433f-987e-08278a64e1a9"
}
}
Pending
Pending
Pending
Pending
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Notifies your application when a Card Transaction has been voided.
Card Void Transaction Webhook Parameters (JSON)
Parameters contained in a card_transaction_voided webhook;
| Parameter | Type | Description |
|---|---|---|
| id | String | The ID of the Webhook Event |
| topic | String | The topic of the webhook. card_transaction_voided in this instance. |
| created_at | String | The timestamp of when the webhook event was created. |
| _links | JSON | A JSON object containing links to the Webhook Event and the corresponding Card Void Transaction resource |
Event JSON
| Parameter | Type | Description |
|---|---|---|
| type | String | The type of transaction (Card Void Transaction) |
| resource | JSON | The resource corresponding to the event. In this case this is a Card Void Transaction |
Resource (Card Void Transaction) JSON
| Parameter | Type | Description |
|---|---|---|
| id | String | The api reference of the transaction |
| reference | String | The card transaction reference |
| status | String | The status of the transaction |
| origination_time | String | The transaction timestamp |
| customer_cc_number | String | The customer's card number that sent the original payment |
| amount | Float | The amount of the transaction |
| currency | String | Currency |
| till_number | String | The till number/terminal to which the original payment was made |
| system | String | The card system |
Processing of card_transaction_voided webhooks are to be integrated into K2Connect SDKs in the near future.
Card Transaction Reversed
POST https://www.your-application.com/customers/webhook
Content-Type: application/json
User-Agent: < product >/< product-version > < comment >
X-KopoKopo-Signature: a5d74a17a55554edc4e9999c59e460c61aa7f81a
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"topic": "card_transaction_reversed",
"id": "4b981325-abf8-4f6e-ba2c-f1bf682687ca",
"created_at": "2025-06-19T15:18:03+03:00",
"event": {
"type": "Card Reversal Transaction",
"resource": {
"id": "00f5311d-8b93-433f-987e-08278a64e1a9",
"amount": "1000.0",
"status": "Complete",
"system": "LittlePay",
"currency": "KES",
"reference": "PENDINGCARD-1750335484",
"till_number": "7600314301",
"origination_time": "2025-06-19T15:18:03+03:00",
"customer_cc_number": "450875XXXXXX1019"
}
},
"_links": {
"self": "https://api.kopokopo.com/webhook_events/4b981325-abf8-4f6e-ba2c-f1bf682687ca",
"resource": "https://api.kopokopo.com/financial_transaction/00f5311d-8b93-433f-987e-08278a64e1a9"
}
}
Pending
Pending
Pending
Pending
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Notifies your application when a Card Transaction has been reversed.
Card Reversal Transaction Webhook Parameters (JSON)
Parameters contained in a card_transaction_reversed webhook;
| Parameter | Type | Description |
|---|---|---|
| id | String | The ID of the Webhook Event |
| topic | String | The topic of the webhook. card_transaction_reversed in this instance. |
| created_at | String | The timestamp of when the webhook event was created. |
| _links | JSON | A JSON object containing links to the Webhook Event and the corresponding Card Reversal Transaction resource |
Event JSON
| Parameter | Type | Description |
|---|---|---|
| type | String | The type of transaction (Card Reversal Transaction) |
| resource | JSON | The resource corresponding to the event. In this case this is a Card Reversal Transaction |
Resource (Card Reversal Transaction) JSON
| Parameter | Type | Description |
|---|---|---|
| id | String | The api reference of the transaction |
| reference | String | The card transaction reference |
| status | String | The status of the transaction |
| origination_time | String | The transaction timestamp |
| customer_cc_number | String | The customer's card number that had sent the original payment |
| amount | Float | The amount of the transaction |
| currency | String | Currency |
| till_number | String | The till number/terminal to which the original payment was made |
| system | String | The card system |
Processing of card_transaction_reversed webhooks are to be integrated into K2Connect SDKs in the near future.