Skip to main content
This flow is provided as an example scenario for initializing an Onboarding SDK 3 instance. Your experience may differ depending on your contract with Worth services.
The following document details an end-to-end scenario of using the Worth API to invite a business to the onboarding platform and using the returned invite_token to initialize an Onboarding SDK 3 instance. This flow consists of two sequential API calls that handle signing into the Worth platform as a customer and inviting a business to complete an application.

Overview

The business onboarding process follows a linear sequence of API calls: This diagram shows the complete sequence of API calls required for the business onboarding process:
Note: In this scenario, the customer application in which the Onboarding SDK is mounted does not send requests to the customer/sign-in or businesses/invite endpoints

Key Points

Step 1 - Customer Sign-in:
  • Using the POST /auth/api/v1/customer/sign-in endpoint, a customer may sign into the Worth platform with their email and password
  • Upon successfully signing in, an id_token will have been returned in the request response. This token should be used when authenticating subsequent requests
    POST  /auth/api/v1/customer/sign-in
    
    // Sample request body
    {
      "email": "customer@joinworth.com",
      "password": "12345"
    }
    
    // Sample response
    {
        "status": "success",
        "message": "Logged In successfully",
        "data": {
            "user_details": {
                "id": "c03d6f6a-012a-4e71-8195-9f6f590a0000",
                "first_name": "Sample",
                "last_name": "Customer",
                "email": "customer@joinworth.com",
                "is_email_verified": true
            },
            "access_token": "{access_token}",
            "id_token": "{id_token}",
            "refresh_token": "{refresh_token}",
            "subrole": {
                // ...
            },
            "permissions": [
                // ...
            ],
            "customer_details": {
                "id": "a04d6f6a-59ab-4e71-8195-9f6f590a1234",
                "name": "Sample Customer"
            }
        }
    }
    
Important: Always use the id_token for secure API communication in subsequent steps
Step 2 - Send Business Invite:
  • Using the POST /case/api/v1/customers/{customerID}/businesses/invite endpoint, a customer may send an invite to a business to complete a Worth onboarding application
  • The id_token that is received from the sign-in step should be passed into the Authentication header when POSTing to this endpoint
  • Within the body of this request, the following attributes must be provided: business, applicants, and template_version_id
  • Upon successfully sending a business invite, an invitation_url will have been returned in the request response. This URL will contain the token that should be passed into the SDK 3 instance
See example:
POST  /case/api/v1/customers/:customerID/businesses/invite
// Sample request body
{
    "business": {
        "name": "Sample Business"
    },
    "applicants": [
        {
            "first_name": "John",
            "last_name": "Smith",
            "email": "jsmith@example.com"
        }
    ],
    "template_version_id": "b03d6f6a-063b-4e71-8195-9f6f590a6257"
}
// Sample response
{
    "status": "success",
    "message": "Business invited successfully",
    "data": {
        "business_id": "52310d5d-7d7a-4ae8-ab00-7849bb0d4f5a",
        "applicant_email": "jsmith@example.com",
        "invitation_id": "57ff5d40-f25d-44f4-9f4c-6640b63a74ea",
        "customer_id": "a04d6f6a-59ab-4e71-8195-9f6f590a1234",
        "onboarding_instance_id": "876f6b5b-17b3-46ae-8cbf-c912b1036c07",
        "invitation_url": "https://app.joinworth.com/onboarding/verify/invite?token={invite_token}&first_name=John&last_name=Smith&business_name=Sample%20Business&customer_name=Sample%20Customer%20&is_co_applicant=false"
    }
}
Step 3 - Initialize SDK:
  • In the customer application in which the SDK is mounted, call createWorthOnboarding with the extracted invite_token
    • See the full Quick Start Guide for a step-by-step walkthrough, including cleanup and error handling

Support

For questions or issues, please contact your Worth Customer Success team or reach out to support@joinworth.com.