Skip to main content

Request and Responses

Tausi Credit Scoring API uses Request and Response objects for communicating with the client’s endpoints by receiving data and then, sending back the credit scores.

Request method

The IDs Credit Scoring API supports the following request methods:

  • GET /scores: Returns a complete score details of all IDs.
  • POST /score: Returns a score details of the specified IDs.

Example Tausi Credit Score API Request(Programmatically)

    import requests

# api
url = "https://customsubdomain.tausi.africa/score"

# sample request parameters
data = {
'loan_date': '2019-12-02',
'birth_date': '24-08-1974',
'mobile_money_reg_date': '2012-05-10',
'network_reg_date': '2001-02-19',
'network_number': 156,
'mobile_money_deposit_highest': 1000000,
'mobile_money_send_highest': 272000,
'mobile_money_withdraw_acceptors': 25 ,
'cip_grade': 'XX'
}

# defining header
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer api-key',

}

#making request
response = requests.post(url, headers=headers, params=data, verify=False)


# results filtering
response.text

Example Tausi Credit Score API Request(Curl)

curl example request
curl -X 'POST' \
'https://customsubdomain.tausi.africa/v1/score' \
-H 'accept: application/json' \
-H 'x-api-key: <YOUR API KEY>'
-H 'Content-Type: application/json' \
-D '{
'loan_date': '2019-12-02',
'birth_date': '24-08-1974',
'mobile_money_reg_date': '2012-05-10',
'network_reg_date': '2001-02-19',
'network_number': 156,
'mobile_money_deposit_highest': 1000000,
'mobile_money_send_highest': 272000,
'mobile_money_withdraw_acceptors': 25 ,
'cip_grade': 'XX'
}'

Example Tausi Credit Score API Response

  • Successful Response[200]
{
"id": "XXXXXXXXXXXXXXXXX",
"credit_limit": 250000,
}

Errors and their status codes

status code 401: Unauthorized

{
"error": "the provided token is invalid"
}

status code 403: Bad Request

{
"error": "couldn't parse the id"
}

status code 500: Internal Server Error

{
"error": "Internal server error"
}

status code 404: Not Found

{
"error": "the id not found"
}