> For the complete documentation index, see [llms.txt](https://docs.orangepill.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.orangepill.cloud/orangepill-api/kyc/didit.md).

# Didit

In order to use Didit as KYC provider, you have to follow the following steps:

* As Didit partner we walkthrough you on the onboarding process, on this process we will provide you a Didit dashboard with an admin user
* Once you have your Didit workspace you can register the Webhook to get session updates, [here](#notify) you can find more info about the endpoint to get session updates

<figure><img src="/files/684yqeV19iOFXep3uMLF" alt=""><figcaption></figcaption></figure>

* You can get the credentials to create KYC sessions through our API

<figure><img src="/files/LZ7wwHDjG3UxzfB4WGHG" alt=""><figcaption></figcaption></figure>

* Then you have to create a KYC record passing credentials

```bash
curl --location 'https://api.orangepill.cloud/v1/kycs' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ***' \
--data '{
    "provider": "didit",
    "baseUrl": "https://verification.didit.me",
    "authUrl": "https://apx.didit.me",
    "credentials": {
        "clientId": "***",
        "client_secret": "***"
    }
}'
```

```json
{
    "id": "67ee20bbdc4caf29375df067",
    "provider": "didit",
    "baseUrl": "https://verification.didit.me",
    "authUrl": "https://apx.didit.me",
    "createdAt": 1743659195718,
    "deleted": false
}
```

> You can't have multiple active KYC records for the same provider

* Finally you can create a session&#x20;

```json
curl --location 'https://api.orangepill.cloud/v1/kycs/session/didit' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ***' \
--data '{
    "parameters": {
        "result_url": "https://test.ngrok-free.app"
    }
}'
```

```json
{
    "id": "2f1ab476-2d3e-4b36-8016-b761b98ce741",
    "number": 29,
    "token": "***",
    "status": "Not Started",
    "session_url": "https://verify.didit.me/session/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NDM2NTkyMjcsImV4cCI6MTc0NDI2NDAyNywic2Vzc2lvbl9pZCI6IjJmMWFiNDc2LTJkM2UtNGIzNi04MDE2LWI3NjFiOThjZTc0MSJ9.tWnqWiZnrghkQ6R-RAnP4Ql_1Rf22qJhsBj_WZZuFs0",
    "result_url": "https://test.ngrok-free.app",
    "features": "OCR + FACE"
}
```

## API reference

To give you more clarity about KYC service we will split it in two:

* KYC: services to configure data needed to manage sessions
* Session: services to manage sessions

### KYC

#### Create

```bash
curl --location 'https://api.orangepill.cloud/v1/kycs' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ***' \
--data '{
    "provider": "didit",
    "baseUrl": "https://verification.didit.me",
    "authUrl": "https://apx.didit.me",
    "credentials": {
        "clientId": "***",
        "client_secret": "***"
    }
}'
```

```json
{
    "id": "67ee20bbdc4caf29375df067",
    "provider": "didit",
    "baseUrl": "https://verification.didit.me",
    "authUrl": "https://apx.didit.me",
    "createdAt": 1743659195718,
    "deleted": false
}
```

#### Update

```bash
curl --location --request PATCH 'https://api.orangepill.cloud/v1/kycs/:id
--header 'Content-Type: application/json' \
--header 'x-api-key: ***' \
--data '{
    "provider": "didit",
    "baseUrl": "https://verification.didit.me",
    "authUrl": "https://apx.didit.me",
    "credentials": {
        "clientId": "***",
        "client_secret": "***"
    }
}'
```

```json
{
    "id": "67ee20bbdc4caf29375df067",
    "provider": "didit",
    "baseUrl": "https://verification.didit.me",
    "authUrl": "https://apx.didit.me",
    "createdAt": 1743659195718,
    "updatedAt": 1743659929846,
    "deleted": false
}
```

#### Delete

```bash
curl --location --request DELETE 'https://api.orangepill.cloud/v1/kycs/:id' \
--header 'x-api-key: ***'
```

```json
"67ee20bbdc4caf29375df067"
```

#### Resolve

```bash
curl --location 'https://api.orangepill.cloud/v1/kycs/:id' \
--header 'x-api-key: ***'   
```

```json
{
    "id": "67ee20bbdc4caf29375df067",
    "provider": "didit",
    "baseUrl": "https://verification.didit.me",
    "authUrl": "https://apx.didit.me",
    "createdAt": 1743659195718,
    "updatedAt": 1743659929846,
    "deleted": false
}
```

#### List

```bash
curl --location 'https://api.orangepill.cloud/v1/kycs' \
--header 'x-api-key: ***'
```

```json
{
    "rows": [
        {
            "id": "67ee20bbdc4caf29375df067",
            "provider": "didit",
            "baseUrl": "https://verification.didit.me",
            "authUrl": "https://apx.didit.me",
            "createdAt": 1743659195718,
            "updatedAt": 1743659929846,
            "deleted": false
        }
    ],
    "total": 1,
    "page": 1,
    "pageSize": 10,
    "totalPages": 1
}
```

### Sessions

#### Create

```bash
curl --location 'https://api.orangepill.cloud/v1/kycs/session/:provider' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ***' \
--data '{
    "parameters": {
        "result_url": "https://test.ngrok-free.app"
    }
}'
```

```json
{
    "id": "2f1ab476-2d3e-4b36-8016-b761b98ce741",
    "number": 29,
    "token": "***",
    "status": "Not Started",
    "session_url": "https://verify.didit.me/session/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NDM2NTkyMjcsImV4cCI6MTc0NDI2NDAyNywic2Vzc2lvbl9pZCI6IjJmMWFiNDc2LTJkM2UtNGIzNi04MDE2LWI3NjFiOThjZTc0MSJ9.tWnqWiZnrghkQ6R-RAnP4Ql_1Rf22qJhsBj_WZZuFs0",
    "result_url": "https://test.ngrok-free.app",
    "features": "OCR + FACE"
}
```

#### Update

```bash
curl --location --request PATCH 'https://api.orangepill.cloud/v1/kycs/session/:provider/:id' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ***' \
--data '{
    "parameters": {
        "status": "approved",
        "comment": "test"
    }
}'
```

```json
{
    "id": "a0f6baf3-8c87-477e-9610-7da29d67dc42"
}
```

#### Get

```bash
curl --location 'https://api.orangepill.cloud/v1/kycs/session/:provider/:id' \
--header 'x-api-key: ***'
```

```json
{
    "id": "04150092-7adc-4620-b4e5-684eca447304",
    "number": 4,
    "status": "Approved",
    "session_url": "https://verify.didit.me/session/***",
    "result_url": null,
    "features": "OCR + FACE",
    "vendor_data": null
}
```

#### Generate PDF

```bash
curl --location 'https://api.orangepill.cloud/v1/kycs/session/:provider/:id/pdf' \
--header 'Content-Type: application/pdf' \
--header 'x-api-key: ***'
```

#### Notify

```bash
curl --location 'https://proxy.orangepill.cloud/v1/kycs/session/notify/:provider/:realm_key
--header 'Content-Type: application/json' \
--header 'x-api-key: ***' \
--data '{
    "created_at": 1747704352,
    "session_id": "4798642c-33d1-4492-813c-61d353b8f96d",
    "status": "Not Started",
    "timestamp": 1747704352,
    "vendor_data": "65c7e78d35e4fa63e35f3483"
}'
```

{% hint style="info" %}
This is and endpoint to be consumed exclusively for KYCs providers, you just have to register the url on Webhook section
{% endhint %}
