Skip to main content

Branch Search

The Branch Search API retrieves branch information for a taxpayer.
This includes details such as branch name, location, manager, and head office status.

Endpoint


POST /selectBhfList


Purpose

This API:

  • Retrieves branch master data for a taxpayer
  • Returns all branches updated since a specified date
  • Provides manager and location details for each branch

⚠️ Always verify branch status codes (bhfSttsCd) and head office flag (hqYn) before performing operations.


Request Object: BhfSearchReq

Request Fields

FieldDescriptionTypeRequiredLength
lastReqDtLast request date (YYYYMMDDHHmmss)CHAR✅ Yes14

JSON Request Example

{
"lastReqDt": "20191130000000"
}

Response Object: BhfSearchRes

Top-Level Fields

FieldDescriptionType
resultCdResult code (000 = success)CHAR(3)
resultMsgResult messageCHAR
resultDtResponse timestampCHAR(14)

Branch List (bhfList)

Each entry represents a branch.

FieldDescriptionTypeLength
tinTaxpayer PINCHAR11
bhfIdBranch Office IDCHAR2
bhfNmBranch NameCHAR60
bhfSttsCdBranch Status CodeCHAR5
prvncNmCounty NameCHAR100
dstrtNmSub-County NameCHAR100
sctrNmTax Locality NameCHAR100
locDescLocation DescriptionCHAR100
mgrNmManager NameCHAR60
mgrTelNoManager PhoneCHAR20
mgrEmailManager EmailCHAR100
hqYnHead Office Flag (Y/N)CHAR1

JSON Response Example

{
"resultCd": "000",
"resultMsg": "It is succeeded",
"resultDt": "20200226193023",
"data": {
"bhfList": [
{
"tin": "A123456789Z",
"bhfId": "00",
"bhfNm": "Headquarter",
"bhfSttsCd": "01",
"prvncNm": "NAIROBI CITY",
"dstrtNm": "WESTLANDS",
"sctrNm": "WON",
"locDesc": "Westlands Towers",
"mgrNm": "manage1130_00",
"mgrTelNo": "0789001130",
"mgrEmail": "manage113000@test.com",
"hqYn": "Y"
},
{
"tin": "A123456789Z",
"bhfId": "01",
"bhfNm": "Branch01",
"bhfSttsCd": "01",
"prvncNm": "NAIROBI CITY",
"dstrtNm": "WESTLANDS",
"sctrNm": "WON",
"locDesc": "Westlands Towers",
"mgrNm": "manage1130_01",
"mgrTelNo": "0789011130",
"mgrEmail": "manage113001@test.com",
"hqYn": "N"
}
]
}
}

SDK Usage Examples

branches = etims.select_branches({'lastReqDt': last_req_dt(-30)})
bhf_list = branches.get('data', {}).get('bhfList', [])
print(f"Branches found: {len(bhf_list)}")

for branch in bhf_list:
print(f"- Branch ID: {branch['bhfId']}")
print(f" Name: {branch['bhfNm']}")
print(f" Status: {branch['bhfSttsCd']}")
print(f" County: {branch['prvncNm']}")
print(f" Sub-County: {branch['dstrtNm']}")
print(f" Locality: {branch['sctrNm']}")
print(f" Location: {branch['locDesc']}")
print(f" Manager: {branch['mgrNm']}")
print(f" Phone: {branch['mgrTelNo']}")
print(f" Email: {branch['mgrEmail']}")
print(f" Head Office: {branch['hqYn']}\n")

Best Practices

  • Use lastReqDt to fetch recently updated branches
  • Verify hqYn to differentiate head office vs branch
  • Cache branch data locally for faster lookups in other operations
  • Ensure correct branch IDs when creating or updating items or notices