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

# End-to-End Flow

> Complete integration in 6 simple steps

<Steps>
  <Step title="Authenticate">
    Get your partner access token.

    Exchange credentials for partner token:

    * POST to [`/v1/platform/oauth2/token/`](/api-reference/authentication/get-partner-token) using Basic Auth
    * Use partner UUID and API key (provided by Thred)
    * Store the returned partner token

    [See authentication guide](/implementation/authentication)
  </Step>

  <Step title="Onboard Business">
    Create a business in Thred when user signs up for accounting.

    Create business:

    * POST to [`/v1/platform/businesses/`](/api-reference/business-management/create-business) with business details
    * Use partner token from Step 1
    * Store returned `business_id` in your database

    Get business token:

    * POST to [`/v1/platform/{business_id}/oauth2/token/`](/api-reference/authentication/get-business-token)
    * Use partner token
    * Store business-scoped token

    [See onboarding guide](/implementation/onboarding-business)
  </Step>

  <Step title="Embed Accounting UI">
    Add Thred's accounting interface to your platform.

    Install SDK:

    ```bash theme={null}
    npm install @thredfi/accounting
    ```

    Mount widget:

    * Add container element to your app
    * Call `mountThredfi()` with business token
    * User sees accounting interface in your platform

    [See frontend SDK guide](/implementation/frontend-sdk)
  </Step>

  <Step title="Push Business Activity">
    Send financial data as it happens.

    Required:

    * [POST invoices](/api-reference/invoices/create-invoice) when created
    * [POST payments](/api-reference/payments/create-payment) when received
    * [POST refunds](/api-reference/refunds/create-refund) when issued

    Thred automatically:

    * Creates journal entries (double-entry bookkeeping)
    * Updates AR/AP balances
    * Generates financial reports

    [See importing business activity guide](/implementation/importing-overview)
  </Step>

  <Step title="Connect Bank Accounts">
    User connects their bank account (optional).

    Your user can connect their bank account directly in the embedded Thred UI:

    * Click "Connect Bank" in the accounting interface
    * Authenticate with their bank (via Plaid)
    * Select accounts to sync

    No integration work required from you - it's built into the widget.

    Result:

    * Daily transaction sync
    * 2-year history backfill
    * Auto-reconciliation with invoices/bills

    [See bank accounts guide](/implementation/bank-accounts)
  </Step>

  <Step title="Verify Integration">
    Test the complete integration.

    Create test invoice:

    * POST to [`/v1/platform/businesses/{id}/invoices/`](/api-reference/invoices/create-invoice)
    * Use business token

    Verify:

    * Invoice appears in embedded accounting UI (AR tab)

    [See verification guide](/implementation/verify-integration)
  </Step>
</Steps>

***

Ready to start? Let's [onboard your first business](/implementation/onboarding-business).
