# WebView or iFrame

## 📥 Integration URL

Your integration URL should follow this structure:

```
https://{baseUrl}/v2/onboarding/{uuid}?product=productName&externalId=xxxxxx&partnerName=companyName&type=kyc
```

Parameters:

<table><thead><tr><th>parameters</th><th>Description</th><th width="116.6953125">required</th></tr></thead><tbody><tr><td>uuid</td><td>Unique identifier for the onboarding session, provided by Danaya.</td><td>yes</td></tr><tr><td>product</td><td>The product type</td><td>yes</td></tr><tr><td>type</td><td>The onboarding type: kyc (individual) or kyb (business).</td><td>yes</td></tr><tr><td>externalId</td><td>Your internal user ID — used to match this onboarding session with your user.</td><td>yes</td></tr><tr><td>partnerName</td><td>Your partner identifier — used to verify your access.</td><td>yes</td></tr><tr><td>baseUrl</td><td>prod:app.danaya.africa<br>demo: demo.danaya.africa</td><td>yes</td></tr></tbody></table>

## ✅ Completion Callback

Once the user completes (or cancels) the onboarding flow, we redirect to:

```
https://{baseUrl}/v2/onboarding/end?isSuccess=true&requestId=uuid-verfication-request
```

| parameters | Description                                                                                                                                                                                |   |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | - |
| isSuccess  | **true** is the documents are sent successfully and **false** if not                                                                                                                       |   |
| requestId  | <p>the file-verification-uuid. This will allow you to fetch the documents verification results.<br><br>See this <a href="/pages/yJYQCbKGlBQ20sbFtKlH">page</a> to how to use this id. </p> |   |

## Optional: JavaScript Event

We can also emit a JavaScript event if you’re embedding in an iframe:

```
window.addEventListener("message", (event) => {
  if (event.data === "danaya:onboarding:complete") {
    // Close iframe or take appropriate action
    // do something with event.payload...
  }
});
```

Let us know if you’d like to use this event-based approach.

## 📄 Required Documents

Depending on the onboarding type (kyc or kyb), the user will need to provide specific documents:<br>

**KYC (Individual)**

* Selfie (required)

One of the following:

* National ID (CNI)
* Resident Permit
* Passport

**KYB (Business)**

* Selfie (required)

One of the following:

* National ID (CNI)
* Resident Permit
* Passport

And company document

* RCCM (required)
* DFE (optional)

## 📡 Verification Results

#### 1. Webhook

* We will send verification results to the webhook URL you provided during onboarding setup.

#### 2. API Access

* You can retrieve the verification results using either:
  * The requestId returned upon form submission [here](/documentation/integration-mode/rest-api/retrieve-document-verification-result.md#retrieve-a-kyc-or-kyb-analysis-result-v2)
  * The externalId you used during initialization [here](/documentation/integration-mode/rest-api/retrieve-document-verification-result.md#retrieve-a-kyc-or-kyb-analysis-result-by-externalid)

## 🔁 Handling Duplicates

* You can safely initiate multiple onboarding sessions using the same externalId.
* When retrieving verification results by externalId, we will return only the most recent verification associated with it.

#### 🚫 If a document is reused under a different externalId:

If a user uploads the same identity document with a new externalId, we will return an error when you try to retrieve the results:

```json
{
  "code": "DUPLICATED_EXTERNAL_IDS",
  "duplicatedExternalIds": [
    "externalId-1",
    "externalId-2"
  ]
}
```

This indicates that the same document has already been processed under different externalIds.

##

## ❓Questions ?

If you have any questions or need help with the integration, please reach out to our team at <support@danaya.africa>.


---

# Agent Instructions: 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:

```
GET https://docs.danaya.africa/documentation/integration-mode/webview-or-iframe.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
