API product catalogSub-Accounts & White-Label Retail KYC
Sub-account portfolio
Sub-Accounts & White-Label Retail KYC
GET
/users/{userId}/portfolio
Sub-account portfolio
Sandbox available
getUserPortfolioReturns all open equity positions held by a sub-account, with current market value and unrealised P&L in USD.
Parameters
userIdstringpathRequiredExample: usr_abc123
Headers
AuthorizationstringRequiredBearer sk_sandbox_<your_key> for sandbox requests.
Response fields
subAccountIdstringexternalIdstringsummaryobjectsummary.walletBalancenumbersummary.portfolioValuenumbersummary.investedCapitalnumbersummary.unrealisedPnlnumbersummary.totalValuenumberholdingsobject[]holdings[].symbolstringholdings[].stockNamestring | nullholdings[].exchangestring | nullholdings[].currencystringholdings[].unitsnumberholdings[].avgCostnumberholdings[].currentUsdPricenumberholdings[].localPricenumberholdings[].currentValuenumberholdings[].investedCapitalnumberholdings[].unrealisedPnlnumberholdings[].priceIsLivebooleanBackwards-compatible freshness flag for the delayed production catalogue; never implies real-time tick data.
holdings[].lastPriceUpdatestring | nullholdings[].asOfstring | nullUpstream capture timestamp for the price used in this valuation.
holdings[].stalebooleanholdings[].priceSourcePRODUCTION_CATALOGUE | SANDBOX_HOLDINGholdings[].dataQualityobjectThe published market-data freshness contract. African equity quotes are supplied by the exchanges on a 15-minute-delayed basis, not in real time. MyStocks holds full exchange data rights. The API refresh target is 900 seconds during the published coverage window, with an end-of-day pass after market close.
Response codes
200Sub-account portfolio holdings and aggregate values.