# Open an Investor Account

import { Stepper } from "zudoku/ui/Stepper";

The Transact API gives your application the ability to create a *Transact Personalised Illustration* as well as
prepopulate certain data points within the associated online portfolio application (known as a *Guided Application*).
This streamlines the investor onboarding process, saves the adviser precious time and effort, and reduces risk.

## Scenario

An adviser using your application wishes to illustrate for and open Transact portfolios for one to two applicants.
These applicants may comprise one or two adults, or a child. The adviser has:

- a Transact number (they are registed with Transact)
- information about the applicants stored in your application.

## Workflow

A theoretical workflow might consist of these steps:

<Stepper>

1. **The adviser initiates your Transact account opening integration**

    Within your application, the adviser initiates the process of opening a Transact portfolio, based on
    client information they already have in your system. This could be initiated by clicking a *Create Illustration* button.

2. **Your application determines the adviser's Transact number**

    A Transact illustration is related to specific Transact adviser. In order to proceed, your application needs to know the
    adviser's Transact number. This can be looked up via the [Get advisers](/api/advisers#get-advisers) endpoint.
    The adviser selects their Transact number. Your application may remember this number for next time.

3. **The adviser reviews information**

    The adviser reviews the applicants' information (and potentially enriches it) within your application, before it is sent to Transact.

4. **Your application creates a Transact Personalised Illustration**

    With the adviser's Transact number and the applicants' information, your application calls Transact's
    [Prepopulate a Personalised Illustration](/api/account-opening#prepopulate-a-personalised-illustration) endpoint,
    which creates a *Transact Personalised Illustration* and stores both the illustration, and data that can later be used to prepopulate a *Guided Application*.

    While many of these data points are optional, to minimise rekeying you should provide all data you have available.

    The endpoint returns a link that can be used to view and modify the illustration within Transact Online.

5. **The adviser proceeds to Transact Online to complete the process**

    Your application may display the link returned in the previous step to the adviser (for example, in the form of a *View Illustration* button).
    Following the link, the adviser accesses their illustration within Transact Online, prefilled with all the information your application supplied.

    The adviser may download the illustration, make it available to the applicants, and go on to complete the application using Transact Online.

</Stepper>

## Example implementation

:::note

This guide assumes you have already followed the [Getting Started](../getting-started/overview.md) guide to register
with Transact, and have implemented OAuth authentication. For this workflow, you'll need an access token for an adviser firm
with the following scopes:

- `entity.read`
- `investor-illustration-profile`

:::

### Determining an adviser's Transact number

Transact Personalised Illustrations belong to a specific adviser. In order to create one, you will need the
adviser's Transact number. If you already have this information stored, good news - you can skip this step!

If you don't, you have a couple of options. You could:

- prompt the adviser for their number or
- call the [Get advisers](/api/advisers#get-advisers) endpoint.

Prompting the adviser for their number will likely irritate them (especially if they mistype the number).
The [Get advisers](/api/advisers#get-advisers) endpoint (`GET /advisers`) retrieves all advisers associated with the Resource Owner, which in this case is the adviser firm.
This allows the user to choose from a list of advisers.

This endpoint returns [paginated](../advanced/pagination.md) data. The returned JSON looks something like:

```json
{
  "items": [
    {
      "id": "111111111",
      "surname": "Adviser",
      "given_names": "John",
      "fca_number": "ABC02345",
      "firm_id": "444444444"
    },
    {
      "id": "222222222",
      "surname": "Adviser",
      "given_names": "Ian",
      "fca_number": "ABC12345",
      "firm_id": "444444444"
    },
    {
      "id": "333333333",
      "surname": "Adviser",
      "given_names": "Pamela",
      "fca_number": "ABC22345",
      "firm_id": "444444444"
    }
  ]
  // ... page navigation data ...
}
```

Simply look through each page for the adviser to be associated with the illustration, noting
their adviser `id` once found.

### Creating a Transact Personalised Illustration

To kickstart the investor onboarding process, your application will call the
[Prepopulate a Personalised Illustration](/api/account-opening#prepopulate-a-personalised-illustration) endpoint
(`POST /advisers/:id/prepop-apps`).
This endpoint creates the *Transact Personalised Illustration* and registers certain data points that will also be
pre-populated in the subsequent *Guided Application*.

Your JSON request body might look something like the following:

```json title="Request body"
{
  "investors": [
    {
      "title": "MR",
      "surname": "Miggins",
      "given_names": "Ian",
      "date_of_birth": "1970-12-25",
      "country_of_birth": "GB",
      "gender": "MALE",
      "nationalities": [
        "GB"
      ],
      "tax_residencies": [
        {
          "country": "GB"
        },
        {
          "country": "AU",
          "tax_id": "12345678"
        }
      ],
      "nino": "QQ123456A",
      "investor_category": "RETAIL",
      "mobile_number": {
        "country": "GB",
        "number": "07700900000"
      },
      "email_address": "example@mail.com",
      "residential_address": {
        "address": {
          "line1": "1 Washington Street",
          "line2": "Worcester",
          "post_code": "WR1 1NL",
          "country": "GB"
        }
      },
      "postal_address": {
        "address": {
          "line1": "11 Splendor Avenue",
          "line2": "Worcester",
          "post_code": "WR1 1DF",
          "country": "GB"
        }
      }
    }
  ],
  "bank_account": {
    "sort_code": "123456",
    "account_number": "12345678",
    "account_name_or_roll_number": "Ian Miggins",
    "is_building_society": false
  }
}
```

The returned response contains information about the created illustration, as well
as a unique link to access it on Transact Online:

```json title="Response body"
{
  "id": "012345ab-cdef-ghij-klmn-opqrstuvwxyz",
  "adviser_id": "123456789",
  "name": "Ian Miggins created on 12/05/2026 00:00:00",
  "data": /* the request data */,
  "_links": [
    {
      "href": "https://demo.transact-online.co.uk/hub/prepop-apps/012345ab-cdef-ghij-klmn-opqrstuvwxyz",
      "rel": "html",
      "method": "GET",
      "description": "The URL to access the newly created illustration within Transact Online"
    }
  ]
}
```

Your application can then make the returned link available to the adviser.

Using the link, the adviser can complete and generate the  *Transact Personalised Illustration*, as well as
prepare and submit the associated *Guided Application*. They don't need to complete these steps in one go - the link will always take them back to where they last left off.

Advisers can also access any illustrations from the *Personalised Illustrations and Applications* menu on Transact Online.