API Reference
Partner-facing endpoints for consent, scoring, reports, and usage.
Authentication
Send your API key with every request using the authorization header.
Authorization: Bearer ps_test_7f3a...29c8
Content-Type: multipart/form-data
Endpoints
| Method | Path | Purpose | Access |
|---|---|---|---|
| POST | /scores/analyse |
Upload an M-Pesa statement and create a score report. | Sandbox + Live |
| GET | /scores/{reportId} |
Fetch score, band, factors, insights, and report status. | Sandbox + Live |
| GET | /scores/{reportId}/pdf |
Download a shareable credit report PDF. | Live |
| POST | /consents |
Create a customer consent session before statement analysis. | Sandbox + Live |
| GET | /usage |
Inspect request volume, success rates, and billing usage. | Live |
Example Response
{
"reportId": "psr_8842",
"status": "completed",
"score": 724,
"band": "Good",
"statementPeriod": "Jan 2024 - Dec 2024",
"factors": [
{ "name": "Income Consistency", "score": 174, "max": 213 }
]
}