---
title: "Grouping related transaction types using scopes and sources"
slug: "grouping-related-transaction-types-using-scopes-and-sources"
updated: 2024-09-03T13:30:21Z
published: 2024-09-03T13:30:21Z
canonical: "support.lusid.com/grouping-related-transaction-types-using-scopes-and-sources"
---

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

# Grouping related transaction types using scopes and sources

If you [create your own universe of transaction types](/v1/docs/how-do-i-create-a-transaction-type), you must nominate a *source* and a *scope* for each type.

> **Note**: The source and scope are important when LUSID [resolves upserted transactions to transaction types](/v1/docs/how-does-lusid-resolve-transactions-to-transaction-types).

A *source* groups transaction types from the same data provider. For example, if you obtain transaction feeds from both Bloomberg and Goldman Sachs, you have the option to create distinct sets of transaction types processing these transactions and keep them in separate sources. You *can* choose not to do this and store all your transaction types in the `default` source provided with LUSID if you wish. Note the following about sources:

- A source cannot contain two transaction types with the same name.
- The [built-in transaction types](/v1/docs/what-built-in-transaction-types-and-sides-are-provided-with-lusid) provided with LUSID are stored in the `default` and `alt1` sources.
- A transaction upserted to a portfolio expects its transaction type to be in the `default` source unless you specify the `source` field on that transaction. [See how to do this](/v1/docs/how-do-i-create-or-update-a-transaction#using-the-lusid-rest-api).

A *scope* is a logical repository of transaction types that can be entitled in the same way as [scopes](/v1/docs/what-is-a-scope) throughout LUSID. You have the option to domicile a set of transaction types in a custom scope and only allow particular transaction portfolios to access those transaction types. You *can* choose not to do this and domicile all your transaction types in the `default` scope provided with LUSID if you wish, accessible to every portfolio out-of-the-box. Note the following about scopes:

- The built-in transaction types and [built-in sides](/v1/docs/what-built-in-transaction-types-and-sides-are-provided-with-lusid#builtin-sides) provided with LUSID are domiciled in the `default` scope.
- A portfolio expects upserted transactions to reference transaction types in the `default` scope unless you specify the `transactionTypeScope` field on that portfolio. [See how to do this](/v1/docs/how-do-i-create-a-transaction-portfolio).
- A [side](/v1/docs/what-is-a-side) is a plug-and-play component of a movement, which itself is a component of a transaction type. Sides ultimately used by transaction types must be domiciled in the same scope.

The following diagrams explore some possible combinations of scopes and sources.

## Store custom transaction types in the default source and scope

All your custom transaction types are accessible to every portfolio out-of-the-box. There's no need to set the `transactionTypeScope` field on portfolios, nor the `source` field on transactions upserted to those portfolios.

Custom transaction types can use the built-in sides. We recommend [removing the built-in transaction types](/v1/docs/how-do-i-remove-the-built-in-transaction-types-and-sides) to avoid unintended clashes.

![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/029eb31c-6a6a-4a6a-8b69-c3fddc72baa6.png)

## Store custom transaction types in a custom source and scope

Your custom transaction types cannot use the built-in sides. If you want the same behavior, you must create new sides with the same definitions in the custom scope.

You must set the `transactionTypeScope` field on portfolios to the custom scope, and the `source` field on transactions upserted to those portfolios to the custom source.

![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/c30efe69-7488-4863-aa66-149367009a2e.png)

## Store custom transaction types in a custom scope and multiple custom sources

You must set the `transactionTypeScope` field on portfolios to the custom scope, and make sure the `source` field on transactions upserted to those portfolios references the correct custom source.

![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/9a2e1dd0-bd51-41fa-89df-14ff832b4187.png)

## Store custom transaction types in multiple custom scopes and sources

You must make sure the `transactionTypeScope` field on portfolios references the correct custom scope, and the `source` field on transactions upserted to those portfolios references the correct custom source.

![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/98407b00-3de0-42d9-8cb1-667671765a8b.png)
