1. Guides
  2. Dots Drop-in Components

Dots Flows

Dots Flows provides a set of drop-in components that can be used to easily integrate Dots payouts into your mobile or web application.

Flows can be used to onoboard users, collect compliance information, save payout methods and initiate payouts. When a user interacts with a flow, Dots can notify you application through webhook.

There are four different flow steps can can be used individually or chained together.

  • onboarding - This step creates a Dots user and verifies their phone number
  • compliance - This step collects tax information for the user based on their current location
  • manage-payouts- This step allows the user to add payout methods, set a default and enable automatic payouts
  • manage-payments - This step allows the user to connect a bank account for ach payments
  • payout - This step allows the user to initiate a payout to their preffered payout method

Integrating Dots into your app with Flows

Step 1: Create a flow to onboard users

Lets create the first flow to onboard users. This flow will create a Dots user, verify their phone number and collect their tax information.

Request

The onboarding step is automatically added to the start of all flows if a user_id is not provided.

cURL
https://pls.senddotssandbox.com/api/v2/flows/ \
-X POST \
-H "Authorization: Basic <TOKEN>" \
-H "Content-Type: application/json" \
-d "{
      "steps": ['compliance']
    }"

Response

{
  "id": "19f4e351-2228-493e-b36f-90c6ecdab9f6",
  "created": "2021-03-31T20:00:00.000Z",
  "user_id": null,
  "steps": ["compliance"],
  "completed_steps": [],
  "link": "https://pls.senddotssandbox.com/flows/19f4e351-2228-493e-b36f-90c6ecdab9f6",
  "metadata": {}
}

The link can now be embedded in your application.

Step 2: Retrieve the user’s id from the flow

When the user completes each step, a webhook with the flow’s id will be triggered. You can then use the the /v2/flows/{flow_id} endpoint to retrieve the user’s id.

Request

cURL
https://pls.senddotssandbox.com/api/v2/flows/19f4e351-2228-493e-b36f-90c6ecdab9f6 \
-X GET \
-H "Authorization: Basic <TOKEN>" \
-H "Content-Type: application/json"

Response

{
  "id": "19f4e351-2228-493e-b36f-90c6ecdab9f6",
  "created": "2021-03-31T20:00:00.000Z",
  "user_id": "a1b2c3d4-e5f6-7g8h-9i0j-1k2l3m4n5o6p",
  "steps": ["compliance"],
  "completed_steps": ["onboarding"],
  "link": "https://pls.senddotssandbox.com/flows/19f4e351-2228-493e-b36f-90c6ecdab9f6",
  "metadata": {}
}

Step 3. Transfer funds to the user

Now that we have the user’s id, we can transfer funds to the user’s Dots account.

Request

cURL
https://pls.senddotssandbox.com/api/v2/transfers/ \
-X POST \
-H "Authorization: Basic <TOKEN>" \
-H "Content-Type: application/json" \
-d "{
      "amount": -1000,
      "user_id": "a1b2c3d4-e5f6-7g8h-9i0j-1k2l3m4n5o6p"
    }"

Step 4: Create a flow for the user to withdraw funds

With the user’s id, we can create a pre-authorized flow for the user to withdraw funds.

Request

cURL
https://pls.senddotssandbox.com/api/v2/flows/ \
-X POST \
-H "Authorization: Basic <TOKEN>" \
-H "Content-Type: application/json" \
-d "{
      "user_id": "a1b2c3d4-e5f6-7g8h-9i0j-1k2l3m4n5o6p",
      "steps": ['payout']
    }"

The link will stay authenticated for 15 minutes. If the user takes longer than 15 minutes to complete the flow, they will need to re-authenticte through an sms token.