> ## 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.

# Sample Implementation API - Detailed Sequence Diagram

> Complete sequence diagram showing all API interactions in the onboarding flow

This diagram shows the complete sequence of API calls required for the business onboarding process, from sending business invite through to adding owners.

```mermaid theme={null}
sequenceDiagram
    participant Customer API as Customer Backend
    participant WorthAPI as Worth API

    Note over Customer Backend,WorthAPI: Step 1: Customer Sign In
    Customer Backend->>+WorthAPI: POST /auth/api/v1/customer/sign-in
    Note right of Customer Backend: Request: email, password
    WorthAPI-->>-Customer Backend: Response: data.id_token, data.customer_details.id

    Note over Customer Backend,WorthAPI: Step 2: Add Business
    Customer Backend->>+WorthAPI: POST /case/api/v1/businesses/customers/{customerID}
    Note right of Customer Backend: Request: business data<br/>Auth: customer_token (id_token)
    WorthAPI-->>-Customer Backend: Response: business_id, business details

    Note over Customer Backend,SDK: Step 3: Initialize SDK
    Customer Backend->>+SDK: SDK instance
    Note right of Customer Backend: Request: invite_token extracted from step 2.
```

## Understanding the Diagram

This sequence diagram illustrates:

* **Customer API**: The parent site application that displays the onboarding UI
* **Worth SDK**: The SDK layer that handles API calls to Worth API for subsequent steps
* **Worth API**: The underlying API services (does not need to specify individual microservices like "Auth Service" or "Case Service")

## Key Points

* **Step 1: Customer Sign In (POST)**:

  * Signs in a customer.
  * Provides the customer id\_token.

* **Step 2: Add Business (POST)**:

  * Creates business and case information.
  * It uses the `customer_token` for authentication.
  * Returns `invitation_url` for the iframe to render.

* **Step 3: Initialize SDK**:

  * It uses the invite\_token obtained from Step 2.

## Related Documentation

* [Overview](/onboarding-sdk/overview) - Return to the flow overview
* [Step-by-Step Breakdown](/onboarding-sdk/api-step-by-step-breakdown) - Detailed endpoint information
* [API Reference](/onboarding-sdk/api-reference) - Complete endpoint documentation
