# code402 KRA PIN Check

> code402 KRA PIN Check is a paid API for AI agents from hcrb.in, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-10).

Validates a Kenya Revenue Authority (KRA) Personal Identification Number using offline deterministic format/checksum rules, returning validity, reason, and normalized form.

## Facts

- Endpoint: POST https://hcrb.in/v1/tools/kra-pin-check/call?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code402-kra-pin-check-21823e38
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lPSSX9wKfp03hpTDXlEuH

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability code402-kra-pin-check-21823e38 -d '<json body>'
```

Example prompt: Can you check whether this KRA PIN is valid: A001234567Z? I need to know if the format and checksum pass before I onboard this Kenyan supplier.

## When to prefer this

Choose this endpoint when you need fast, offline, deterministic validation of Kenyan KRA PINs without relying on scraping, ML, or live government database lookups. It is ideal for compliance pipelines, supplier onboarding, and rental due diligence workflows where you need a cryptographically receipted, auditable validation result at $0.005/call with the first 3 calls/day free. Prefer it over web-scraping approaches when privacy, latency, and cost are concerns.

## Known failure modes

- Malformed or empty PIN input returns valid:false with a descriptive reason
- PIN with correct format but invalid checksum returns valid:false with checksum failure reason
- Payment not included or insufficient USDC results in HTTP 402 payment required
- Network errors or service unavailability return HTTP 5xx
- Passing a non-KRA identifier (e.g. an IBAN) to this endpoint will return valid:false with an unexpected format reason

## How this service works

Offline deterministic checks (no ML, no scraping) for business identifiers and rental due-diligence, paid per call via x402 (gasless EIP-3009 USDC on Base). Checksum-verifiable (IBAN, LEI, VAT, ABA, ISBN, SEDOL…) vs format-only (EIN, IFSC, SWIFT/BIC…) — every response returns a scope field. Non-custodial, signed receipts. First 3 calls/day free.

## Output

A JSON object with: `valid` (boolean indicating whether the KRA PIN passes all format and checksum rules), `reason` (human-readable explanation such as 'checksum valid' or a specific failure reason), `scope` (indicating whether checksum verification or format-only was applied), `normalized` (the canonical form of the PIN), `country` (always KE for Kenya), and `tool` (endpoint identifier).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "pin"
   ],
   "properties": {
    "pin": {
     "type": "string",
     "description": "11-character KRA PIN (e.g. P051112223Z)."
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "schema": {
  "type": "object",
  "required": [
   "valid",
   "reason"
  ],
  "properties": {
   "tool": {
    "type": "string"
   },
   "scope": {
    "type": "string"
   },
   "valid": {
    "type": "boolean"
   },
   "reason": {
    "type": "string"
   },
   "country": {
    "type": "string"
   },
   "normalized": {
    "type": "string"
   }
  }
 },
 "example": {
  "valid": true,
  "reason": "checksum valid"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code402-kra-pin-check-21823e38/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from hcrb.in](https://www.zero.xyz/host/hcrb.in/llms.txt)
