# Consumer Credit Score Check (/docs/api-documentation/lending-apis/credit-score-check)



##### Overview [#overview]

The **Consumer Credit Score Check API** provides a numerical score that reflects a consumer’s overall creditworthiness.

The score is derived from key credit history factors such as repayment behavior, credit exposures, and financial behaviour.

<br />

##### Getting Started [#getting-started]

<br />

> **Note**
> You must already be registered as a lender on **myCreditScore**. If you are not yet registered, please visit [https://mycreditscore.com.gh/register-lender](https://mycreditscore.com.gh/register-lender) for more information.
<br />

##### Authentication [#authentication]

To integrate with the **Consumer Credit Score Check API**, you will need to authenticate using API credentials generated from your **Lenders Portal**. The easiest way to authenticate is by using HTTP Basic Authentication.

###### Basic Authentication [#basic-authentication]

Basic Auth requires a Base64 encoded string of your API ID and API Key. See below for sample header request information.

Authorization: Basic {'{base64_encode(API ID:API Key)}'}

A Base64 encoding of your API keys should have your Authorization header appear like this:
Basic a2hlcW2sb3U6bWdhtHd9YW8=. Try sample basic auth [here](https://www.base64encode.org).

> **Sample Authorization Header**
> Authorization: Basic a2hzcW9sb3U6bWdhaHdpYW8=
<br />

##### API Reference [#api-reference]

To initiate a request, send an HTTP **POST** request to the below URL with the required parameters.

|              |                                                                                                                        |
| ------------ | ---------------------------------------------------------------------------------------------------------------------- |
| API Endpoint | [https://score-api.mycreditscore.com.gh/api/v1/score-check](https://score-api.mycreditscore.com.gh/api/v1/score-check) |
| Request Type | **POST**                                                                                                               |
| Content Type | **JSON**                                                                                                               |

<br />

###### REQUEST PARAMETERS [#request-parameters]

| Parameter              | Type   | Requirement | Description                                          |
| ---------------------- | ------ | ----------- | ---------------------------------------------------- |
| ghanaCard              | String | Mandatory   | Ghana Card ID.                                       |
| identifierName         | String | Optional    | Full name of the individual.                         |
| identifierNationality  | String | Optional    | Nationality of the individual.                       |
| identifierDob          | String | Mandatory   | Date of birth in ISO 8601 format.                    |
| identifierMobileNumber | String | Optional    | Mobile phone number.                                 |
| currencyOfCredit       | String | Optional    | Currency of the credit (e.g., **GHS**).              |
| creditAmount           | Number | Mandatory   | Amount of credit requested.                          |
| purposeOfCheck         | String | Optional    | Purpose for requesting the check.                    |
| typeOfCreditFacility   | String | Optional    | Type of credit facility (e.g., **Personal Loan**).   |
| lenderReferenceId      | String | Optional    | Unique reference ID provided by the lender.          |
| voterId                | String | Optional    | Voter ID number of the borrower.                     |
| passportNumber         | String | Optional    | Passport number of the borrower.                     |
| driverLicenseNumber    | String | Optional    | Driver’s license number of the borrower.             |
| ssnitNumber            | String | Optional    | Social Security and National Insurance Trust number. |
| nhisNumber             | String | Optional    | National Health Insurance Scheme number.             |
| tin                    | String | Optional    | Tax Identification Number.                           |

<br />

###### SAMPLE REQUEST [#sample-request]

**HTTP**

  ```http
  POST /api/v1/score-check HTTP/1.1
  Host: score-api.mycreditscore.com.gh
  Authorization: Basic ABCDcjQ1OjZhNTI3MzM5MzJkNTRjZjJiNTA==
  Content-Type: application/json

  {
      "ghanaCard": "GHA-000000000-0",
      "identifierName": "John Doe",
      "identifierNationality": "Ghanaian",
      "identifierDob": "1999-06-15T00:00:00Z",
      "identifierMobileNumber": "2330000000",
      "currencyOfCredit": "GHS",
      "creditAmount": 100,
      "purposeOfCheck": "Loan Application",
      "typeOfCreditFacility": "Personal Loan",
      "lenderReferenceId": "LOAN-REF-12345",
      "voterId": "VO678232",
      "passportNumber": "PAS67894",
      "driverLicenseNumber": "234286382",
      "ssnitNumber": "E10089883497",
      "nhisNumber": "N49834984",
      "tin": "T19892323"
  }
  ```

**cURL**

  ```bash
  curl --location 'https://score-api.mycreditscore.com.gh/api/v1/score-check' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Basic ABCDcjQ1OjZhNTI3MzM5MzJkNTRjZjJiNTA==' \
  --data '{
      "ghanaCard": "GHA-000000000-0",
      "identifierName": "",
      "identifierNationality": "",
      "identifierDob": "1997-06-04T00:00:00Z",
      "identifierMobileNumber": "",
      "currencyOfCredit": "GHS",
      "creditAmount": 1,
      "purposeOfCheck": "Loan Application",
      "typeOfCreditFacility": "Personal Loan",
      "lenderReferenceId": "",
      "voterId": "",
      "passportNumber": "",
      "driverLicenseNumber": "",
      "ssnitNumber": "",
      "nhisNumber": "",
      "tin": ""
  }'
  ```

**PHP**

  ```php
    <?php

    $curl = curl_init();

    curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://score-api.mycreditscore.com.gh/api/v1/score-check',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS =>'{
        "ghanaCard": "GHA-000000000-0",
        "identifierName": "",
        "identifierNationality": "",
        "identifierDob": "1997-06-04T00:00:00Z",
        "identifierMobileNumber": "",
        "currencyOfCredit": "GHS",
        "creditAmount": 1,
        "purposeOfCheck": "Loan Application",
        "typeOfCreditFacility": "Personal Loan",
        "lenderReferenceId": "",
        "voterId": "",
        "passportNumber": "",
        "driverLicenseNumber": "",
        "ssnitNumber": "",
        "nhisNumber": "",
        "tin": ""
    }',
    CURLOPT_HTTPHEADER => array(
        'Accept: application/json',
        'Content-Type: application/json',
        'Authorization: Basic ABCDcjQ1OjZhNTI3MzM5MzJkNTRjZjJiNTA=='
    ),
  ));

    $response = curl_exec($curl);

    curl_close($curl);
    echo $response;
  ```

**Python**

  ```bash
  import requests
  import json

  url = "https://score-api.mycreditscore.com.gh/api/v1/score-check"

  payload = json.dumps({
    "ghanaCard": "GHA-000000000-0",
    "identifierName": "",
    "identifierNationality": "",
    "identifierDob": "1997-06-04T00:00:00Z",
    "identifierMobileNumber": "",
    "currencyOfCredit": "GHS",
    "creditAmount": 1,
    "purposeOfCheck": "Loan Application",
    "typeOfCreditFacility": "Personal Loan",
    "lenderReferenceId": "",
    "voterId": "",
    "passportNumber": "",
    "driverLicenseNumber": "",
    "ssnitNumber": "",
    "nhisNumber": "",
    "tin": ""
  })
  headers = {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'Authorization': 'Basic ABCDcjQ1OjZhNTI3MzM5MzJkNTRjZjJiNTA=='
  }

  response = requests.request("POST", url, headers=headers, data=payload)

  print(response.text)
  ```

**JS**

  ```javascript
  const myHeaders = new Headers();
  myHeaders.append("Accept", "application/json");
  myHeaders.append("Content-Type", "application/json");
  myHeaders.append("Authorization", "Basic ABCDcjQ1OjZhNTI3MzM5MzJkNTRjZjJiNTA==");

  const raw = JSON.stringify({
    "ghanaCard": "GHA-000000000-0",
    "identifierName": "",
    "identifierNationality": "",
    "identifierDob": "1997-06-04T00:00:00Z",
    "identifierMobileNumber": "",
    "currencyOfCredit": "GHS",
    "creditAmount": 1,
    "purposeOfCheck": "Loan Application",
    "typeOfCreditFacility": "Personal Loan",
    "lenderReferenceId": "",
    "voterId": "",
    "passportNumber": "",
    "driverLicenseNumber": "",
    "ssnitNumber": "",
    "nhisNumber": "",
    "tin": ""
  });

  const requestOptions = {
    method: "POST",
    headers: myHeaders,
    body: raw,
    redirect: "follow"
  };

  fetch("https://score-api.mycreditscore.com.gh/api/v1/score-check", requestOptions)
    .then((response) => response.text())
    .then((result) => console.log(result))
    .catch((error) => console.error(error));
  ```

<br />

###### RESPONSE PARAMETERS [#response-parameters]

| Parameter    | Type   | Description                                  |
| ------------ | ------ | -------------------------------------------- |
| message      | String | Response message.                            |
| code         | Number | HTTP status code.                            |
| data         | Object | Contains score check result.                 |
| subCode      | String | Sub-code indicating further status.          |
| errors       | Object | Error details, if any.                       |
| responseCode | Object | Additional response code info, if available. |

###### Data Object [#data-object]

| Field                   | Type   | Description                                                           |
| ----------------------- | ------ | --------------------------------------------------------------------- |
| isCreditScoreActivated  | String | Indicates if credit score is activated.                               |
| creditScoreIfActive     | Number | Credit score value if activated.                                      |
| name                    | String | Full name of the individual.                                          |
| minScore                | Number | Lowest score in score range.                                          |
| maxScore                | Number | Highest score in score range.                                         |
| scoreBand               | String | A simple label that shows how good the person's credit score is.      |
| scoreBandInterpretation | String | A short explanation of what that credit score level means to lenders. |

<br />

###### SAMPLE RESPONSE [#sample-response]

```js
{
    "message": "Your score check request was successful",
    "code": 200,
    "data": {
        "isCreditScoreActivated": "true",
        "creditScoreIfActive": 711,
        "name": "John Doe",
        "minScore": 300,
        "maxScore": 850,
        "scoreBand": "Very Good",
        "scoreBandInterpretation": "Shows lenders that you are a good investment with a strong credit history and qualify for very favorable interest rates and loan terms. Lenders will consider you a reliable borrower."
    },
    "subCode": "0",
    "errors": null,
    "responseCode": null
}
```

<br />

##### Response Codes [#response-codes]

The Credit Score Check API uses standard HTTP error reporting. Successful requests return HTTP status codes in the 2xx. Failed requests return status codes in 4xx and 5xx.

Response Codes are included in the JSON response body, which contains information about the error or status.

| ResponseCode | Description                                                                                                     |
| ------------ | --------------------------------------------------------------------------------------------------------------- |
| 200          | Success. The request was successful and the response contains the score check results.                          |
| 401          | Unauthorized. The request lacks valid authentication credentials.                                               |
| 404          | Not Found. The requested resource was not found in the system.                                                  |
| 424          | Failed Dependency. The request failed due to dependency failure, such as an external service being unavailable. |
| 500          | Internal Server Error. An unexpected error occurred while processing the request.                               |

<br />
