Skip to main content

Score Request API

Overview

The Score Request API allows you to request credit scores and related financial products. This endpoint processes customer information and returns scoring results based on the selected product type.

Endpoint

POST https://api.kamoa.io/score/request
info

This endpoint processes customer information and returns scoring results based on the selected product type.

Authentication

For detailed instructions, see the Authentication Guide.

  • Authorization: token
  • x-api-key: Your API key
Security Note

Never expose API keys in client-side code

cURL Example
curl -X POST https://api.kamoa.io/score/request \
-H "Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "x-api-key: secret_IPU5xWuAwimnyTGLlPGaCw8AY..." \
-H "Content-Type: application/json"

Request Headers

HeaderRequiredDescription
Content-TypeYesMust be application/json
AuthorizationYestoken for authentication
x-api-keyYesYour API key for additional security

Request Body

Required Fields

FieldTypeDescriptionValidation
nationalIdstringCustomer's national ID numberRequired, non-empty
phoneNumberstringCustomer's phone numberRequired, must be valid international format
firstNamestringCustomer's first nameRequired, non-empty
lastNamestringCustomer's last nameRequired, non-empty
productCodeenumProduct type to requestMust be one of the available product codes

Optional Fields

FieldTypeDescriptionValidation
emailstringCustomer's email addressOptional, valid email format if provided
streetstringStreet addressOptional
citystringCityOptional
countrystringCountryOptional
middleNamestringCustomer's middle nameOptional
kraPinstringKenya Revenue Authority PINOptional
dobstringDate of birthOptional, ISO date format
passwordstringPassword for document accessRequired for M-Pesa statements
documentTypeenumType of document to analyzeRequired for statement-based products
bankNameenumBank nameRequired for bank statements
accountNumberstringBank account numberOptional for bank statements

Product Codes

Parsing

CodeNameDescriptionRequirements
PAExtract & AuthenticateExtracts headers and transactions, validates statement authenticity. Returns structured data (CSV/JSON)Statement PDF required
PASKamoaLiteExtract & Authenticate + provides risk score and credit limit for quick underwriting decisionsStatement PDF required
PARSKamoa360KamoaLite + detailed financial behavior signals (income volatility, lifestyle, spend stability)Statement PDF required

Score

CodeNameDescriptionRequirements
P7Bundle 1CIK Report + Bundle 1
P8Bundle 2Bundle 1 + KamoaLite(CIK report + boosted score + cash flow analysis)Statement PDF

Use Cases by Product

For Credit Analysts & Data Scientists

  • Extract & Authenticate: Raw transaction data for building custom decision models
  • Kamoa360: Comprehensive financial behavior analysis with 100+ cash flow features

For Underwriters & Quick Decisions

  • KamoaLite: Instant risk scoring and credit limit recommendations
  • Bundle 1: Enhanced scoring combining traditional and alternative data
  • Bundle 2: Complete credit assessment with all available data sources

Supported Document Types

TypeDescriptionAdditional Requirements
MPESA_STATEMENTM-Pesa transaction statementRequires password
MPESA_TILL_STATEMENTM-Pesa till statementRequires password
BANK_STATEMENTBank account statementRequires bankName

Supported Banks

Bank CodeBank Name
KCBKenya Commercial Bank
Equity BankEquity Bank
NCBANCBA Bank
NCBA LoopNCBA Loop
Absa Bank KenyaAbsa Bank Kenya
Diamond Trust BankDiamond Trust Bank
Stanbic Bank KenyaStanbic Bank Kenya
Standard Chartered Bank KenyaStandard Chartered Bank Kenya
I & M BankI&M Bank
Prime BankPrime Bank
Branch MicrofinanceBranch Microfinance
Family BankFamily Bank

Validation Rules

Conditional Requirements

Important Validation Rules
  1. Document Type Requirement: For statement-based product codes (PA, PAS, PARS, P8), the documentType field is required.

  2. M-Pesa Statement Requirements: When documentType is MPESA_STATEMENT or MPESA_TILL_STATEMENT, the password field is required.

  3. Bank Statement Requirements: When documentType is BANK_STATEMENT, the bankName field is required.

Example Requests

Extract & Authenticate Request

POST /score/request - Extract & Authenticate Product
{
"nationalId": "12345678",
"phoneNumber": "+254712345678",
"firstName": "John",
"lastName": "Doe",
"productCode": "PA",
"documentType": "MPESA_STATEMENT",
"password": "mpesa_password_123"
}

KamoaLite Request

POST /score/request - KamoaLite Product
{
"nationalId": "12345678",
"phoneNumber": "+254712345678",
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"middleName": "Smith",
"productCode": "PAS",
"documentType": "BANK_STATEMENT",
"bankName": "KCB",
"accountNumber": "1234567890"
}

Bundle 2 Request

POST /score/request - Bundl2 2 Product
{
"nationalId": "12345678",
"phoneNumber": "+254712345678",
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"middleName": "Smith",
"street": "123 Main Street",
"city": "Nairobi",
"country": "Kenya",
"kraPin": "A123456789B",
"dob": "1990-01-15",
"productCode": "P8",
"documentType": "BANK_STATEMENT",
"bankName": "EQUITY_BANK",
"accountNumber": "9876543210",
}

Bundle 1 Request

POST /score/request - Bundle 1 Product
{
"nationalId": "12345678",
"phoneNumber": "+254712345678",
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"middleName": "Smith",
"street": "123 Main Street",
"city": "Nairobi",
"country": "Kenya",
"productCode": "P7"
}

Response Format

Success Response (200 OK)

Success Response
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"requestId": "req_1234567890abcdef",
"uploadUrl": {
"url": "https:....",
"expiresAt": "2024-06-10"
}
},

Error Responses

Validation Error (400 Bad Request)

400 Bad Request
{
"success": false,
"error": "ValidationError",
"message": "Request validation failed",
"details": [
{
"field": "phoneNumber",
"message": "Invalid phone number"
},
{
"field": "documentType",
"message": "Document type is required for statement-based products"
}
]
}

Authentication Error (401 Unauthorized)

401 Unauthorized
{
"success": false,
"error": "AuthenticationError",
"message": "Invalid or expired authentication token"
}

Rate Limit Error (429 Too Many Requests)

429 Too Many Requests
{
"success": false,
"error": "RateLimitError",
"message": "Too many requests. Please try again later.",
"retryAfter": 60,
"quotaRemaining": 847,
"resetTime": "2025-06-10T15:30:00Z"
}

Error Codes

HTTP StatusError TypeDescriptionCommon Causes
400ValidationErrorRequest data validation failedMissing required fields, invalid format
401AuthenticationErrorInvalid or missing authenticationExpired token, missing API key
403AuthorizationErrorInsufficient permissionsInvalid API key, plan restrictions
429RateLimitErrorRate or quota limit exceededToo many requests, daily quota reached
500InternalServerErrorServer-side processing errorTemporary service issues
Rate Limit Handling

When you receive a 429 error, check the retryAfter header and implement exponential backoff to avoid further rate limiting.

Best Practices

Product Selection Guide

Choose the right product for your use case:

  • Need raw transaction data? → Use Extract & Authenticate
  • Need quick credit decisions? → Use KamoaLite or Bundle 1
  • Need detailed behavioral analysis? → Use Kamoa360
  • Need comprehensive assessment? → Use Bundle 2 (when available)

Phone Number Format

Always provide phone numbers in international format with country code:

+ Correct: "+254712345678"
- Incorrect: "0712345678"

Data Validation

Validate all required fields on the client side before making API calls to reduce errors and improve user experience.