Providing you have suitable access control permissions, you can register one or more sub-holding keys (SHKs) with a transaction portfolio in order to divide holdings into strategies.
You can register a set of SHKs when you create a portfolio, and subsequently modify the set at any time.
Registering SHKs when you create a portfolio
- Obtain an API access token.
- Call the LUSID CreatePortfolio API for your LUSID domain, passing in your API access token, nominating a
scope
in the URL, and specifying in the request body:- A
displayName
. - A
code
unique within thescope
. - A
baseCurrency
to which foreign currency transactions can be normalised upon provision of a trade to portfolio rate. This must be an ISO 4217 currency code, for exampleGBP
orJPY
. - A comma-separated list of SHKs in the
subHoldingKeys
collection. Each must be the 3-stage key of an existing property type in theTransaction
domain.
- A
For example:
curl -X POST "https://<your-domain>.lusid.com/api/api/transactionportfolios/Ibor" -H "Authorization: Bearer <your-API-access-token>" -H "Content-Type: application/json-patch+json" -d '{ "displayName": "UK equity transaction portfolio", "code": "UK-Equity", "created": "2023-01-01T00:00:00Z", "baseCurrency": "GBP", "subHoldingKeys": ["Transaction/Strategy/Signal", "Transaction/Cash/Category"], }'
Modifying an existing portfolio to add or remove SHKs
- Obtain an API access token.
- Call the LUSID PatchPortfolioDetails API for your LUSID domain, passing in your API access token, and specifying the
scope
andcode
of the portfolio to modify in the URL. - Specify an API request that adheres to the JSON PATCH specification, specifically:
- An
op
ofadd
. - A
path
of/subHoldingKeys
. - A comma-separated list of SHKs in the
value
collection. Each must be the 3-stage key of an existing property type in theTransaction
domain. Note that existing SHKs are replaced, so include them in the list to retain.
- An
For example:
curl -X POST "https://<your-domain>.lusid.com/api/api/transactionportfolios/Ibor/UK-Equity/details" -H "Authorization: Bearer <your-API-access-token>" -H "Content-Type: application/json-patch+json" -d '[ { "value": ["Transaction/Client/AccountType", "Transaction/Strategy/Signal", "Transaction/Portfolio/Manager"], "path": "/subHoldingKeys", "op": "add" } ]'