> For the complete documentation index, see [llms.txt](https://legacy-docs.usesmileid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-docs.usesmileid.com/integration-options/server-to-server/php/products/enhanced-kyc.md).

# Enhanced KYC

Required Class: **ID Api Class**

## Running Enhanced KYC on PHP

1. Get your Smile ID `Partner ID`
2. Get your API Key (take note of the environment you are running the job in)
3. Get the ID information from your users
4. Submit the Job to Smile ID
5. Interpret your results

### Get your Partner ID

You can find your Partner ID in the menu list when logged into [the portal](https://portal.usesmileid.com/partner/dashboard).

![](/files/5bAEvct4lkb2MvYp3h3I)

### Get your API Key

Your api key is in the developer section of [the portal.](https://portal.usesmileid.com/api-key)

* Click on the **Generate New API Key** button
* Copy your api key (ensure you are in the right environment)

![Generate a new API Key](/files/5de0FSBPKuA9KoRJZ0Gj)

![Copy your API Key](/files/GUr0iFqBeWmWdAmCfph2)

### Get the ID information from your users

To submit an Enhanced KYC job you need the ID information of your user. Depending on the ID type you are attempting to query, the required information varies. For the comprehensive list of required information for each ID Type, check the [Supported ID Types](/supported-id-types/for-individuals-kyc/backed-by-id-authority.md) section of the docs.

### Submit the Job to Smile ID

You can copy the sample code below and edit with your partner and job details.

```php
<?php
require 'vendor/autoload.php';

// Initialize
$partner_id = "<Put your partner ID here>"; // login to the Smile ID portal to view your partner id
$default_callback = "<Put your default callback here>"; //callback is only required if you are running an asynchronous job
$api_key = "<Put your API key here>"; // copy your API key from the Smile ID portal
$sid_server = "<0 or 1>"; // Use '0' for the sandbox server, use '1' for production server

$connection = new IdApi(
    $partner_id,
    $default_callback,
    $api_key,
    $sid_server
);

// Create required tracking parameters
$partner_params = array(
    'job_id' => "<put your unique job ID here>",
    'user_id' => "<put your unique ID for the user here>",
    'job_type' => 5
);

// Create ID info
$id_info = array(
    'first_name' => "<name>",
    'middle_name' => "<middle>",
    'last_name' => "<surname>",
    'country' => "<2-letter country code>",
    'id_type' => "<id type>",
    'id_number' => "<valid id number>", // Always required
    'dob' => "<date of birth>", // yyyy-mm-dd
    'entered' => "true" // MUST BE A STRING
);

// Set the options for the job
$options = array(
    'use_async' => <true | false>, // Set to true if you want to run the job asynchronously, you will be required to provide a callback in the $default_callback variable above
    'signature' => true
);

// Submit the job
// This method returns a json array
$result = $connection->submit_job($partner_params, $id_info, $options);
?>p
```

**Example Response Body**

Your response will return a JSON array containing the below:

```json
{
  "SmileJobID": "0000001105",
  "PartnerParams": {
    "user_id": "T6yzdOezucdsPrY0QG9LYNDGOrC",
    "job_id": "FS1kd1dd15JUpd87gTBDapvFxv0",
    "job_type": 5
  },
  "ResultText": "ID Number Validated",
  "ResultCode": "1012",
  "Actions": {
    "Verify_ID_Number": "Verified",
    "Return_Personal_Info": "Returned"
  },
  "Country": "NG",
  "IDType": "DRIVERS_LICENSE",
  "IDNumber": "ABC000000000",
  "ExpirationDate": "2017-10-28",
  "FullName": "John Doe",
  "DOB": "1900-09-20",
  "Photo": "SomeBase64Image",
  "signature": "iWyc...P0=",
  "timestamp": "2022-03-13T11:44:10.231Z"
}
```

### Interpret your Results

You can read more about result codes and responses in the [Enhanced KYC](/products/for-individuals-kyc/identity-lookup.md) section of the docs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://legacy-docs.usesmileid.com/integration-options/server-to-server/php/products/enhanced-kyc.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
