### React Example for Web SDK Integration Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2393604111/Legacy%2BWeb%2BSDK%2BKYC%2Bintegration%2Bv1 An example demonstrating the integration of the Ondato Web SDK within a React application. This typically involves importing the SDK and utilizing its functions for KYC flows, potentially using generated or setup IDs. ```javascript // React example using npm package // Assuming idvSdk is imported and initialized // const idvSdk = new OndatoPublicIdvSdk(); // Example of generating an IDV ID and starting the flow // idvSdk.generateIdvId().then(idvId => { // idvSdk.startKycFlow(idvId); // }).catch(error => { // console.error('Error generating IDV ID:', error); // }); // Example using setupId (where IDV ID is generated automatically) // idvSdk.startKycFlow(null, { setupId: 'your_setup_id' }).catch(error => { // console.error('Error starting KYC flow:', error); // }); ``` -------------------------------- ### Initialize and Use Ondato SDK in React (TypeScript) Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/3015540737/Web%2BSDK%2BCustomer%2BOnboarding%2BKYC%2Bintegration%2Bv2 This example demonstrates how to load, begin, and manage the Ondato identity verification SDK within a React application using TypeScript. It includes handlers for SDK loading, starting the verification process with success, failure, and close callbacks, and retrieving the SDK version. Input fields are provided for setup ID, IDV ID, and language. ```typescript import { memo, ReactElement, useCallback, useState } from 'react'; import { SdkLanguage, load, SdkMode, version, SdkLoadResult, SdkOnSuccessResult, SdkOnFailureResult, SdkOnCloseResult } from '@ondato-public/idv-sdk'; export const AppNew = memo((): ReactElement => { const [idvSetupId, setIdvSetupId] = useState(''); const [idvId, setIdvId] = useState(''); const [language, setLanguage] = useState(''); const [sdkIdv, setSdkIdv] = useState(null); const [isLoaded, setIsLoaded] = useState(false); const loadHandler = useCallback(() => { try { const idv = load({ mode: SdkMode.Production, }); setSdkIdv(idv); setIsLoaded(true); } catch (error) { console.warn('IdvSdkLoadFailure', error); alert(`IdvSdkLoadFailure, ${error}`); } }, []); const beginHandler = useCallback(async () => { try { if (sdkIdv?.idv.begin) { await sdkIdv.idv.begin({ idvSetupId: idvSetupId.trim(), idvId: idvId.trim(), language: language.trim() as SdkLanguage, onSuccess: (props: SdkOnSuccessResult) => { console.log('onSuccess', { idvId: props.id }); alert(`onSuccess, idvId: ${props.id}`); }, onFailure: (props: SdkOnFailureResult) => { console.log('onFailure', { idvId: props.id, reason: props.reason, }); alert(`onFailure, idvId: ${props.id}, reason: ${props.reason}}`); }, onClose: (props: SdkOnCloseResult) => { console.log('onClose ', props.id); }, }); } } catch (error) { console.warn('IdvSdkBeginFailure', error); alert(`IdvSdkBeginFailure, ${error}`); } }, [idvId, sdkIdv, idvSetupId, language]); const versionHandler = useCallback(() => { alert(version()); }, []); const endHandler = useCallback(() => { sdkIdv?.idv.end(); }, [sdkIdv]); return ( <>
setIdvSetupId(event.target.value)} /> setIdvId(event.target.value)} /> setLanguage(event.target.value)} />
); }); ``` -------------------------------- ### SDK Begin Failure Exceptions Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2969042947/Web%2BSDK%2BOnAge%2Bintegration This enum defines possible failure reasons when starting an SDK session using `exampleSdk.onAge.begin()`. These include issues like missing setup IDs, inability to use in iframes, invalid modes, or multiple processes starting simultaneously. ```typescript declare enum SdkBeginFailure { NoOnAgeSetupId = 'NoOnAgeSetupId', CantBeUsedInIframe = "CantBeUsedInIframe", // Consumer cannot use this sdk in iframe. We restrict usage due to requiring full screen NoIdvId = "NoIdvId", // idvId or idv setup id was not provided NotSupportedMode = "NotSupportedMode",// check if provided mode is invalid according to SdkMode ProcessStarted = "ProcessStarted", // if multiple sdk begin were started error. You cannot start multiple identifications in the same page simultaniously. StartFailed = "StartFailed" // if sdk applications has crashed for some reason when trying to initially load the sdk application. Due to nework error etc. } ``` -------------------------------- ### Load and Begin Ondato SDK Session (TypeScript React) Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/edit-v2/2969042947 This example demonstrates how to load and initiate an OnAge SDK session using TypeScript and React. It includes handlers for loading the SDK, beginning a session with success, failure, and close callbacks, checking the SDK version, and ending a session. It also includes input fields for the setup ID and language. ```typescript import { memo, ReactElement, useCallback, useState } from 'react'; import { IdvLanguage, load, SdkMode, version, SdkLoadResult, SdkOnSuccessResult, SdkOnFailureResult, SdkOnCloseResult } from '@ondato-public/idv-sdk'; export const AppNew = memo((): ReactElement => { const [onAgeSetupId, setOnAgeSetupId] = useState(''); const [language, setLanguage] = useState(''); const [sdkOnAge, setSdkOnAge] = useState(null); const [isLoaded, setIsLoaded] = useState(false); const loadHandlerOnage = useCallback(() => { try { const onAge = load({ mode: SdkMode.Sandbox, }); setSdkOnAge(onAge); setIsLoaded(true); } catch (error) { console.warn('OnageSdkLoadFailure', error); alert(`OnageSdkLoadFailure, ${error}`); } }, []); const beginHandlerOnAge = useCallback(async () => { try { if (sdkOnAge?.onAge.begin) { await sdkOnAge.onAge.begin({ onAgeSetupId: onAgeSetupId.trim(), language: language.trim() as IdvLanguage, onSuccess: (props: SdkOnSuccessResult) => { console.log('onSuccess', { props }); alert(`onSuccess, OnAge: ${props}`); }, onFailure: (props: SdkOnFailureResult) => { console.log('onFailure', props); alert(`onFailure, OnAge: ${props}, reason: ${props}}`); }, onClose: (props: SdkOnCloseResult) => { console.log('onClose ', props.id); }, }); } } catch (error) { console.warn('OnAgeSdkBeginFailure', error); alert(`OnAgeSdkBeginFailure, ${error}`); } }, [sdkOnAge?.onAge, onAgeSetupId, language]); const versionHandler = useCallback(() => { alert(version()); }, []); const endHandlerOnAge = useCallback(() => { sdkOnAge?.onAge.end(); }, [sdkOnAge]); return ( <>
setOnAgeSetupId(event.target.value)} /> setLanguage(event.target.value)} />
); }); ``` -------------------------------- ### Start monitoring a business Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2414837779/Business%2BAML%2BMonitoring Adds a business to the monitoring worklist to start monitoring. ```APIDOC ## POST /v1/worklists/{worklistId}/legal-entity-records ### Description Adds a business to the monitoring worklist. ### Method POST ### Endpoint /v1/worklists/{worklistId}/legal-entity-records ### Parameters #### Path Parameters - **worklistId** (string) - YES - The unique Id of the worklist. #### Headers - **Correlation-Id** (string) - NO - A unique identifier assigned to the request. - **Application-Id** (string) - NO - Your application Id. Please contact support@ondato.com if you don’t have one. - **Access token** (string) - YES - Described in the Authentication part #### Request Body - **name** (string) - YES - The name of the business. - **referenceId** (string) - NO - A unique identifier for the business's reference in the system. - **referenceType** (string) - NO - User created reference for the business in the system, for example "My Reference". ### Response #### Success Response (201) - **id** (string) - The `recordId` of the business for subsequent calls. #### Response Example ```json { "id": "some-business-record-id" } ``` ``` -------------------------------- ### Start IDV Session with IDV Setup ID or IDV ID Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2393604111/Legacy%2BWeb%2BSDK%2BKYC%2Bintegration%2Bv1 Initiates an IDV session using either an `idvSetupId` or an `idvId`. The `idvId` takes precedence if both are provided. The `retry` flag can be set to true if the `idvId` is stored in session storage, allowing for page refreshes. Language can also be specified. ```typescript idvSdk?.begin({ idvSetupId: 'xxxxxx-xxxx', // Either setupid or idvId needs to be provided, idvId overrides setupId property idvId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // unique idvId retry: false, // set to true if idvId is saved in the session storage for example so that browser page could be refreshed multiple times without needing to generate new idvId. language?: 'bg-BG' // possible languages are listed below or can be found in the interface }); ``` -------------------------------- ### Install Ondato Web SDK using npm Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2969042947 Installs the Ondato Web SDK package from the npm registry. Ensure your .npmrc file is configured with the custom registry provided by Ondato. ```bash npm install @ondato-public/idv-sdk ``` -------------------------------- ### Get Business Details Request Example Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2379743233/Business%2BAML%2BScreening Example JSON payload for the GET /v2/legal-entities/{resourceId} endpoint. This request uses a provided resourceId to fetch detailed information about a specific business. ```json { "resourceId": "f48f946857281571f7254d8fa51a7f9da0b75e9728c5ab16acace934c08b93d8" } ``` -------------------------------- ### Initiate Business Onboarding Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2252996609 Initiates the business onboarding process by making a POST request to the IDV API. Requires a `setupId` in the request body and returns the identity verification `id` upon successful creation. ```APIDOC ## POST /v1/identity-verifications ### Description Initiates the business onboarding process by creating an identity verification. ### Method POST ### Endpoint /v1/identity-verifications ### Parameters #### Request Body - **setupId** (string) - Required - The ID of the setup configuration for the onboarding process. ### Request Example ```json { "setupId": "your_setup_id" } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier for the created identity verification. #### Response Example ```json { "id": "02c99769-51a5-4174-aa5b-3fa0c2e6bfef" } ``` ``` -------------------------------- ### Initiate Business Onboarding (POST Request) Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2252996654 Initiates a business onboarding process by sending a POST request to the IDV API. Requires a `setupId` in the request body. A successful response (201) returns the identity verification `id`. ```http POST /v1/identity-verifications Host: api.ondato.com Content-Type: application/json { "setupId": "YOUR_SETUP_ID" } ``` -------------------------------- ### NPM Integration Example (React) Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2393604111/Legacy%2BWeb%2BSDK%2BKYC%2Bintegration%2Bv1 Demonstrates how to integrate the Ondato IDV SDK into a React project using npm. This involves configuring npm registries, specifying package versions in `package.json`, and importing the SDK in your application. ```bash # 1. Specify registry in .npmrc @ondato-public:registry=https://pkgs.dev.azure.com/Ondato/PublicNPM/_packaging/ondato-public-npm/npm/registry/ ``` ```json // 2. In package.json specify version { "dependencies": { "@ondato-public/idv-sdk": "1.x.x" } } // Then run: npm install ``` ```typescript // 3. Example import in App.tsx (from idv_sdk_npm_example zip) import { IdvSdk } from '@ondato-public/idv-sdk'; // ... SDK initialization and usage ... ``` -------------------------------- ### Webhook Payload Example: IdentityVerification.StatusChanged Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2252996654 Example payload structure for the `IdentityVerification.StatusChanged` webhook, sent when the status of an identity verification changes. Contains data from the IDV API. ```json { "event": "IdentityVerification.StatusChanged", "data": { "id": "02c99769-51a5-4174-aa5b-3fa0c2e6bfef", "status": "In progress", "updatedAt": "2024-11-06T10:05:00Z" // ... other IDV API data } } ``` -------------------------------- ### POST /v1/identity-verifications Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2252996609/Business%2Bonboarding%2Bwith%2BKYB%2Band%2BKYC%2BUI Initiates the business onboarding process by creating an identity verification. A `setupId` is required in the request body. ```APIDOC ## POST /v1/identity-verifications ### Description To initiate business onboarding you need to make **POST** request to IDV API resource `/v1/identity-verifications` with `setupId` in the request body. Response with status code `201` will return `id` of identity verification that can be used to generate KYB form URL. ### Method POST ### Endpoint `/v1/identity-verifications` ### Parameters #### Request Body - **setupId** (string) - Required - The ID of the setup configuration for the business onboarding. ### Request Example ```json { "setupId": "your_setup_id_here" } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier for the created identity verification. #### Response Example ```json { "id": "02c99769-51a5-4174-aa5b-3fa0c2e6bfef" } ``` ### Error Handling - **400 Bad Request**: Missing or invalid `setupId`. - **500 Internal Server Error**: Server error during verification initiation. ``` -------------------------------- ### Webhook Payload Example: KybIdentification.Created Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2252996654 Example payload structure for the `KybIdentification.Created` webhook, sent when a user completes the business onboarding form. Contains data from the KYB Identifications API. ```json { "event": "KybIdentification.Created", "data": { "id": "02c99769-51a5-4174-aa5b-3fa0c2e6bfef", "status": "Completed", "createdAt": "2024-11-06T10:00:00Z", "formUrl": "https://idv.ondato.com/?id=02c99769-51a5-4174-aa5b-3fa0c2e6bfef" // ... other KYB Identifications API data } } ``` -------------------------------- ### Begin OnAge Session with `begin()` Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2969042947/Web%2BSDK%2BOnAge%2Bintegration The `begin()` function initiates an OnAge session, which is crucial for starting the identification process. It requires an `onAgeSetupId` and can optionally accept a language code, and callback functions for success, failure, and closure events. ```javascript exampleSdk.onAge.begin({ onAgeSetupId: 'xxxxxx-xxxx', // Static onAge setupId provided by support language: 'bg-BG', // possible languages are listed below or can be found in the interface onSuccess: () => { /* callback fired on successful completion */ }, onFailure: (error) => { /* callback fired on any failure mentioned in possible exceptions */ }, onClose: () => { /* callback fired when sdk process is closed */ }, }); ``` -------------------------------- ### Retrieve Identity Verification (IDV) Data - GET Request Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2295726818/Customer%2Bonboarding%2BKYC%2Bintegration%2Bwith%2BWEB%2BUI Fetches detailed information about a specific identity verification using its unique ID. This GET request to the IDV API provides status, timestamps, and associated setup and step details. ```json { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "status": "Completed", "applicationId": "0736cd0c-5a8d-45f8-a000-b5205ff4922d", "createdUtc": "2022-09-29T14:17:19.171Z", "modifiedUtc": "2022-09-29T14:19:42.973Z", "setup": { "id": "0f60f6f8-8e73-4873-b2ee-e02275994a77", "versionId": "67613d97-37c9-4230-ad87-e2227cdb4f78" }, "step": { "kycIdentification": { "id": "9ac12241-4333-46b0-8aa6-0b49e5444539" }, "consent": { "isConsented": true, "consentedUtc": "2022-09-29T14:18:11.684Z" } } } ``` -------------------------------- ### Install Web SDK via npm Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2393604111/Legacy%2BWeb%2BSDK%2BKYC%2Bintegration%2Bv1 This snippet demonstrates how to install the Ondato Web SDK for KYC integration using npm. It is the recommended method for modern web applications, particularly those using frameworks like React. ```bash npm install @Ondato-public/idv-sdk ``` -------------------------------- ### Get Company Details - Example Response Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2400583692 This JSON object shows the detailed information for a specific company on the watchlist, including its code, addition and removal timestamps, and country. ```json { "companyCode": 9875684564, "addedAt": "2023-05-15T10:57:17.037Z", "removedAt": "2023-05-15T10:57:17.037Z", "country": "Lt" } ``` -------------------------------- ### Get Watchlist Companies - Example Response Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2400583692 This JSON object represents the response when retrieving a list of companies from the watchlist. It includes pagination details and a list of companies with their basic information. ```json { "page": 1, "pageSize": 20, "count": 1, "companies": [ { "code": 9878456456, "name": "Ondato", "added": "2023-05-15T10:16:04.333Z", "country": "Lt" } ] } ``` -------------------------------- ### Get Representatives KYC Invitation Link Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2252996654 Retrieves a list of representatives for a business onboarding and provides invitation links for their KYC identification. ```APIDOC ## GET /v1/identifications/{kybId}/representatives ### Description Retrieves a list of representatives associated with a business onboarding and provides their KYC identification invitation links. ### Method GET ### Endpoint /v1/identifications/{kybId}/representatives ### Parameters #### Path Parameters - **kybId** (string) - Required - The ID of the KYB identification. ### Response #### Success Response (200) - **representatives** (array) - A list of representative objects. - **isExternallyVerified** (boolean) - Indicates if the representative has been externally verified. - **isVerified** (boolean) - Indicates if the representative has been verified. - **flowUrl** (string) - The invitation URL for the representative's KYC identification. #### Response Example ```json { "representatives": [ { "isExternallyVerified": false, "isVerified": false, "flowUrl": "https://join.ondato.com/setup/00000000-0000-0000-0000-000000000000?representativeId=00000000-0000-0000-0000-000000000000" } ] } ``` ``` -------------------------------- ### IDV SDK Initialization Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2393604111/Legacy%2BWeb%2BSDK%2BKYC%2Bintegration%2Bv1 This section details how to load and configure the IDV SDK, including setting the environment mode and defining callback functions for success, failure, and closure events. ```APIDOC ## POST /idv/sdk/load ### Description Configures the IDV SDK with the specified environment mode and event handlers. ### Method POST ### Endpoint `/idv/sdk/load` ### Parameters #### Request Body - **mode** (IdvSdkMode) - Required - Specifies the environment for the SDK (e.g., Sandbox, Production). - **onSuccess** (function) - Required - Callback function executed upon successful completion of the IDV process. - **onFailure** (function) - Required - Callback function executed upon failure of the IDV process. - **onClose** (function) - Required - Callback function executed when the SDK application is closed. ### Request Example ```json { "mode": "Sandbox", "onSuccess": "(props) => console.log('onSuccess', props)", "onFailure": "(props) => console.log('onFailure', props)", "onClose": "() => console.log('onClose')" } ``` ### Response #### Success Response (200) Returns `begin()` and `end()` methods upon successful configuration. #### Response Example ```json { "message": "SDK configured successfully. begin() and end() methods are available." } ``` ### Exceptions `IdvSdkLoadFailure` - `NotSupportedMode`: Incorrect mode (environment) provided. ``` -------------------------------- ### Initiate Identity Verification with `begin()` Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/3015540737/Web%2BSDK%2BCustomer%2BOnboarding%2BKYC%2Bintegration%2Bv2 The `begin()` function initiates an identity verification (IDV) session. It requires parameters such as `idvId`, `idvSetupId`, and `language`, and provides callbacks for `onSuccess`, `onFailure`, and `onClose` events. Ensure that only one SDK begin process is active on a page at a time. ```javascript exampleSdk.idv.begin({ idvId: 'xxxxxx-xxxx', // "Unique session id. idvSetupId: 'xxxxxx-xxxx', // Static idv configuration id unqique for the client. language?: 'bg-BG', // possible languages are listed below or can be found in the interface onSuccess: // callback fired on successful completion onFailure: // callback fired on any failure mentioned in possible exceptions onClose: // callback fired when sdk process is closed }); ``` -------------------------------- ### Retrieve Representatives for KYC (GET Request) Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2252996654 Fetches a list of representatives associated with a KYB identification. Unidentified representatives will have `isExternallyVerified` and `isVerified` set to `false`. ```http GET /v1/identifications/{kybId}/representatives Host: api.ondato.com ``` -------------------------------- ### Initiate Age Verification Session Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2969042947 Starts a new OnAge session for identity verification. Requires setup ID and provides callbacks for success, failure, and closure. ```APIDOC ## `exampleSdk.onAge.begin()` ### Description Creates an OnAge session for identity verification. This method requires configuration such as the setup ID, language, and callback functions for different stages of the process. ### Method `begin(props: BeginProps)` ### Endpoint N/A (Client-side function) ### Parameters #### Request Body - **onAgeSetupId** (string) - Required - Static onAge setup ID provided by support. - **language** (string) - Optional - The language for the SDK interface. Possible values are listed in the localization documentation. - **onSuccess** (function) - Optional - Callback function fired on successful completion of the identity verification process. - **onFailure** (function) - Optional - Callback function fired on any failure during the identity verification process. - **onClose** (function) - Optional - Callback function fired when the SDK process is closed. ### Request Example ```json { "onAgeSetupId": "xxxxxx-xxxx", "language": "bg-BG", "onSuccess": () => { /* handle success */ }, "onFailure": (error) => { /* handle failure */ }, "onClose": () => { /* handle close */ } } ``` ### Response #### Success Response N/A (Callbacks handle outcomes) #### Response Example N/A ### Possible Exceptions `SdkBeginFailure` enum: `NoOnAgeSetupId`, `CantBeUsedInIframe`, `NoIdvId`, `NotSupportedMode`, `ProcessStarted`, `StartFailed` `SdkProcessFailure` enum: `ConsentDeclined`, `FailureExit`, `Generic`, `InvalidId`, `Unauthorized`, `Aborted`, `Suspended`, `Expired`, `NotSupportedBrowser`, `NoIFrameContainer`, `CurrentSessionIdAndPassedIdMismatch` ``` -------------------------------- ### SDK Initialization and Core Functions Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/3015540737/Web%2BSDK%2BCustomer%2BOnboarding%2BKYC%2Bintegration%2Bv2 This section details how to load the Ondato SDK, initiate the identity verification process, and end the session. It also covers customizing the SDK's appearance and retrieving the SDK version. ```APIDOC ## POST /idv/begin ### Description Initiates the identity verification process using the loaded SDK. ### Method POST ### Endpoint /idv/begin ### Parameters #### Query Parameters - **idvSetupId** (string) - Required - The setup ID for the identity verification. - **idvId** (string) - Required - The unique ID for the identity verification instance. - **language** (string) - Optional - The language code for the SDK interface (e.g., 'en-GB'). #### Request Body This endpoint does not have a request body. Parameters are passed as query parameters. ### Request Example ``` // Example of calling idv.begin() within the SDK await idvSdk.idv.begin({ idvSetupId: document.getElementById('idv-setup-id').value.trim(), idvId: document.getElementById('idv-id').value.trim(), language: document.getElementById('idv-language').value.trim(), onSuccess: (props) => { console.log('onSuccess', { idvId: props.id }); alert(`onSuccess, idvId: ${props.id}`); }, onFailure: (props) => { console.log('onFailure', { idvId: props.id, reason: props.reason }); alert(`onFailure, idvId: ${props.id}, reason: ${props.reason}}`); }, onClose: (props) => { console.log('onClose ', props.id); }, }); ``` ### Response #### Success Response (200) Upon successful initiation, the SDK will present the verification UI. Callbacks like `onSuccess`, `onFailure`, and `onClose` handle the outcome. #### Response Example ```json // No direct JSON response for begin, outcomes are handled via callbacks. ``` ## POST /idv/customiseStyle ### Description Allows customization of the SDK's UI style. ### Method POST ### Endpoint /idv/customiseStyle ### Parameters #### Request Body - **background** (object) - Optional - Background styling options. - **opacity** (number) - Optional - Background opacity (0 to 1). - **blur** (string) - Optional - Background blur effect (e.g., '10px'). ### Request Example ```javascript idvSdk?.idv.customiseStyle({ background: { opacity: 0, blur: '10px', }, }); ``` ### Response #### Success Response (200) Style customization is applied directly to the SDK UI. #### Response Example ```json // No direct JSON response, style changes are applied in real-time. ``` ## POST /idv/end ### Description Ends the current identity verification session. ### Method POST ### Endpoint /idv/end ### Parameters This endpoint does not require any parameters. ### Request Example ```javascript idvSdk?.idv.end(); ``` ### Response #### Success Response (200) The verification session is terminated. #### Response Example ```json // No direct JSON response, session is terminated. ``` ## GET /sdk/version ### Description Retrieves the current version of the Ondato SDK. ### Method GET ### Endpoint /sdk/version ### Parameters This endpoint does not require any parameters. ### Request Example ```javascript WebSdkEntry.version(); ``` ### Response #### Success Response (200) - **version** (string) - The version string of the SDK. #### Response Example ```json { "version": "2.2.0" } ``` ## Initialization ### Description Initializes the Web SDK instance. This is the first step before using other SDK functionalities. ### Method `load()` function ### Endpoint N/A (Client-side function) ### Parameters #### Accepted Property - **mode** (SdkMode) - Required - Specifies the environment for the SDK (e.g., 'Sandbox', 'Production'). ### Request Example ```javascript import { load } from '@ondato-public/idv-sdk'; const exampleSdk = load({ mode: SdkMode.Sandbox, }); ``` ### Response #### Success Response Returns an SDK instance with `idv.begin()`, `idv.end()`, and `idv.customiseStyle()` methods available. #### Response Example ```json // Returns an SDK instance, not a JSON object. ``` ### Possible Exceptions - **SdkLoadFailure.NotSupportedMode** - Thrown when an incorrect or unsupported mode is provided. ``` -------------------------------- ### Initiate Business Onboarding Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2252996654/Business%2Bonboarding%2Bfull%2Bintegration Initiates the business onboarding process by creating an identity verification. Returns an ID that can be used to generate the KYB form URL. ```APIDOC ## POST /v1/identity-verifications ### Description Initiates the business onboarding flow by creating a new identity verification. Requires a `setupId` in the request body. ### Method POST ### Endpoint /v1/identity-verifications ### Parameters #### Request Body - **setupId** (string) - Required - The setup ID for the business onboarding process. ### Request Example ```json { "setupId": "your_setup_id" } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier for the created identity verification. #### Response Example ```json { "id": "02c99769-51a5-4174-aa5b-3fa0c2e6bfef" } ``` ``` -------------------------------- ### Retrieve Identity Verification (IDV) GET Request Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/2334359560/Customer%2Bonboarding%2BKYC%2Bmobile%2BSDK%2Bintegration This snippet shows how to retrieve detailed information about an Identity Verification (IDV) by making a GET request to the IDV API using the verification's unique ID. The response includes the status, timestamps, setup details, and status of associated steps like KYC identification and consent. ```json { "id": "89e50d98-c556-4818-8562-3cd98608bf09", "status": "Completed", "applicationId": "0736cd0c-5a8d-45f8-a000-b5205ff4922d", "createdUtc": "2022-09-29T14:17:19.171Z", "modifiedUtc": "2022-09-29T14:19:42.973Z", "setup": { "id": "0f60f6f8-8e73-4873-b2ee-e02275994a77", "versionId": "67613d97-37c9-4230-ad87-e2227cdb4f78" }, "step": { "kycIdentification": { "id": "9ac12241-4333-46b0-8aa6-0b49e5444539" }, "consent": { "isConsented": true, "consentedUtc": "2022-09-29T14:18:11.684Z" } } } ``` -------------------------------- ### IdentityVerification.StatusChanged Webhook Example (JSON) Source: https://ondato.atlassian.net/wiki/spaces/PUB/pages/3653435399/Bulk%2BDocument%2Bverification%2Bintegration This JSON payload represents a webhook notification for a change in the status of an identity verification. It includes details about the verification, its status, timestamps, and associated setup and step information. This is crucial for tracking the progress of document verifications. ```json { "id": "7a21b0e2-580e-4d2d-8578-00fc32a753ad", "applicationId": "44575362-e08e-4f75-b399-00d9d8916552", "createdUtc": "2023-01-31T07:25:55.6073016Z", "externalReferenceId": "123", "payload": { "id": "03be8be3-fbd5-4496-b552-bcd3e4918116", "status": "Completed", "applicationId": "44575362-e08e-4f75-b399-00d9d8916552", "createdUtc": "2023-01-31T07:22:11.313Z", "modifiedUtc": "2023-01-31T07:25:55.595Z", "setup": { "id": "5f16990b-d00a-4ff2-8102-e7b8d5820c28", "versionId": "60e8a778-1885-4162-bd58-d8b07bddba2e" }, "step": { "kycIdentification": { "id": "6df0d302-f0bb-441a-804c-5b114b476fc0" }, "documentSignatures": [], "forms": [], "consent": { "isConsented": true, "consentedUtc": "2023-01-31T07:22:25.08Z" } } }, "type": "IdentityVerification.StatusChanged" } ```