> ## Documentation Index
> Fetch the complete documentation index at: https://docs.worthai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

This page outlines a structured process for onboarding businesses using Worth AI's APIs and tools. The flow supports two main approaches, allowing flexibility in how businesses are onboarded and scored.

***

## **Process Breakdown**

### **1. Customer Interaction**

* The process begins with customers receiving an invitation to onboard. Upon acceptance, they proceed to log in.
* After [authenticating](https://docs.worthai.com/api-reference/auth/sign-in/customer-sign-in), they are issued three tokens:
  * **Access Token**: Used for purposes like logout, update password etc.
  * **ID Token**: Always used for secure communication.
  * **Refresh Token**: Used to renew Access and ID token.
* It is recommended to prioritize the use of the **ID Token** for all API calls.

### **2. Onboarding Businesses**

The onboarding process supports two distinct approaches:

#### **Approach 1 - Instant Onboarding: Provide All Business Data at Once**

* In [this approach](https://docs.worthai.com/use-cases/onboarding/instant-onboarding), the user provides all the required business data upfront. The system processes the following tasks automatically:
  * **Business Search**
  * **Business Verification**
  * **Fetching Public Records**
  * **Fetching Website Metadata**
  * **Owner's Identity Verification**
  * **Business Scoring**

#### **Approach 2: Invite Businesses via Worth UI**

* Businesses are invited to onboard themselves through the Worth AI User Interface (UI).
* This approach provides a self-service option where businesses can complete the onboarding process independently.

***

## **Implementation Recommendations**

1. **Streamlined Process**:
   * Approach 1 is designed for simplicity and efficiency, handling all onboarding tasks with minimal user input.

2. **Flexibility**:
   * Approach 2 caters to businesses with custom onboarding requirements or those preferring a self-service model.

***

This documentation serves as a guide to understanding and implementing the processes outlined in the flow diagram using Worth AI’s APIs. For more details, refer to the [API Reference](https://docs.worthai.com/api-reference).

```mermaid theme={null}
flowchart TB

%% Customer Section
subgraph Customer_Auth[Customer Authentication]
    A[Customer] -->|Accept Invitation| B[
        Get Auth Tokens: 
        access_token 
        id_token 
        refresh_token
    ]
    A -->|Invitation Already Accepted| C[Login]
    C --> B
    B:::tokenStyle
    D[ *Use id_token for API calls ]:::apiTokenStyle
end

%% Connection from Customer Flow to Onboard Business
Customer_Auth --Onboard New Business--> Onboarding

%% Onboarding Section
subgraph Onboarding [Business Onboarding]
    O[API]
    O --> P1[**Instant**: Give all business data at once and we will run:
        - Business Search
        - Business Verification
        - Fetching Public Records
        - Fetching Website Details
        - Owners Identity Verification 
        - Enque Business for Score Calculation
    ]
    O --> P2[**Self-serve:** Businesses are invited to onboard themselves through the Worth AI User Interface]
end

%% Fetching data
subgraph Fetch[Retrieve Data]
    BUS["Business Details"] --> BUS1["/businessess/{businessID}"]
    V["Verification Details (KYB)"] --> VER["/verification/businesses/{businessID}/business-entity"]
    P["Public Records"] --> PUB["/business/{businessID}/public-records"]
    S["Business Score"] --> SCO["/score/business/{businessID}"]
end

Onboarding --Fetch Data--> Fetch
%% Styles
classDef tokenStyle fill:green,stroke:#333,stroke-width:2px;
classDef apiTokenStyle fill:purple,stroke:#333,stroke-width:2px;

```
