# Consumer Profile Detail (/docs/api-documentation/lending-apis/consumer-profile-detail)



##### Overview [#overview]

The **Consumer Profile Detail API** returns comprehensive consumer profile details including demographic data, employment history, address history, and various identification numbers. These fields support risk assessment, KYC workflows, and identity verification.

<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 Profile Detail 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://basic-credit-report-api.mycreditscore.com.gh/api/v1/consumer-profile-detail](https://basic-credit-report-api.mycreditscore.com.gh/api/v1/consumer-profile-detail) |
| 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 performing the score 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/consumer-profile-detail HTTP/1.1
  Host: basic-credit-report-api.mycreditscore.com.gh
  Authorization: Basic ABCDcjQ1OjZhNTI3MzM5MzJkNTRjZjJiNTA==
  Content-Type: application/json

  {
      "ghanaCard": "GHA-000000000-0",
      "identifierName": "",
      "identifierNationality": "",
      "identifierDob": "1999-06-15T00:00:00Z",
      "identifierMobileNumber": "",
      "currencyOfCredit": "",
      "creditAmount": 1,
      "purposeOfCheck": "",
      "typeOfCreditFacility": "",
      "lenderReferenceId": "",
      "voterId": "",
      "passportNumber": "",
      "driverLicenseNumber": "",
      "ssnitNumber": "",
      "nhisNumber": "",
      "tin": ""
  }
  ```

**cURL**

  ```bash
  curl --location 'https://basic-credit-report-api.mycreditscore.com.gh/api/v1/consumer-profile-detail' \
  --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": "",
      "creditAmount": 1,
      "purposeOfCheck": "",
      "typeOfCreditFacility": "",
      "lenderReferenceId": "",
      "voterId": "",
      "passportNumber": "",
      "driverLicenseNumber": "",
      "ssnitNumber": "",
      "nhisNumber": "",
      "tin": ""
  }'
  ```

**PHP**

  ```php
    <?php

    $curl = curl_init();

    curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://basic-credit-report-api.mycreditscore.com.gh/api/v1/consumer-profile-detail',
    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": "",
        "creditAmount": 1,
        "purposeOfCheck": "",
        "typeOfCreditFacility": "",
        "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://basic-credit-report-api.mycreditscore.com.gh/api/v1/consumer-profile-detail"

  payload = json.dumps({
    "ghanaCard": "GHA-000000000-0",
    "identifierName": "",
    "identifierNationality": "",
    "identifierDob": "1997-06-04T00:00:00Z",
    "identifierMobileNumber": "",
    "currencyOfCredit": "",
    "creditAmount": 1,
    "purposeOfCheck": "",
    "typeOfCreditFacility": "",
    "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": "",
    "creditAmount": 1,
    "purposeOfCheck": "",
    "typeOfCreditFacility": "",
    "lenderReferenceId": "",
    "voterId": "",
    "passportNumber": "",
    "driverLicenseNumber": "",
    "ssnitNumber": "",
    "nhisNumber": "",
    "tin": ""
  });

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

  fetch("https://basic-credit-report-api.mycreditscore.com.gh/api/v1/consumer-profile-detail", 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                              |
| ------- | ----- | ---------------------------------------- |
| records | Array | List of consumer profile detail records. |

###### Record Object [#record-object]

| Field                  | Type   | Description                        |
| ---------------------- | ------ | ---------------------------------- |
| demographicData        | Object | Core consumer demographic details. |
| employmentHistory      | Array  | Employment history records.        |
| borrowerAddressHistory | Array  | Historical address details.        |
| nationalId             | String | Primary Ghana Card number.         |
| tin                    | Array  | Tax Identification Numbers.        |
| nhis                   | Array  | NHIS numbers.                      |
| ssnit                  | Array  | SSNIT numbers.                     |
| driverLicense          | Array  | Driver license numbers.            |
| passport               | Array  | Passport numbers.                  |
| voterId                | Array  | Voter ID numbers.                  |

###### Demographic Data Fields [#demographic-data-fields]

| Field        | Type   | Description             |
| ------------ | ------ | ----------------------- |
| ghanaCard    | String | Ghana Card number.      |
| fullName     | String | Full legal name.        |
| dateOfBirth  | String | Date of birth.          |
| gender       | String | Gender.                 |
| address      | String | Residential address.    |
| phoneNumbers | Array  | List of mobile numbers. |
| email        | String | Email address.          |

###### Employment History Fields [#employment-history-fields]

| Field                     | Type   | Description                                        |
| ------------------------- | ------ | -------------------------------------------------- |
| employmentType            | String | Nature of employment.                              |
| employerName              | String | Employer name.                                     |
| employerAddress1-4        | String | Address components.                                |
| employerAddressPostalCode | String | Postal code.                                       |
| dateOfEmployment          | String | Employment start date.                             |
| occupation                | String | Job role.                                          |
| employeePayrollNumber     | String | Payroll reference.                                 |
| Payroll reference         | String | Income currency.                                   |
| income                    | String | Income value (may be numeric formatted as string). |
| workTelephone             | String | Employer contact.                                  |

<br />

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

```js
{
    "message": "Your request for profile detail was successful",
    "code": 200,
    "data": {
        "records": [
            {
                "demographicData": {
                    "ghanaCard": "GHA-000000000-0",
                    "fullName": "John Doe",
                    "dateOfBirth": "1999-11-17",
                    "gender": "Male",
                    "address": "North, Eastern",
                    "phoneNumbers": [
                        "233000000000"
                    ],
                    "email": "john.doe@gmail.com"
                },
                "employmentHistory": [
                    {
                        "employmentType": "Self Employed",
                        "employerName": null,
                        "employerAddress1": null,
                        "employerAddress2": null,
                        "employerAddress3": null,
                        "employerAddress4": null,
                        "employerAddressPostalCode": null,
                        "dateOfEmployment": null,
                        "occupation": "Senior Software Engineer",
                        "employeePayrollNumber": null,
                        "incomeCurrency": "GHS",
                        "income": "1000",
                        "workTelephone": null
                    }
                ],
                "borrowerAddressHistory": [],
                "nationalId": "GHA-0000000000-0",
                "tin": [],
                "nhis": [],
                "ssnit": [
                    "E242489898902"
                ],
                "driverLicense": [],
                "passport": [],
                "voterId": [
                    "0000000000"
                ]
            }
        ]
    },
    "subCode": "0",
    "errors": null,
    "responseCode": null
}
```

<br />

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

The Score and Basic Debt 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 />
