Redirect Integration

This style of integration involves sending the user to the Tilia flow via a full page navigation from your domain to Tilia’s.

The diagram below illustrates the flow of information within a redirect integration.

General Redirect Flow

To integrate using the redirect method

Redirect integration involves the following steps:

Step 1: User authorization

Step 2: Create the flow link

Step 3: Handle the flow result

The rest of this document walks you through the basics of integrating a flow using the redirect method.

Step 1: User authorization

All flows start with an OAuth2 authorization of the end-user, passing an account_id. The response will include a payload that contains a redirect URL with a generated nonce that allows the user to interact with the Tilia UIs.

Creating the nonce requires an Access Token with the scope write_user_tokens.

curl --location --request POST https://auth.tilia-inc.com/authorize/user \
--header 'Authorization: Bearer <Access_Token>' \
--header 'Content-Type: application/json' \

Request body

Copy
Copied
{
	"account_id": "<tilia_account_id>"
}

Sample response

Copy
Copied
{
    "status": "Success",
    "message": [],
    "codes": [],
    "payload": {
        "redirect": "https://web.tilia-inc.com/ui/appauth/ed8ff1e9-9256-4205-918a-b9ca23ec00ec"
    }
}

The response includes a redirect URL which is used in the next step.

The nonce is valid for 24 hours. We recommend generating a nonce immediately before sending the user to a Tilia UI.

Next, you will create a link for the user to access the flow.

Copy
Copied
<a href=”<redirect.url>?flow=<flow.name>&returnurl=<your.return.url?your.parameters>”>Click here to start the flow</a>"

Where:

  • <redirect.url> is the URL returned in step 1.
  • <flow.name> is the Tilia flow name. Must be one of the following tos, kyc, purchase, payout.
  • <your.return.url> is the URL you wish the user to be directed to after completing the flow. Must be a fully qualified URL. You can optionally include any of your own query string parameters.

Step 3: Handle the flow result

Upon completing the flow, the user is redirected to <your.return.url>, with flow-specific parameters appended.

Copy
Copied
<your.return.url?your.parameters>&<tilia.flow.parameters>

Refer to the flow-specific documentation for details on the parameters returned.