Mobile Money C2B Validation Callback (Public)
curl --request POST \
--url https://crypto.westminister.tech/api/v1/mpesa/c2b/validation \
--header 'Content-Type: application/json' \
--data '
{
"TransactionType": "Pay Bill",
"TransID": "QGH12345678",
"TransTime": "20260601120000",
"TransAmount": "5000.00",
"BusinessShortCode": "174379",
"BillRefNumber": "MERCHANT-ACME-001",
"MSISDN": "254712345678",
"FirstName": "John",
"LastName": "Doe"
}
'import requests
url = "https://crypto.westminister.tech/api/v1/mpesa/c2b/validation"
payload = {
"TransactionType": "Pay Bill",
"TransID": "QGH12345678",
"TransTime": "20260601120000",
"TransAmount": "5000.00",
"BusinessShortCode": "174379",
"BillRefNumber": "MERCHANT-ACME-001",
"MSISDN": "254712345678",
"FirstName": "John",
"LastName": "Doe"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
TransactionType: 'Pay Bill',
TransID: 'QGH12345678',
TransTime: '20260601120000',
TransAmount: '5000.00',
BusinessShortCode: '174379',
BillRefNumber: 'MERCHANT-ACME-001',
MSISDN: '254712345678',
FirstName: 'John',
LastName: 'Doe'
})
};
fetch('https://crypto.westminister.tech/api/v1/mpesa/c2b/validation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://crypto.westminister.tech/api/v1/mpesa/c2b/validation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'TransactionType' => 'Pay Bill',
'TransID' => 'QGH12345678',
'TransTime' => '20260601120000',
'TransAmount' => '5000.00',
'BusinessShortCode' => '174379',
'BillRefNumber' => 'MERCHANT-ACME-001',
'MSISDN' => '254712345678',
'FirstName' => 'John',
'LastName' => 'Doe'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://crypto.westminister.tech/api/v1/mpesa/c2b/validation"
payload := strings.NewReader("{\n \"TransactionType\": \"Pay Bill\",\n \"TransID\": \"QGH12345678\",\n \"TransTime\": \"20260601120000\",\n \"TransAmount\": \"5000.00\",\n \"BusinessShortCode\": \"174379\",\n \"BillRefNumber\": \"MERCHANT-ACME-001\",\n \"MSISDN\": \"254712345678\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://crypto.westminister.tech/api/v1/mpesa/c2b/validation")
.header("Content-Type", "application/json")
.body("{\n \"TransactionType\": \"Pay Bill\",\n \"TransID\": \"QGH12345678\",\n \"TransTime\": \"20260601120000\",\n \"TransAmount\": \"5000.00\",\n \"BusinessShortCode\": \"174379\",\n \"BillRefNumber\": \"MERCHANT-ACME-001\",\n \"MSISDN\": \"254712345678\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://crypto.westminister.tech/api/v1/mpesa/c2b/validation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"TransactionType\": \"Pay Bill\",\n \"TransID\": \"QGH12345678\",\n \"TransTime\": \"20260601120000\",\n \"TransAmount\": \"5000.00\",\n \"BusinessShortCode\": \"174379\",\n \"BillRefNumber\": \"MERCHANT-ACME-001\",\n \"MSISDN\": \"254712345678\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\"\n}"
response = http.request(request)
puts response.read_body{
"ResultCode": "0",
"ResultDesc": "Accepted"
}Mobile Money C2B
Mobile Money C2B Validation Callback (Public)
Register as ValidationURL in Safaricom Daraja for your pay bill/till.
Production URL: https://crypto.westminister.tech/api/v1/mpesa/c2b/validation
Validates BillRefNumber against merchant_c2b_accounts (create via POST /api/v1/auth/otc/c2b/accounts).
No Authorization header.
POST
/
api
/
v1
/
mpesa
/
c2b
/
validation
Mobile Money C2B Validation Callback (Public)
curl --request POST \
--url https://crypto.westminister.tech/api/v1/mpesa/c2b/validation \
--header 'Content-Type: application/json' \
--data '
{
"TransactionType": "Pay Bill",
"TransID": "QGH12345678",
"TransTime": "20260601120000",
"TransAmount": "5000.00",
"BusinessShortCode": "174379",
"BillRefNumber": "MERCHANT-ACME-001",
"MSISDN": "254712345678",
"FirstName": "John",
"LastName": "Doe"
}
'import requests
url = "https://crypto.westminister.tech/api/v1/mpesa/c2b/validation"
payload = {
"TransactionType": "Pay Bill",
"TransID": "QGH12345678",
"TransTime": "20260601120000",
"TransAmount": "5000.00",
"BusinessShortCode": "174379",
"BillRefNumber": "MERCHANT-ACME-001",
"MSISDN": "254712345678",
"FirstName": "John",
"LastName": "Doe"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
TransactionType: 'Pay Bill',
TransID: 'QGH12345678',
TransTime: '20260601120000',
TransAmount: '5000.00',
BusinessShortCode: '174379',
BillRefNumber: 'MERCHANT-ACME-001',
MSISDN: '254712345678',
FirstName: 'John',
LastName: 'Doe'
})
};
fetch('https://crypto.westminister.tech/api/v1/mpesa/c2b/validation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://crypto.westminister.tech/api/v1/mpesa/c2b/validation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'TransactionType' => 'Pay Bill',
'TransID' => 'QGH12345678',
'TransTime' => '20260601120000',
'TransAmount' => '5000.00',
'BusinessShortCode' => '174379',
'BillRefNumber' => 'MERCHANT-ACME-001',
'MSISDN' => '254712345678',
'FirstName' => 'John',
'LastName' => 'Doe'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://crypto.westminister.tech/api/v1/mpesa/c2b/validation"
payload := strings.NewReader("{\n \"TransactionType\": \"Pay Bill\",\n \"TransID\": \"QGH12345678\",\n \"TransTime\": \"20260601120000\",\n \"TransAmount\": \"5000.00\",\n \"BusinessShortCode\": \"174379\",\n \"BillRefNumber\": \"MERCHANT-ACME-001\",\n \"MSISDN\": \"254712345678\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://crypto.westminister.tech/api/v1/mpesa/c2b/validation")
.header("Content-Type", "application/json")
.body("{\n \"TransactionType\": \"Pay Bill\",\n \"TransID\": \"QGH12345678\",\n \"TransTime\": \"20260601120000\",\n \"TransAmount\": \"5000.00\",\n \"BusinessShortCode\": \"174379\",\n \"BillRefNumber\": \"MERCHANT-ACME-001\",\n \"MSISDN\": \"254712345678\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://crypto.westminister.tech/api/v1/mpesa/c2b/validation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"TransactionType\": \"Pay Bill\",\n \"TransID\": \"QGH12345678\",\n \"TransTime\": \"20260601120000\",\n \"TransAmount\": \"5000.00\",\n \"BusinessShortCode\": \"174379\",\n \"BillRefNumber\": \"MERCHANT-ACME-001\",\n \"MSISDN\": \"254712345678\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\"\n}"
response = http.request(request)
puts response.read_body{
"ResultCode": "0",
"ResultDesc": "Accepted"
}Body
application/json
Safaricom C2B validation/confirmation payload (Pay Bill/Buy Goods).
Example:
"Pay Bill"
Example:
"20260601120000"
Example:
"5000.00"
Must match merchant_c2b_accounts.account_reference
⌘I