This document describes the API for fetching details associated with the submitted KRA PIN

Base URL

https://identity.cladfy.app/api/v1

API Endpoint:

POST /krapin

Request Headers:

  • Payload: The data sent to the server in the request body. Here, it's a JSON object with a single key-value pair:
    "pinnumber": 0 – A placeholder value that should be replaced with an actual KRAPIN number.

  • Content-Type: "application/json" Indicates that the data in the request body is in JSON format.

  • Accept: "application/json"Tells the server that the client expects the response to be in JSON format.

  • Authorization: "Basic 123"
    Used for HTTP Basic Authentication, where "123" is a placeholder for the base64-encoded username:password credentials. See guide here

Request Body:

The request body contains the pinnumber. It should be JSON with the properties below.

  • pinnumber: The KRA PIN Number - string.

Example Request Body:

{
  "pinnumber": "string"
}

Response - 200:

The response will be a JSON object following the request data type specification: A typed dictionary containing the detailed results. Properties include:

  • success

    • boolean (required)
  • response_code

    • integer (required)
    • Example: 200
  • message

    • string (required)
    • Example: KRA Pin Details Fetched Successfully
  • data

    • object (required)

    • Business_Certificate_Id

      • string (required)
      • Example: XXXXXXXXX
    • Email_Addresses

    • Locality

      • string (required)
      • Example: XXXXX XX XXXXXXX
    • PINNo

      • string (required)
      • Example: XXXXXXXXXXX
    • Partnership

      • string (required)
      • Example: X
    • Paye

      • string (required)
      • Example: X
    • Station

      • string (required)
      • Example: XXXXX XX XXXXXXX
    • TaxpayerName

      • string (required)
      • Example: XXXXXXXX XXXXXXX
    • Tot

      • string (required)
      • Example: X
    • Trading_Business_Name

      • string (required)
      • Example: XXXXXXXX XXXXXXX
    • Vat

      • string (required)
      • Example: X
  • request_id

    • string (required)
    • Example: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Example Response:

{
  "success": true,
  "response_code": 200,
  "message": "KRA Pin Details Fetched Successfully",
  "data": {
    "Business_Certificate_Id": "XXXXXXXXX",
    "Email_Addresses": "[email protected]",
    "Locality": "XXXXX XX XXXXXXX",
    "PINNo": "XXXXXXXXXXX",
    "Partnership": "X",
    "Paye": "X",
    "Station": "XXXXX XX XXXXXXX",
    "TaxpayerName": "XXXXXXXX XXXXXXX",
    "Tot": "X",
    "Trading_Business_Name": "XXXXXXXX XXXXXXX",
    "Vat": "X"
  },
  "request_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}

Error Handling:

401 Unauthorized: If the API key is invalid.
400 Bad Request: If the request body is not valid JSON or missing required fields.
500 Internal Server Error: If an internal server error occurs during API request processing. The response will include an error message.

Python Test Example:

This test example demonstrates sending a POST request to the API endpoint with the KRA PIN. The response will include the associated details.

import requests

url = "https://identity.cladfy.app/api/v1/krapin"

payload = { "pinnumber": "string" }
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic 123"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())