Salami Gateway

API Documentation
Back to Dashboard

KRA PIN Registration API

Register new individual KRA PINs through the developer.go.ke API. This endpoint supports individual taxpayer registration using National ID, Passport, or other identification documents.

Table of Contents

  1. Overview
  2. Register Individual PIN
  3. Field Reference
  4. Taxpayer Types
  5. Status Codes

Overview

Required Scope

Scope Description
kra:registration Register new KRA PINs for individual taxpayers

Endpoint Summary

Method Endpoint KRA Path Description
POST /api/kra/registration/pin /v1/generate/pin Register an individual KRA PIN

Note: This endpoint is for individual taxpayers only. Company/non-individual PIN registration requires a different process through the KRA portal.

Register Individual PIN

Submit an individual PIN registration request to KRA.

Endpoint: POST /api/kra/registration/pin

Required Scope: kra:registration

Request Body:

You can submit fields in either flat or nested format. Salami wraps flat fields inside TAXPAYERDETAILS automatically.

Flat Format

{
  "TaxpayerType": "1",
  "IdentificationNumber": "12345678",
  "DateOfBirth": "1990-05-15",
  "MobileNumber": "0712345678",
  "EmailAddress": "john.doe@example.com",
  "IsPinWithNoOblig": "Y"
}

Nested Format

{
  "TAXPAYERDETAILS": {
    "TaxpayerType": "1",
    "IdentificationNumber": "12345678",
    "DateOfBirth": "1990-05-15",
    "MobileNumber": "0712345678",
    "EmailAddress": "john.doe@example.com",
    "IsPinWithNoOblig": "Y"
  }
}

Parameter Table

Field Type Required Description
TaxpayerType string Yes ID document type code (see table below)
IdentificationNumber string Yes ID document number
DateOfBirth string Yes Date of birth (YYYY-MM-DD)
MobileNumber string Yes Mobile phone number (Kenyan format)
EmailAddress string Yes Email address
IsPinWithNoOblig string Yes Y for PIN with no obligations, N otherwise

Request:

curl -X POST \
  https://yourtenant.salami.dgl.co.ke/api/kra/registration/pin \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "TaxpayerType": "1",
    "IdentificationNumber": "12345678",
    "DateOfBirth": "1990-05-15",
    "MobileNumber": "0712345678",
    "EmailAddress": "john.doe@example.com",
    "IsPinWithNoOblig": "Y"
  }'

Success Response:

{
  "success": true,
  "data": {
    "KRAPIN": "A001234567B",
    "TaxpayerName": "JOHN DOE SMITH",
    "IdentificationType": "National ID",
    "IdentificationNumber": "12345678",
    "Status": "Registered",
    "RegistrationDate": "2026-03-29",
    "StationName": "NAIROBI",
    "Message": "PIN registered successfully. An SMS has been sent to the registered mobile number."
  },
  "message": "KRA PIN registered successfully"
}

Duplicate Response (already registered):

{
  "success": false,
  "message": "KRA API error: A PIN already exists for this identification number",
  "error": "kra_error",
  "kra_response": {
    "ExistingPIN": "A001234567B"
  }
}

Response Fields

Field Type Description
KRAPIN string Newly generated KRA PIN
TaxpayerName string Name as registered (from IPRS/ID system)
IdentificationType string Type of ID used
IdentificationNumber string The ID number submitted
Status string Registered or Failed
RegistrationDate string Date of registration
StationName string Assigned KRA station
Message string Additional information from KRA

Field Reference

TaxpayerType

Code Description ID Number Format
1 National ID 7-8 digit number (e.g., 12345678)
2 Passport Alphanumeric (e.g., AB123456)
3 Service/Military ID Variable format
4 Alien ID Variable format

IdentificationNumber

Taxpayer Type Format Example
National ID 7-8 digits 12345678
Passport Letters + digits AB123456
Service ID Variable SVC001234
Alien ID Variable ALN001234

DateOfBirth

MobileNumber

EmailAddress

IsPinWithNoOblig

Value Description Use Case
Y Register PIN with no tax obligations Personal use, students, employment-only
N Register PIN with tax obligations Business registration, self-employment

Tip: Use Y for individuals who need a PIN only for identification purposes (e.g., opening a bank account, KRA agent registration). Use N when the individual will be filing tax returns.

Taxpayer Types

Individual (supported by this API)

Scenario TaxpayerType IsPinWithNoOblig
Employee needing PIN 1 (National ID) Y
Self-employed person 1 (National ID) N
Foreign national (employed) 2 (Passport) Y
Foreign national (business) 2 (Passport) N
Military personnel 3 (Service ID) Y

Non-Individual (not supported)

Company, partnership, trust, and other non-individual registrations must be done through the KRA portal at itax.kra.go.ke.

Validation Errors

{
  "success": false,
  "message": "Required fields missing: TAXPAYERDETAILS.TaxpayerType, TAXPAYERDETAILS.IdentificationNumber, TAXPAYERDETAILS.DateOfBirth, TAXPAYERDETAILS.MobileNumber, TAXPAYERDETAILS.EmailAddress, TAXPAYERDETAILS.IsPinWithNoOblig",
  "error": "validation_error"
}

Status Codes

Code Description
200 PIN registered successfully
401 Invalid or missing Salami token
403 Token lacks kra:registration scope
422 Missing required fields or validation error
409 PIN already exists for this ID number
502 KRA server error or timeout

Best Practices

  1. Verify first -- Use PIN by ID to check if a PIN already exists
  2. Validate mobile number -- Ensure the mobile number is valid and reachable
  3. Verify email -- Use a valid email; KRA sends the PIN certificate to this address
  4. Store the PIN -- Save the returned KRA PIN in your system
  5. Inform the user -- Let users know they will receive an SMS and email from KRA
  6. Handle duplicates -- Gracefully handle the "PIN already exists" response
  7. Sandbox testing -- Test with the sandbox environment first; sandbox may use test ID numbers

Related Documentation


Back to: KRA Overview | KRA Returns


Need help? Contact us at support@dgl.co.ke
© 2026 Deadan Group Limited. All rights reserved.
⚡ API Explorer
LIVE
// Response will appear here...