# Verification (/docs/api-documentation/complementary-apis/verification)



##### Overview [#overview]

The **Hubtel Verification API** allows you to verify your customer’s MSISDN name used in sim registration. Check the MSISDN Name Query for more info.

The **Hubtel Verification API** also allows you to check the Mobile Money wallet details of your customers. A merchant can verify details such as name and confirm if a customer is registered on mobile money. The following are the available channels through which a merchant can **verify mobile money details.**

| Mobile Money Provider | Channel Name |
| --------------------- | ------------ |
| MTN Ghana             | mtn-gh       |
| Telecel Ghana         | vodafone-gh  |
| AirtelTigo Ghana      | tigo-gh      |

<br />

The **Hubtel Verification API** also allows you to check the correctness of a user's Ghana ID or Voter ID details and get a name match score to help decide whether a customer is eligible for a business partnership.

<br />

The **Hubtel Verification API** also allows you to confirm a customer's bank and bank account name before transferring money. Check Bank Account Name query for more info.

<br />

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

<br />

###### Business IP Whitelisting [#business-ip-whitelisting]

You must share your public IP address with your Retail System Engineer for whitelisting.

> **Note**
> All API Endpoints are live and only requests from whitelisted IP(s) can reach these endpoints shared in this reference.
##### API Reference [#api-reference]

The **Hubtel Verification API** focuses on:

1. MSISDN Name Query.
2. Mobile Money Registration & Username Query.
3. Ghana ID Validation.
4. Voter ID Validation.
   MTN Chenosis API.
5. Bank Account Name Query.

<br />

##### MSISDN Name Query [#msisdn-name-query]

This endpoint can be used to query the MSISDN name used in sim registration.

To initiate a request, send an HTTP **GET** request to the below URL with the required parameters. Passing your **Collection Account Number** in the endpoint is also mandatory. Find your Collection Account Number [here](/docs/get-started/programmable-api-keys?curr_idx=3).

|              |                                                                                                                                                                                                                                                                                                  |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| API Endpoint | [https://cs.hubtel.com/commissionservices/\{'\{Collection_Account_Number}'}/3e0841e70afc42fb97d13d19abd36384?destination=\{'\{CustomerNumber}'}](https://cs.hubtel.com/commissionservices/\{'\{Collection_Account_Number}'}/3e0841e70afc42fb97d13d19abd36384?destination=\{'\{CustomerNumber}'}) |
| Request Type | **GET**                                                                                                                                                                                                                                                                                          |
| Content Type | **JSON**                                                                                                                                                                                                                                                                                         |

<br />

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

| Parameter                 | Type   | Requirement | Description                                                                                                                 |
| ------------------------- | ------ | ----------- | --------------------------------------------------------------------------------------------------------------------------- |
| Collection_Account_Number | Number | Mandatory   | The merchant's Hubtel **Collection Account Number**. Find yours [here](/docs/get-started/programmable-api-keys?curr_idx=3). |
| destination               | String | Mandatory   | The customer's phone number. <br /> Accepted formats: 0XXXXXXXXX / 233XXXXXXXXX E.g.: "0249111411" / "233249111411"         |

<br />

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

**HTTP**

  ```http
  GET commissionservices/11684/3e0841e70afc42fb97d13d19abd36384?destination=233501431586 HTTP/1.1
  Host: cs.hubtel.com
  Accept: application/json
  Content-Type: application/json
  Authorization: Basic endjeOBiZHhza250fT3==
  Cache-Control: no-cache
  ```

**cURL**

  ```bash
  curl --location 'https://cs.hubtel.com/commissionservices/11691/3e0841e70afc42fb97d13d19abd36384?destination=233501431586' \
  --header 'Authorization: Basic endjeOBiZHhza250fT3=='
  ```

**PHP**

  ```php
  <?php

  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://cs.hubtel.com/commissionservices/11691/3e0841e70afc42fb97d13d19abd36384?destination=233501431586',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => array(
      'Authorization: Basic endjeOBiZHhza250fT3=='
    ),
  ));

  $response = curl_exec($curl);

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

**Python**

  ```bash
  import requests

  url = "https://cs.hubtel.com/commissionservices/11691/3e0841e70afc42fb97d13d19abd36384?destination=233501431586"

  payload = {}
  headers = {
    'Authorization': 'Basic endjeOBiZHhza250fT3=='
  }

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

  print(response.text)
  ```

**JS**

  ```javascript
  const myHeaders = new Headers();
  myHeaders.append("Authorization", "Basic endjeOBiZHhza250fT3==");

  const requestOptions = {
    method: "GET",
    headers: myHeaders,
    redirect: "follow"
  };

  fetch("https://cs.hubtel.com/commissionservices/11691/3e0841e70afc42fb97d13d19abd36384?destination=233501431586", requestOptions)
    .then((response) => response.text())
    .then((result) => console.log(result))
    .catch((error) => console.error(error));
  ```

<br />

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

| Parameter    | Type          | Description                                                                             |
| ------------ | ------------- | --------------------------------------------------------------------------------------- |
| ResponseCode | String        | The unique response code on the status of the request                                   |
| Message      | String        | The status of the request                                                               |
| Label        | String        | The description of the response                                                         |
| Data         | ArrayOfObject | An array of object containing the required data response from the **Verification API**. |
| Display      | String        | The detail of the response displayed E.g "name"                                         |
| Value        | String        | The name resgistered on the SIM.                                                        |
| Amount       | Float         | A default decimal of 0.0 which is to be ignored.                                        |

<br />

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

```js
{
  "ResponseCode": "0000",
  "Message": "Customer Details",
  "Label": "Customer Details",
  "Data": [
    {
      "Display": "name",
      "Value": "JOSEPH ANNOH",
      "Amount": 0.0
    }
  ]
}
```

<br />

##### Mobile Money Registration & Username Query [#mobile-money-registration--username-query]

This endpoint can be used to query whether a number is registered on Mobile Money and get the username on the Mobile Money account.

To initiate a request, send an HTTP **GET** request to the below URL with the required parameters. Passing your **Collection Account Number** in the endpoint is also mandatory. Find your Collection Account Number [here](/docs/get-started/programmable-api-keys?curr_idx=3).

|              |                                                                                                                                                                                                                                                                                                                                                    |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API Endpoint | [https://rnv.hubtel.com/v2/merchantaccount/merchants/\{'\{Collection_Account_Number}'}/mobilemoney/verify?channel=\{'\{channel}'}\&customerMsisdn=\{'\{CustomerNumber}'}](https://rnv.hubtel.com/v2/merchantaccount/merchants/\{'\{Collection_Account_Number}'}/mobilemoney/verify?channel=\{'\{channel}'}\&customerMsisdn=\{'\{CustomerNumber}'}) |
| Request Type | **GET**                                                                                                                                                                                                                                                                                                                                            |
| Content Type | **JSON**                                                                                                                                                                                                                                                                                                                                           |

<br />

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

| Parameter                 | Type   | Requirement | Description                                                                                                         |
| ------------------------- | ------ | ----------- | ------------------------------------------------------------------------------------------------------------------- |
| Collection_Account_Number | Number | Mandatory   | The merchant's Collection Account Number. Find yours [here](/docs/get-started/programmable-api-keys?curr_idx=3).    |
| channel                   | String | Mandatory   | The mobile money channel provider. Available channels are: <br />**mtn-gh** <br />**vodafone-gh**<br />**tigo-gh**  |
| customerMsisdn            | String | Mandatory   | The customer’s mobile money number. Accepted formats: 0XXXXXXXXX / 233XXXXXXXXX E.g.: "0249111411" / "233249111411" |

<br />

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

**HTTP**

  ```http
  GET v2/merchantaccount/merchants/11684/mobilemoney/verify?channel=vodafone-gh&customerMsisdn=0501431586 HTTP/1.1
  Host: rnv.hubtel.com
  Accept: application/json
  Content-Type: application/json
  Authorization: Basic endjeOBiZHhza250fT3==
  Cache-Control: no-cache
  ```

**cURL**

  ```bash
  curl --location 'https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/mobilemoney/verify?channel=vodafone-gh&customerMsisdn=0501431586' \
  --header 'Authorization: Basic endjeOBiZHhza250fT3=='
  ```

**PHP**

  ```php
  <?php

  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/mobilemoney/verify?channel=vodafone-gh&customerMsisdn=0501431586',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => array(
      'Authorization: Basic endjeOBiZHhza250fT3=='
    ),
  ));

  $response = curl_exec($curl);

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

**Python**

  ```bash
  import requests

  url = "https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/mobilemoney/verify?channel=vodafone-gh&customerMsisdn=0501431586"

  payload = {}
  headers = {
    'Authorization': 'Basic endjeOBiZHhza250fT3=='
  }

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

  print(response.text)
  ```

**JS**

  ```javascript
  const myHeaders = new Headers();
  myHeaders.append("Authorization", "Basic endjeOBiZHhza250fT3==");

  const requestOptions = {
    method: "GET",
    headers: myHeaders,
    redirect: "follow"
  };

  fetch("https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/mobilemoney/verify?channel=vodafone-gh&customerMsisdn=0501431586", requestOptions)
    .then((response) => response.text())
    .then((result) => console.log(result))
    .catch((error) => console.error(error));
  ```

<br />

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

| Parameter    | Type    | Description                                                                                                                                                                       |
| ------------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| responseCode | String  | The unique response code on the status of the request                                                                                                                             |
| message      | String  | The status of the request                                                                                                                                                         |
| data         | Object  | An object containing the required data response from the **Verification API**.                                                                                                    |
| isRegistered | Boolean | States if a mobile wallet is registered.                                                                                                                                          |
| name         | String  | Registered name on the mobile money account                                                                                                                                       |
| status       | String  | The status of a mobile wallet                                                                                                                                                     |
| profile      | String  | This shows the profile of the number. **E.g.**<br />1. "Subscriber" means an individual<br />2. "Agent" means a mobile money vendor<br />3. "Merchant" means registered business. |

<br />

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

```js
{
  "message": "Success",
  "responseCode": "0000",
  "data": {
    "isRegistered": true,
    "name": "JOSEPH ANNOH",
    "status": "active",
    "profile": "Subscriber"
  }
}
```

> **Note**
> Kindly note that **V1** doesn’t have a Profile parameter. It is only available for **v2**.
<br />

##### Ghana ID Validation [#ghana-id-validation]

The **Hubtel Verification API** also allows you to check the correctness of a user's Ghana ID details and get a name match score to help decide whether a customer is eligible for a business partnership.

To initiate a request, send an HTTP **POST** request to the URL below with the required parameters. Passing your **Collection Account Number** in the endpoint is also mandatory. Find your Collection Account Number [here](/docs/get-started/programmable-api-keys?curr_idx=3).

|              |                                                                                                                                                                                                                  |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API Endpoint | [https://rnv.hubtel.com/v2/merchantaccount/merchants/\{'\{Collection_Account_Number}'}/ghanacard/verify](https://rnv.hubtel.com/v2/merchantaccount/merchants/\{'\{Collection_Account_Number}'}/ghanacard/verify) |
| Request Type | **POST**                                                                                                                                                                                                         |
| Content Type | **JSON**                                                                                                                                                                                                         |

<br />

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

| Parameter                 | Type   | Requirement | Description                                                                                                                          |
| ------------------------- | ------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| Collection_Account_Number | Number | Mandatory   | The merchant's Hubtel **Collection Account Number**. Find this [here](/docs/get-started/programmable-api-keys?curr_idx=3).           |
| ghanaCardNumber           | String | Mandatory   | The customer's Ghana Card number. <br />The accepted format for the ghanacard same as printed on the card. E.g.: **GHA-7XXXXXXXX-0** |
| surname                   | String | Mandatory   | The surname of the customer as printed on the card.                                                                                  |
| firstnames                | String | Mandatory   | The first name(s) of the customer as printed on the card.                                                                            |
| gender                    | String | Mandatory   | Gender of customer.                                                                                                                  |
| dateOfBirth               | String | Mandatory   | Date of birth of the customer. Accepted format: **dd/mm/yyyy**                                                                       |

<br />

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

**HTTP**

  ```http
  POST v2/merchantaccount/merchants/11684/ghanacard/verify HTTP/1.1
  Host: rnv.hubtel.com
  Accept: application/json
  Content-Type: application/json
  Authorization:Basic endjBiZHhza250fT==
  Cache-Control: no-cache

  {
    "ghanaCardNumber": "GHA-000000000-0",
    "surname": "Doe",
    "firstnames": "John",
    "gender": "male",
    "dateOfBirth": "dd/mm/yyyy"
  }
  ```

**cURL**

  ```bash
  curl --location 'https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/ghanacard/verify' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Basic endjBiZHhza250fT==' \
  --data '{
      "ghanaCardNumber": "GHA-000000000-0",
      "surname": "Doe",
      "firstnames": "John",
      "gender": "male",
      "dateOfBirth": "dd/mm/yyyy"
  }'
  ```

**PHP**

  ```php
  <?php

  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/ghanacard/verify',
    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 =>'{
      "ghanaCardNumber": "GHA-000000000-0",
      "surname": "Doe",
      "firstnames": "John",
      "gender": "male",
      "dateOfBirth": "dd/mm/yyyy"
  }',
    CURLOPT_HTTPHEADER => array(
      'Content-Type: application/json',
      'Authorization: Basic endjBiZHhza250fT=='
    ),
  ));

  $response = curl_exec($curl);

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

**Python**

  ```bash
  import requests
  import json

  url = "https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/ghanacard/verify"

  payload = json.dumps({
    "ghanaCardNumber": "GHA-000000000-0",
    "surname": "Doe",
    "firstnames": "John",
    "gender": "male",
    "dateOfBirth": "dd/mm/yyyy"
  })
  headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Basic endjBiZHhza250fT=='
  }

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

  print(response.text)
  ```

**JS**

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

  const raw = JSON.stringify({
    "ghanaCardNumber": "GHA-000000000-0",
    "surname": "Doe",
    "firstnames": "John",
    "gender": "male",
    "dateOfBirth": "dd/mm/yyyy"
  });

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

  fetch("https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/ghanacard/verify", requestOptions)
    .then((response) => response.text())
    .then((result) => console.log(result))
    .catch((error) => console.error(error));
  ```

<br />

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

| Parameter    | Type    | Description                                                                                                         |
| ------------ | ------- | ------------------------------------------------------------------------------------------------------------------- |
| message      | String  | The status of the request.                                                                                          |
| responseCode | String  | The unique response code on the status of the request.                                                              |
| data         | Object  | An object containing the required data response from the **Verification API**.                                      |
| isValid      | Boolean | **true** or **false**. Can be true when all provided details match and can be false when some details do not match. |
| score        | String  | The match percentage between the provided names and the names on the customer's Ghana ID.                           |

<br />

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

```js
{
  "message": "Success",
  "responseCode": "0000",
  "data": {
      "isValid": true,
      "score": "100%"
  }
}
```

<br />

###### SAMPLE QUERY RESPONSE (NOT FOUND) [#sample-query-response-not-found]

```js
{
  "message": "Not found",
  "responseCode": "3000",
  "data": null
}
```

<br />

##### Voter ID Validation [#voter-id-validation]

The **Hubtel Verification API** also allows you to check the correctness of a user's Voter ID details and get a name match score to help decide whether a customer is eligible for a business partnership.

To initiate a request, send an HTTP **POST** request to the URL below with the required parameters. Passing your **Collection Account Number** in the endpoint is also mandatory. Find your Collection Account Number [here](/docs/get-started/programmable-api-keys?curr_idx=3).

|              |                                                                                                                                                                                                                      |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API Endpoint | [https://rnv.hubtel.com/v2/merchantaccount/merchants/\{'\{Collection_Account_Number}'}/voteridcard/verify](https://rnv.hubtel.com/v2/merchantaccount/merchants/\{'\{Collection_Account_Number}'}/voteridcard/verify) |
| Request Type | **POST**                                                                                                                                                                                                             |
| Content Type | **JSON**                                                                                                                                                                                                             |

<br />

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

| Parameter                 | Type   | Requirement | Description                                                                                                                  |
| ------------------------- | ------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Collection_Account_Number | Number | Mandatory   | The merchant's Hubtel **Collection Account Number**. Find this [here](/docs/get-started/programmable-api-keys?curr_idx=3).   |
| voterIdCardNumber         | String | Mandatory   | The customer's Voter ID number. <br />The accepted format for the Voter ID same as printed on the card. E.g.: **61610xxxx2** |
| surname                   | String | Mandatory   | The surname of the customer as printed on the card.                                                                          |
| othernames                | String | Mandatory   | The other name(s) of the customer as printed on the card.                                                                    |
| sex                       | String | Mandatory   | Gender of customer.                                                                                                          |
| dateOfBirth               | String | Mandatory   | Date of birth of the customer. Accepted format: **yyyy/mm/dd**                                                               |

<br />

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

**HTTP**

  ```http
  POST v2/merchantaccount/merchants/11684/voteridcard/verify HTTP/1.1
  Host: rnv.hubtel.com
  Accept: application/json
  Content-Type: application/json
  Authorization:Basic endjBiZHhza250fT==
  Cache-Control: no-cache

  {
    "voterIdCardNumber": "0000000000",
    "surname": "Doe",
    "othernames": "John",
    "sex": "male",
    "dateOfBirth": "yyyy/mm/dd"
  }
  ```

**cURL**

  ```bash
  curl --location 'https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/voteridcard/verify' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Basic endjBiZHhza250fT==' \
  --data '{
      "voterIdCardNumber": "0000000000",
      "surname": "Doe",
      "othernames": "John",
      "sex": "male",
      "dateOfBirth": "yyyy/mm/dd"
  }'
  ```

**PHP**

  ```php
  <?php

  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/voteridcard/verify',
    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 =>'{
      "voterIdCardNumber": "0000000000",
      "surname": "Doe",
      "othernames": "John",
      "sex": "male",
      "dateOfBirth": "yyyy/mm/dd"
  }',
    CURLOPT_HTTPHEADER => array(
      'Content-Type: application/json',
      'Authorization: Basic endjBiZHhza250fT=='
    ),
  ));

  $response = curl_exec($curl);

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

**Python**

  ```bash
  import requests
  import json

  url = "https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/voteridcard/verify"

  payload = json.dumps({
    "voterIdCardNumber": "0000000000",
    "surname": "Doe",
    "othernames": "John",
    "sex": "male",
    "dateOfBirth": "yyyy/mm/dd"
  })
  headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Basic endjBiZHhza250fT=='
  }

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

  print(response.text)
  ```

**JS**

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

  const raw = JSON.stringify({
    "voterIdCardNumber": "0000000000",
    "surname": "Doe",
    "othernames": "John",
    "sex": "male",
    "dateOfBirth": "yyyy/mm/dd"
  });

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

  fetch("https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/voteridcard/verify", requestOptions)
    .then((response) => response.text())
    .then((result) => console.log(result))
    .catch((error) => console.error(error));
  ```

<br />

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

| Parameter    | Type    | Description                                                                                                         |
| ------------ | ------- | ------------------------------------------------------------------------------------------------------------------- |
| message      | String  | The status of the request.                                                                                          |
| responseCode | String  | The unique response code on the status of the request.                                                              |
| data         | Object  | An object containing the required data response from the **Verification API**.                                      |
| isValid      | Boolean | **true** or **false**. Can be true when all provided details match and can be false when some details do not match. |
| score        | String  | The match percentage between the provided names and the names on the customer's Voter ID.                           |

<br />

###### SAMPLE QUERY RESPONSE [#sample-query-response-1]

```js
{
  "message": "Success",
  "responseCode": "0000",
  "data": {
      "isValid": true,
      "score": "100%"
  }
}
```

<br />

###### SAMPLE QUERY RESPONSE (NOT FOUND) [#sample-query-response-not-found-1]

```js
{
  "message": "Not found",
  "responseCode": "3000",
  "data": null
}
```

<br />

##### MTN Chenosis API [#mtn-chenosis-api]

The **Hubtel Verification API** also allows you to check the validity of a customer’s basic details e.g.: date of birth, gender, etc., and help decide whether a customer is eligible for a business partnership, etc. by using the Customer's MTN MSISDN.

To initiate a request, send an HTTP **GET** request to the URL below with the required parameters. Passing your **Collection Account Number** in the endpoint is also mandatory. Find your Collection Account Number [here](/docs/get-started/programmable-api-keys?curr_idx=3).

|              |                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API Endpoint | [https://rnv.hubtel.com/v2/merchantaccount/merchants/\{'\{Collection_Account_Number}'}/idcard/verify?idtype=ghanacard\&idnumber=\{'\{CustomerMsisdn}'}\&network=MTN\&consentType=\{'\{consentType}'}](https://rnv.hubtel.com/v2/merchantaccount/merchants/\{'\{Collection_Account_Number}'}/idcard/verify?idtype=ghanacard\&idnumber=\{'\{CustomerMsisdn}'}\&network=MTN\&consentType=\{'\{consentType}'}) |
| Request Type | **GET**                                                                                                                                                                                                                                                                                                                                                                                                    |
| Content Type | **JSON**                                                                                                                                                                                                                                                                                                                                                                                                   |

<br />

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

| Parameter                 | Type   | Requirement | Description                                                                                                                |
| ------------------------- | ------ | ----------- | -------------------------------------------------------------------------------------------------------------------------- |
| Collection_Account_Number | Number | Mandatory   | The merchant's Hubtel **Collection Account Number**. Find this [here](/docs/get-started/programmable-api-keys?curr_idx=3). |
| idnumber                  | String | Mandatory   | The customer's MTN number. Accepted formats: **233XXXXXXXXX** and **0XXXXXXXXX**                                           |
| consentType               | String | Optional    | The preferred consent type. Options include: <br />1. **sms** <br />2. **ussd**                                            |

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

**HTTP**

  ```http
  GET v2/merchantaccount/merchants/11684/idcard/verify?idtype=ghanacard&idnumber=233XXXXXXXXX&network=MTN&consentType=ussd HTTP/1.1
  Host: rnv.hubtel.com
  Accept: application/json
  Content-Type: application/json
  Authorization:Basic endjBiZHhza250fT==
  Cache-Control: no-cache
  ```

**cURL**

  ```bash
  curl --location 'https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/idcard/verify?idtype=ghanacard&idnumber=233XXXXXXXXX&network=MTN&consentType=ussd' \
  --header 'Authorization: Basic endjBiZHhza250fT=='
  ```

**PHP**

  ```php
  <?php

  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/idcard/verify?idtype=ghanacard&idnumber=233XXXXXXXXX&network=MTN&consentType=ussd',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => array(
      'Authorization: Basic endjBiZHhza250fT=='
    ),
  ));

  $response = curl_exec($curl);

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

**Python**

  ```bash
  import requests

  url = "https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/idcard/verify?idtype=ghanacard&idnumber=233XXXXXXXXX&network=MTN&consentType=ussd"

  payload = {}
  headers = {
    'Authorization': 'Basic endjBiZHhza250fT=='
  }

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

  print(response.text)
  ```

**JS**

  ```javascript
  const myHeaders = new Headers();
  myHeaders.append("Authorization", "Basic endjBiZHhza250fT==");

  const requestOptions = {
    method: "GET",
    headers: myHeaders,
    redirect: "follow"
  };

  fetch("https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/idcard/verify?idtype=ghanacard&idnumber=233XXXXXXXXX&network=MTN&consentType=ussd", requestOptions)
    .then((response) => response.text())
    .then((result) => console.log(result))
    .catch((error) => console.error(error));
  ```

<br />

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

| Parameter    | Type   | Description                                                                    |
| ------------ | ------ | ------------------------------------------------------------------------------ |
| message      | String | The status of the request.                                                     |
| responseCode | String | The unique response code on the status of the request.                         |
| data         | Object | An object containing the required data response from the **Verification API**. |
| name         | String | Registered name on the Ghana Card.                                             |
| dateOfBirth  | String | Date of birth of the Cardholder.                                               |
| gender       | String | Gender of Cardholder.                                                          |
| nationalId   | String | Ghana Card Identification number.                                              |

<br />

###### SAMPLE QUERY RESPONSE [#sample-query-response-2]

```js
{
  "message": "Success",
  "responseCode": "0000",
  "data": {
    "name": "JOHN DONATUS MILLS",
    "dateOfBirth": "1984 June 23",
    "gender": "MALE",
    "nationalId": "GHA-000000000-0"
  }
}
```

<br />

###### SAMPLE QUERY RESPONSE (NOT FOUND) [#sample-query-response-not-found-2]

```js
{
  "message": "Not found",
  "responseCode": "3000",
  "data": null
}
```

<br />

##### Bank Account Name Query [#bank-account-name-query]

This endpoint can be used to confirm a customer's bank and bank account name before transferring money.

The following are **available Bank channels** through which a merchant can **query** a bank account name associated with a bank account number on Hubtel.

| Bank Channel                  | BankCode |
| ----------------------------- | -------- |
| STANDARD CHARTERED BANK       | 300302   |
| ABSA BANK GHANA LIMITED       | 300303   |
| GCB BANK LIMITED              | 300304   |
| NATIONAL INVESTMENT BANK      | 300305   |
| ARB APEX BANK LIMITED         | 300306   |
| AGRICULTURAL DEVELOPMENT BANK | 300307   |
| UNIVERSAL MERCHANT BANK       | 300309   |
| REPUBLIC BANK LIMITED         | 300310   |
| ZENITH BANK GHANA LTD         | 300311   |
| ECOBANK GHANA LTD             | 300312   |
| CAL BANK LIMITED              | 300313   |
| FIRST ATLANTIC BANK           | 300316   |
| PRUDENTIAL BANK LTD           | 300317   |
| STANBIC BANK                  | 300318   |
| FIRST BANK OF NIGERIA         | 300319   |
| BANK OF AFRICA                | 300320   |
| GUARANTY TRUST BANK           | 300322   |
| FIDELITY BANK LIMITED         | 300323   |
| SAHEL - SAHARA BANK (BSIC)    | 300324   |
| UNITED BANK OF AFRICA         | 300325   |
| ACCESS BANK LTD               | 300329   |
| CONSOLIDATED BANK GHANA       | 300331   |
| FIRST NATIONAL BANK           | 300334   |
| GHL BANK                      | 300362   |

<br />

To initiate a request, send an HTTP **GET** request to the below URL with the required parameters. Passing your **Collection Account Number** in the endpoint is also mandatory. Find your Collection Account Number [here](/docs/get-started/programmable-api-keys?curr_idx=3).

<br />

|              |                                                                                                                                                                                                                                                                                              |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API Endpoint | [https://rnv.hubtel.com/v2/merchantaccount/merchants/\{'\{Collection_Account_Number}'}/bank/verify/\{'\{bankcode}'}/\{'\{bankAccountNumber}'}](https://rnv.hubtel.com/v2/merchantaccount/merchants/\{'\{Collection_Account_Number}'}/bank/verify/\{'\{bankcode}'}/\{'\{bankAccountNumber}'}) |
| Request Type | **GET**                                                                                                                                                                                                                                                                                      |
| Content Type | **JSON**                                                                                                                                                                                                                                                                                     |

<br />

###### SAMPLE REQUEST(BANK ACCOUNT QUERY) [#sample-requestbank-account-query]

**HTTP**

  ```http
  GET v2/merchantaccount/merchants/11684/bank/verify/300312/144100225608 HTTP/1.1
  Host: rnv.hubtel.com
  Accept: application/json
  Content-Type: application/json
  Authorization:Basic endjBiZHhza250fT==
  Cache-Control: no-cache
  ```

**cURL**

  ```bash
  curl --location 'https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/bank/verify/300312/144100225608' \
  --header 'Authorization: Basic endjBiZHhza250fT=='
  ```

**PHP**

  ```php
  <?php

  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/bank/verify/300312/144100225608',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => array(
      'Authorization: Basic endjBiZHhza250fT=='
    ),
  ));

  $response = curl_exec($curl);

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

**Python**

  ```bash
  import requests

  url = "https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/bank/verify/300312/144100225608"

  payload = {}
  headers = {
    'Authorization': 'Basic endjBiZHhza250fT=='
  }

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

  print(response.text)
  ```

**JS**

  ```javascript
  const myHeaders = new Headers();
  myHeaders.append("Authorization", "Basic endjBiZHhza250fT==");

  const requestOptions = {
    method: "GET",
    headers: myHeaders,
    redirect: "follow"
  };

  fetch("https://rnv.hubtel.com/v2/merchantaccount/merchants/11684/bank/verify/300312/144100225608", requestOptions)
    .then((response) => response.text())
    .then((result) => console.log(result))
    .catch((error) => console.error(error));
  ```

<br />

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

| Parameter    | Type   | Description                                                                    |
| ------------ | ------ | ------------------------------------------------------------------------------ |
| responseCode | String | The unique response code on the status of the request                          |
| message      | String | The status of the request                                                      |
| data         | Object | An object containing the required data response from the **Verification API**. |
| name         | String | Registered name of the Bank Account.                                           |

###### SAMPLE SUCCESSFUL QUERY RESPONSE [#sample-successful-query-response]

```js
{
  "message": "Success",
  "responseCode": "0000",
  "data": {
    "name": "JOHN DOE"
  }
}
```

<br />

###### SAMPLE FAILED QUERY RESPONSE [#sample-failed-query-response]

```js
{
  "message": "We're sorry, we could not verify this account. Do you want to save anyway?",
  "responseCode": "2001",
  "data": null
}
```

<br />

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

The Hubtel Recurring Payments 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

| HTTP Status Code | ResponseCode | Description                                                                                                                                                       | Required Action                                                                                                                                                     |
| ---------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 200              | 0000         | The request has been processed successfully                                                                                                                       | None                                                                                                                                                                |
| 424              | 2001         | Failed dependency                                                                                                                                                 | Data currently not available and might take a while to sync with external source                                                                                    |
| 400              | 2001         | We're sorry, we could not verify this account. Do you want to save anyway?                                                                                        | Kindly pass a valid account number                                                                                                                                  |
| 404              | 3000 / 2001  | - AirtelTigo Exception. Invalid Account <br /> - Vodafone Exception. Invalid Account <br /> - MTN Exception. Account holder with FRI Not Found <br /> - Not found | - Number not registered with Telco <br /> - Card might be newly issued or invalid. The cardholder would have to reach out to the card issuer for further assistance |
| 400              | 4000         | Missing required parameter CustomerMsisdn                                                                                                                         | Try again with a well-formed valid request                                                                                                                          |
