> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.sare.africa/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-callback/choice-bank-notification-callback-0003-balance-change-example

## Request

### Body (application/json)

This endpoint expects an object.

- `salt` (string, required)
- `locale` (string, required)
- `params` (object, required)
  - `txId` (string, required)
  - `amount` (string, required)
  - `txType` (string, required)
  - `userId` (string, required)
  - `balance` (string, required)
  - `extInfo` (object, required)
    - `oppoPhoneNumber` (string, required)
    - `counterpartyName` (string, required)
    - `transactionNarrative` (string, required)
  - `currency` (string, required)
  - `accountId` (string, required)
  - `feeAmount` (string, required)
  - `accountName` (string, required)
  - `completeTime` (integer, required)
  - `externalTxId` (string, required)
  - `oppoBankCode` (string, required)
  - `oppoBankName` (string, required)
  - `oppoAccountId` (string, required)
  - `paymentChannel` (string, required)
  - `oppoAccountName` (string, required)
  - `thirdPartyTxType` (string, required)
  - `mpesaBusinessPayType` (integer, required)
  - `oppoSubAccount` (any, optional)
- `sender` (string, required)
- `requestId` (string, required)
- `signature` (string, required)
- `timestamp` (integer, required)
- `notificationType` (string, required)

## Response

### 200

OK

## Examples

**Request**

```json
{
  "salt": "a1b2c3d4e5f6...",
  "locale": "en",
  "params": {
    "txId": "TX123",
    "amount": "500.00",
    "txType": "01",
    "userId": "f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f",
    "balance": "1250.50",
    "extInfo": {
      "oppoPhoneNumber": "254712345678",
      "counterpartyName": "Jane Doe",
      "transactionNarrative": "Payment"
    },
    "currency": "KES",
    "accountId": "46012000068891",
    "feeAmount": "0.00",
    "accountName": "Sare Shop",
    "completeTime": 1758100000000,
    "externalTxId": "MPESA-XYZ",
    "oppoBankCode": "M-PESA",
    "oppoBankName": "M-PESA",
    "oppoAccountId": "254712345678",
    "paymentChannel": "MPESA",
    "oppoAccountName": "Jane Doe",
    "thirdPartyTxType": "Pay Bill",
    "mpesaBusinessPayType": 0
  },
  "sender": "choice-baas",
  "requestId": "req-abc123",
  "signature": "base64-signature-over-canonicalized-payload",
  "timestamp": 1758100000000,
  "notificationType": "0003"
}
```

**Response**

```json
"ok"
```

**SDK Code**

```python Waas_Choice Bank Callback_Choice Bank Notification Callback (0003 Balance Change example)_example
import requests

url = "http://localhost:8080/api/v3/waas/callbacks/choicebaas"

payload = {
    "salt": "a1b2c3d4e5f6...",
    "locale": "en",
    "params": {
        "txId": "TX123",
        "amount": "500.00",
        "txType": "01",
        "userId": "f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f",
        "balance": "1250.50",
        "extInfo": {
            "oppoPhoneNumber": "254712345678",
            "counterpartyName": "Jane Doe",
            "transactionNarrative": "Payment"
        },
        "currency": "KES",
        "accountId": "46012000068891",
        "feeAmount": "0.00",
        "accountName": "Sare Shop",
        "completeTime": 1758100000000,
        "externalTxId": "MPESA-XYZ",
        "oppoBankCode": "M-PESA",
        "oppoBankName": "M-PESA",
        "oppoAccountId": "254712345678",
        "paymentChannel": "MPESA",
        "oppoAccountName": "Jane Doe",
        "thirdPartyTxType": "Pay Bill",
        "mpesaBusinessPayType": 0
    },
    "sender": "choice-baas",
    "requestId": "req-abc123",
    "signature": "base64-signature-over-canonicalized-payload",
    "timestamp": 1758100000000,
    "notificationType": "0003"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Waas_Choice Bank Callback_Choice Bank Notification Callback (0003 Balance Change example)_example
const url = 'http://localhost:8080/api/v3/waas/callbacks/choicebaas';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"salt":"a1b2c3d4e5f6...","locale":"en","params":{"txId":"TX123","amount":"500.00","txType":"01","userId":"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f","balance":"1250.50","extInfo":{"oppoPhoneNumber":"254712345678","counterpartyName":"Jane Doe","transactionNarrative":"Payment"},"currency":"KES","accountId":"46012000068891","feeAmount":"0.00","accountName":"Sare Shop","completeTime":1758100000000,"externalTxId":"MPESA-XYZ","oppoBankCode":"M-PESA","oppoBankName":"M-PESA","oppoAccountId":"254712345678","paymentChannel":"MPESA","oppoAccountName":"Jane Doe","thirdPartyTxType":"Pay Bill","mpesaBusinessPayType":0},"sender":"choice-baas","requestId":"req-abc123","signature":"base64-signature-over-canonicalized-payload","timestamp":1758100000000,"notificationType":"0003"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Waas_Choice Bank Callback_Choice Bank Notification Callback (0003 Balance Change example)_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8080/api/v3/waas/callbacks/choicebaas"

	payload := strings.NewReader("{\n  \"salt\": \"a1b2c3d4e5f6...\",\n  \"locale\": \"en\",\n  \"params\": {\n    \"txId\": \"TX123\",\n    \"amount\": \"500.00\",\n    \"txType\": \"01\",\n    \"userId\": \"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f\",\n    \"balance\": \"1250.50\",\n    \"extInfo\": {\n      \"oppoPhoneNumber\": \"254712345678\",\n      \"counterpartyName\": \"Jane Doe\",\n      \"transactionNarrative\": \"Payment\"\n    },\n    \"currency\": \"KES\",\n    \"accountId\": \"46012000068891\",\n    \"feeAmount\": \"0.00\",\n    \"accountName\": \"Sare Shop\",\n    \"completeTime\": 1758100000000,\n    \"externalTxId\": \"MPESA-XYZ\",\n    \"oppoBankCode\": \"M-PESA\",\n    \"oppoBankName\": \"M-PESA\",\n    \"oppoAccountId\": \"254712345678\",\n    \"paymentChannel\": \"MPESA\",\n    \"oppoAccountName\": \"Jane Doe\",\n    \"thirdPartyTxType\": \"Pay Bill\",\n    \"mpesaBusinessPayType\": 0\n  },\n  \"sender\": \"choice-baas\",\n  \"requestId\": \"req-abc123\",\n  \"signature\": \"base64-signature-over-canonicalized-payload\",\n  \"timestamp\": 1758100000000,\n  \"notificationType\": \"0003\"\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_Choice Bank Callback_Choice Bank Notification Callback (0003 Balance Change example)_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  \"salt\": \"a1b2c3d4e5f6...\",\n  \"locale\": \"en\",\n  \"params\": {\n    \"txId\": \"TX123\",\n    \"amount\": \"500.00\",\n    \"txType\": \"01\",\n    \"userId\": \"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f\",\n    \"balance\": \"1250.50\",\n    \"extInfo\": {\n      \"oppoPhoneNumber\": \"254712345678\",\n      \"counterpartyName\": \"Jane Doe\",\n      \"transactionNarrative\": \"Payment\"\n    },\n    \"currency\": \"KES\",\n    \"accountId\": \"46012000068891\",\n    \"feeAmount\": \"0.00\",\n    \"accountName\": \"Sare Shop\",\n    \"completeTime\": 1758100000000,\n    \"externalTxId\": \"MPESA-XYZ\",\n    \"oppoBankCode\": \"M-PESA\",\n    \"oppoBankName\": \"M-PESA\",\n    \"oppoAccountId\": \"254712345678\",\n    \"paymentChannel\": \"MPESA\",\n    \"oppoAccountName\": \"Jane Doe\",\n    \"thirdPartyTxType\": \"Pay Bill\",\n    \"mpesaBusinessPayType\": 0\n  },\n  \"sender\": \"choice-baas\",\n  \"requestId\": \"req-abc123\",\n  \"signature\": \"base64-signature-over-canonicalized-payload\",\n  \"timestamp\": 1758100000000,\n  \"notificationType\": \"0003\"\n}"

response = http.request(request)
puts response.read_body
```

```java Waas_Choice Bank Callback_Choice Bank Notification Callback (0003 Balance Change example)_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v3/waas/callbacks/choicebaas")
  .header("Content-Type", "application/json")
  .body("{\n  \"salt\": \"a1b2c3d4e5f6...\",\n  \"locale\": \"en\",\n  \"params\": {\n    \"txId\": \"TX123\",\n    \"amount\": \"500.00\",\n    \"txType\": \"01\",\n    \"userId\": \"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f\",\n    \"balance\": \"1250.50\",\n    \"extInfo\": {\n      \"oppoPhoneNumber\": \"254712345678\",\n      \"counterpartyName\": \"Jane Doe\",\n      \"transactionNarrative\": \"Payment\"\n    },\n    \"currency\": \"KES\",\n    \"accountId\": \"46012000068891\",\n    \"feeAmount\": \"0.00\",\n    \"accountName\": \"Sare Shop\",\n    \"completeTime\": 1758100000000,\n    \"externalTxId\": \"MPESA-XYZ\",\n    \"oppoBankCode\": \"M-PESA\",\n    \"oppoBankName\": \"M-PESA\",\n    \"oppoAccountId\": \"254712345678\",\n    \"paymentChannel\": \"MPESA\",\n    \"oppoAccountName\": \"Jane Doe\",\n    \"thirdPartyTxType\": \"Pay Bill\",\n    \"mpesaBusinessPayType\": 0\n  },\n  \"sender\": \"choice-baas\",\n  \"requestId\": \"req-abc123\",\n  \"signature\": \"base64-signature-over-canonicalized-payload\",\n  \"timestamp\": 1758100000000,\n  \"notificationType\": \"0003\"\n}")
  .asString();
```

```php Waas_Choice Bank Callback_Choice Bank Notification Callback (0003 Balance Change example)_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8080/api/v3/waas/callbacks/choicebaas', [
  'body' => '{
  "salt": "a1b2c3d4e5f6...",
  "locale": "en",
  "params": {
    "txId": "TX123",
    "amount": "500.00",
    "txType": "01",
    "userId": "f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f",
    "balance": "1250.50",
    "extInfo": {
      "oppoPhoneNumber": "254712345678",
      "counterpartyName": "Jane Doe",
      "transactionNarrative": "Payment"
    },
    "currency": "KES",
    "accountId": "46012000068891",
    "feeAmount": "0.00",
    "accountName": "Sare Shop",
    "completeTime": 1758100000000,
    "externalTxId": "MPESA-XYZ",
    "oppoBankCode": "M-PESA",
    "oppoBankName": "M-PESA",
    "oppoAccountId": "254712345678",
    "paymentChannel": "MPESA",
    "oppoAccountName": "Jane Doe",
    "thirdPartyTxType": "Pay Bill",
    "mpesaBusinessPayType": 0
  },
  "sender": "choice-baas",
  "requestId": "req-abc123",
  "signature": "base64-signature-over-canonicalized-payload",
  "timestamp": 1758100000000,
  "notificationType": "0003"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Waas_Choice Bank Callback_Choice Bank Notification Callback (0003 Balance Change example)_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  \"salt\": \"a1b2c3d4e5f6...\",\n  \"locale\": \"en\",\n  \"params\": {\n    \"txId\": \"TX123\",\n    \"amount\": \"500.00\",\n    \"txType\": \"01\",\n    \"userId\": \"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f\",\n    \"balance\": \"1250.50\",\n    \"extInfo\": {\n      \"oppoPhoneNumber\": \"254712345678\",\n      \"counterpartyName\": \"Jane Doe\",\n      \"transactionNarrative\": \"Payment\"\n    },\n    \"currency\": \"KES\",\n    \"accountId\": \"46012000068891\",\n    \"feeAmount\": \"0.00\",\n    \"accountName\": \"Sare Shop\",\n    \"completeTime\": 1758100000000,\n    \"externalTxId\": \"MPESA-XYZ\",\n    \"oppoBankCode\": \"M-PESA\",\n    \"oppoBankName\": \"M-PESA\",\n    \"oppoAccountId\": \"254712345678\",\n    \"paymentChannel\": \"MPESA\",\n    \"oppoAccountName\": \"Jane Doe\",\n    \"thirdPartyTxType\": \"Pay Bill\",\n    \"mpesaBusinessPayType\": 0\n  },\n  \"sender\": \"choice-baas\",\n  \"requestId\": \"req-abc123\",\n  \"signature\": \"base64-signature-over-canonicalized-payload\",\n  \"timestamp\": 1758100000000,\n  \"notificationType\": \"0003\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Waas_Choice Bank Callback_Choice Bank Notification Callback (0003 Balance Change example)_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "salt": "a1b2c3d4e5f6...",
  "locale": "en",
  "params": [
    "txId": "TX123",
    "amount": "500.00",
    "txType": "01",
    "userId": "f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f",
    "balance": "1250.50",
    "extInfo": [
      "oppoPhoneNumber": "254712345678",
      "counterpartyName": "Jane Doe",
      "transactionNarrative": "Payment"
    ],
    "currency": "KES",
    "accountId": "46012000068891",
    "feeAmount": "0.00",
    "accountName": "Sare Shop",
    "completeTime": 1758100000000,
    "externalTxId": "MPESA-XYZ",
    "oppoBankCode": "M-PESA",
    "oppoBankName": "M-PESA",
    "oppoAccountId": "254712345678",
    "paymentChannel": "MPESA",
    "oppoAccountName": "Jane Doe",
    "thirdPartyTxType": "Pay Bill",
    "mpesaBusinessPayType": 0
  ],
  "sender": "choice-baas",
  "requestId": "req-abc123",
  "signature": "base64-signature-over-canonicalized-payload",
  "timestamp": 1758100000000,
  "notificationType": "0003"
] 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()
```