> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://apidocs.sare.africa/sare-core-api/waas/choice-bank-notification-callback-0003-balance-change-example/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.sare.africa/_mcp/server. # Choice Bank Notification Callback (0003 Balance Change example) POST http://localhost:8080/api/v3/waas/callbacks/choicebaas Content-Type: application/json Public (waas/callbacks/choicebaas whitelisted) - inbound webhook from Choice Bank. Authenticated via a `signature`/`salt` pair EMBEDDED IN THE JSON BODY (verified against the canonicalized payload), not an HTTP header. `notificationType` dispatches to a different `params` shape: 0001 PERSONAL_ONBOARDING_RESULT, 0002 TRANSACTION_RESULT, 0003 BALANCE_CHANGE (shown here), 0005 UPGRADE_WALLET_TO_CURRENT_ACCOUNT, 0006 SME_ONBOARDING_RESULT, 0021 ACCOUNT_STATUS_CHANGE, 0022 MERCHANT_BALANCE_CHANGE (same shape as 0003, for B002 merchant accounts). Reference: https://apidocs.sare.africa/sare-core-api/waas/choice-bank-notification-callback-0003-balance-change-example ## Request ### Body (application/json) This endpoint expects an object. - `requestId` (string, optional) - `sender` (string, optional) - `notificationType` (string, optional) - `locale` (string, optional) - `timestamp` (integer, optional) - `salt` (string, optional) - `signature` (string, optional) - `params` (WaasCallbacksChoicebaasPostRequestBodyContentApplicationJsonSchemaParams, optional) ## Response ### 200 200 OK - acknowledged ## Types ### WaasCallbacksChoicebaasPostRequestBodyContentApplicationJsonSchemaParams - `txId` (string, optional) - `externalTxId` (string, optional) - `userId` (string, optional) - `accountId` (string, optional) - `accountName` (string, optional) - `txType` (string, optional) - `oppoBankCode` (string, optional) - `oppoBankName` (string, optional) - `paymentChannel` (string, optional) - `oppoAccountId` (string, optional) - `oppoAccountName` (string, optional) - `oppoSubAccount` (any, optional) - `mpesaBusinessPayType` (integer, optional) - `thirdPartyTxType` (string, optional) - `currency` (string, optional) - `amount` (string, optional) - `feeAmount` (string, optional) - `balance` (string, optional) - `completeTime` (integer, optional) - `extInfo` (WaasCallbacksChoicebaasPostRequestBodyContentApplicationJsonSchemaParamsExtInfo, optional) ### WaasCallbacksChoicebaasPostRequestBodyContentApplicationJsonSchemaParamsExtInfo - `transactionNarrative` (string, optional) - `oppoPhoneNumber` (string, optional) - `counterpartyName` (string, optional) ## Examples **Request** ```json { "requestId": "req-abc123", "sender": "choice-baas", "notificationType": "0003", "locale": "en", "timestamp": 1758100000000, "salt": "a1b2c3d4e5f6...", "signature": "base64-signature-over-canonicalized-payload", "params": { "txId": "TX123", "externalTxId": "MPESA-XYZ", "userId": "f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f", "accountId": "46012000068891", "accountName": "Sare Shop", "txType": "01", "oppoBankCode": "M-PESA", "oppoBankName": "M-PESA", "paymentChannel": "MPESA", "oppoAccountId": "254712345678", "oppoAccountName": "Jane Doe", "mpesaBusinessPayType": 0, "thirdPartyTxType": "Pay Bill", "currency": "KES", "amount": "500.00", "feeAmount": "0.00", "balance": "1250.50", "completeTime": 1758100000000, "extInfo": { "transactionNarrative": "Payment", "oppoPhoneNumber": "254712345678", "counterpartyName": "Jane Doe" } } } ``` **Response** ```json {} ``` **SDK Code** ```python Waas_choiceBankNotificationCallback0003BalanceChangeExample_example import requests url = "http://localhost:8080/api/v3/waas/callbacks/choicebaas" payload = { "requestId": "req-abc123", "sender": "choice-baas", "notificationType": "0003", "locale": "en", "timestamp": 1758100000000, "salt": "a1b2c3d4e5f6...", "signature": "base64-signature-over-canonicalized-payload", "params": { "txId": "TX123", "externalTxId": "MPESA-XYZ", "userId": "f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f", "accountId": "46012000068891", "accountName": "Sare Shop", "txType": "01", "oppoBankCode": "M-PESA", "oppoBankName": "M-PESA", "paymentChannel": "MPESA", "oppoAccountId": "254712345678", "oppoAccountName": "Jane Doe", "mpesaBusinessPayType": 0, "thirdPartyTxType": "Pay Bill", "currency": "KES", "amount": "500.00", "feeAmount": "0.00", "balance": "1250.50", "completeTime": 1758100000000, "extInfo": { "transactionNarrative": "Payment", "oppoPhoneNumber": "254712345678", "counterpartyName": "Jane Doe" } } } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Waas_choiceBankNotificationCallback0003BalanceChangeExample_example const url = 'http://localhost:8080/api/v3/waas/callbacks/choicebaas'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"requestId":"req-abc123","sender":"choice-baas","notificationType":"0003","locale":"en","timestamp":1758100000000,"salt":"a1b2c3d4e5f6...","signature":"base64-signature-over-canonicalized-payload","params":{"txId":"TX123","externalTxId":"MPESA-XYZ","userId":"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f","accountId":"46012000068891","accountName":"Sare Shop","txType":"01","oppoBankCode":"M-PESA","oppoBankName":"M-PESA","paymentChannel":"MPESA","oppoAccountId":"254712345678","oppoAccountName":"Jane Doe","mpesaBusinessPayType":0,"thirdPartyTxType":"Pay Bill","currency":"KES","amount":"500.00","feeAmount":"0.00","balance":"1250.50","completeTime":1758100000000,"extInfo":{"transactionNarrative":"Payment","oppoPhoneNumber":"254712345678","counterpartyName":"Jane Doe"}}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Waas_choiceBankNotificationCallback0003BalanceChangeExample_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "http://localhost:8080/api/v3/waas/callbacks/choicebaas" payload := strings.NewReader("{\n \"requestId\": \"req-abc123\",\n \"sender\": \"choice-baas\",\n \"notificationType\": \"0003\",\n \"locale\": \"en\",\n \"timestamp\": 1758100000000,\n \"salt\": \"a1b2c3d4e5f6...\",\n \"signature\": \"base64-signature-over-canonicalized-payload\",\n \"params\": {\n \"txId\": \"TX123\",\n \"externalTxId\": \"MPESA-XYZ\",\n \"userId\": \"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f\",\n \"accountId\": \"46012000068891\",\n \"accountName\": \"Sare Shop\",\n \"txType\": \"01\",\n \"oppoBankCode\": \"M-PESA\",\n \"oppoBankName\": \"M-PESA\",\n \"paymentChannel\": \"MPESA\",\n \"oppoAccountId\": \"254712345678\",\n \"oppoAccountName\": \"Jane Doe\",\n \"mpesaBusinessPayType\": 0,\n \"thirdPartyTxType\": \"Pay Bill\",\n \"currency\": \"KES\",\n \"amount\": \"500.00\",\n \"feeAmount\": \"0.00\",\n \"balance\": \"1250.50\",\n \"completeTime\": 1758100000000,\n \"extInfo\": {\n \"transactionNarrative\": \"Payment\",\n \"oppoPhoneNumber\": \"254712345678\",\n \"counterpartyName\": \"Jane Doe\"\n }\n }\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(res) fmt.Println(string(body)) } ``` ```ruby Waas_choiceBankNotificationCallback0003BalanceChangeExample_example require 'uri' require 'net/http' url = URI("http://localhost:8080/api/v3/waas/callbacks/choicebaas") http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"requestId\": \"req-abc123\",\n \"sender\": \"choice-baas\",\n \"notificationType\": \"0003\",\n \"locale\": \"en\",\n \"timestamp\": 1758100000000,\n \"salt\": \"a1b2c3d4e5f6...\",\n \"signature\": \"base64-signature-over-canonicalized-payload\",\n \"params\": {\n \"txId\": \"TX123\",\n \"externalTxId\": \"MPESA-XYZ\",\n \"userId\": \"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f\",\n \"accountId\": \"46012000068891\",\n \"accountName\": \"Sare Shop\",\n \"txType\": \"01\",\n \"oppoBankCode\": \"M-PESA\",\n \"oppoBankName\": \"M-PESA\",\n \"paymentChannel\": \"MPESA\",\n \"oppoAccountId\": \"254712345678\",\n \"oppoAccountName\": \"Jane Doe\",\n \"mpesaBusinessPayType\": 0,\n \"thirdPartyTxType\": \"Pay Bill\",\n \"currency\": \"KES\",\n \"amount\": \"500.00\",\n \"feeAmount\": \"0.00\",\n \"balance\": \"1250.50\",\n \"completeTime\": 1758100000000,\n \"extInfo\": {\n \"transactionNarrative\": \"Payment\",\n \"oppoPhoneNumber\": \"254712345678\",\n \"counterpartyName\": \"Jane Doe\"\n }\n }\n}" response = http.request(request) puts response.read_body ``` ```java Waas_choiceBankNotificationCallback0003BalanceChangeExample_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("http://localhost:8080/api/v3/waas/callbacks/choicebaas") .header("Content-Type", "application/json") .body("{\n \"requestId\": \"req-abc123\",\n \"sender\": \"choice-baas\",\n \"notificationType\": \"0003\",\n \"locale\": \"en\",\n \"timestamp\": 1758100000000,\n \"salt\": \"a1b2c3d4e5f6...\",\n \"signature\": \"base64-signature-over-canonicalized-payload\",\n \"params\": {\n \"txId\": \"TX123\",\n \"externalTxId\": \"MPESA-XYZ\",\n \"userId\": \"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f\",\n \"accountId\": \"46012000068891\",\n \"accountName\": \"Sare Shop\",\n \"txType\": \"01\",\n \"oppoBankCode\": \"M-PESA\",\n \"oppoBankName\": \"M-PESA\",\n \"paymentChannel\": \"MPESA\",\n \"oppoAccountId\": \"254712345678\",\n \"oppoAccountName\": \"Jane Doe\",\n \"mpesaBusinessPayType\": 0,\n \"thirdPartyTxType\": \"Pay Bill\",\n \"currency\": \"KES\",\n \"amount\": \"500.00\",\n \"feeAmount\": \"0.00\",\n \"balance\": \"1250.50\",\n \"completeTime\": 1758100000000,\n \"extInfo\": {\n \"transactionNarrative\": \"Payment\",\n \"oppoPhoneNumber\": \"254712345678\",\n \"counterpartyName\": \"Jane Doe\"\n }\n }\n}") .asString(); ``` ```php Waas_choiceBankNotificationCallback0003BalanceChangeExample_example request('POST', 'http://localhost:8080/api/v3/waas/callbacks/choicebaas', [ 'body' => '{ "requestId": "req-abc123", "sender": "choice-baas", "notificationType": "0003", "locale": "en", "timestamp": 1758100000000, "salt": "a1b2c3d4e5f6...", "signature": "base64-signature-over-canonicalized-payload", "params": { "txId": "TX123", "externalTxId": "MPESA-XYZ", "userId": "f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f", "accountId": "46012000068891", "accountName": "Sare Shop", "txType": "01", "oppoBankCode": "M-PESA", "oppoBankName": "M-PESA", "paymentChannel": "MPESA", "oppoAccountId": "254712345678", "oppoAccountName": "Jane Doe", "mpesaBusinessPayType": 0, "thirdPartyTxType": "Pay Bill", "currency": "KES", "amount": "500.00", "feeAmount": "0.00", "balance": "1250.50", "completeTime": 1758100000000, "extInfo": { "transactionNarrative": "Payment", "oppoPhoneNumber": "254712345678", "counterpartyName": "Jane Doe" } } }', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Waas_choiceBankNotificationCallback0003BalanceChangeExample_example using RestSharp; var client = new RestClient("http://localhost:8080/api/v3/waas/callbacks/choicebaas"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"requestId\": \"req-abc123\",\n \"sender\": \"choice-baas\",\n \"notificationType\": \"0003\",\n \"locale\": \"en\",\n \"timestamp\": 1758100000000,\n \"salt\": \"a1b2c3d4e5f6...\",\n \"signature\": \"base64-signature-over-canonicalized-payload\",\n \"params\": {\n \"txId\": \"TX123\",\n \"externalTxId\": \"MPESA-XYZ\",\n \"userId\": \"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f\",\n \"accountId\": \"46012000068891\",\n \"accountName\": \"Sare Shop\",\n \"txType\": \"01\",\n \"oppoBankCode\": \"M-PESA\",\n \"oppoBankName\": \"M-PESA\",\n \"paymentChannel\": \"MPESA\",\n \"oppoAccountId\": \"254712345678\",\n \"oppoAccountName\": \"Jane Doe\",\n \"mpesaBusinessPayType\": 0,\n \"thirdPartyTxType\": \"Pay Bill\",\n \"currency\": \"KES\",\n \"amount\": \"500.00\",\n \"feeAmount\": \"0.00\",\n \"balance\": \"1250.50\",\n \"completeTime\": 1758100000000,\n \"extInfo\": {\n \"transactionNarrative\": \"Payment\",\n \"oppoPhoneNumber\": \"254712345678\",\n \"counterpartyName\": \"Jane Doe\"\n }\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Waas_choiceBankNotificationCallback0003BalanceChangeExample_example import Foundation let headers = ["Content-Type": "application/json"] let parameters = [ "requestId": "req-abc123", "sender": "choice-baas", "notificationType": "0003", "locale": "en", "timestamp": 1758100000000, "salt": "a1b2c3d4e5f6...", "signature": "base64-signature-over-canonicalized-payload", "params": [ "txId": "TX123", "externalTxId": "MPESA-XYZ", "userId": "f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f", "accountId": "46012000068891", "accountName": "Sare Shop", "txType": "01", "oppoBankCode": "M-PESA", "oppoBankName": "M-PESA", "paymentChannel": "MPESA", "oppoAccountId": "254712345678", "oppoAccountName": "Jane Doe", "mpesaBusinessPayType": 0, "thirdPartyTxType": "Pay Bill", "currency": "KES", "amount": "500.00", "feeAmount": "0.00", "balance": "1250.50", "completeTime": 1758100000000, "extInfo": [ "transactionNarrative": "Payment", "oppoPhoneNumber": "254712345678", "counterpartyName": "Jane Doe" ] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v3/waas/callbacks/choicebaas")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```