Skip to main content
GET
/
v1
/
credit-scorecard
/
{mobile_number}
Get credit scorecard
curl --request GET \
  --url https://api-dev.bsa.ai/v1/credit-scorecard/{mobile_number} \
  --header 'Authorization: Bearer <token>'
{
  "mobileNumber": 123,
  "halopesaGrade": "<string>",
  "finalCreditScore": 123,
  "finalCreditLimit": 123,
  "executionPeriod": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.api.bsa.ai/llms.txt

Use this file to discover all available pages before exploring further.

Returns the customer’s current credit grade, score, and pre-approved loan limit as held by the HaloPesa credit scoring engine. This endpoint is read-only — it has no side effects (no SMS, no database write).

Path parameters

mobile_number
string
required
Customer’s mobile number in international format — exactly 12 digits starting with 255 (Tanzania country code). Example: 255762260621.

Example

curl -sf "$BASE/v1/credit-scorecard/255762260621" \
  -H "Authorization: Bearer $TOKEN"

Response

200 OK
{
  "mobileNumber": 255762260621,
  "halopesaGrade": "B",
  "finalCreditScore": 500,
  "finalCreditLimit": 30000.0,
  "executionPeriod": "0.01 seconds"
}

Fields

mobileNumber
integer
Echoes the queried mobile number.
halopesaGrade
string
Credit grade band. Common values: A, B, C. Unscored customers receive XX (see below).
finalCreditScore
integer
Numeric credit score on the HaloPesa scale.
finalCreditLimit
number
Pre-approved loan limit in TZS. 0 for unscored customers.
executionPeriod
string
Upstream processing time. Diagnostic only — partners typically ignore it.

Unscored customers

A customer with no record yet is not an error. The upstream returns 200 OK with:
{
  "mobileNumber": 255111111111,
  "halopesaGrade": "XX",
  "finalCreditScore": 100,
  "finalCreditLimit": 0.0
}
Branch on halopesaGrade == "XX" (or finalCreditLimit == 0) to detect this case.

Errors

CodeWhen
invalid_argumentmobile_number is not 12 digits starting with 255
unauthenticatedToken missing/invalid
internalUpstream credit service unavailable or returned an unhandled error