Skip to content
MyStocks Developers
API v1

API v1

Current stable contract

Versioning policyRelease changelog
Sandbox console

Sub-account portfolio

Sub-Accounts & White-Label Retail KYC

GET

/users/{userId}/portfolio

Sub-account portfolio

Sandbox availablegetUserPortfolio

Returns all open equity positions held by a sub-account, with current market value and unrealised P&L in USD.

Parameters

userIdstringpathRequired

Example: usr_abc123

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Response fields

subAccountIdstring
externalIdstring
summaryobject
summary.walletBalancenumber
summary.portfolioValuenumber
summary.investedCapitalnumber
summary.unrealisedPnlnumber
summary.totalValuenumber
holdingsobject[]
holdings[].symbolstring
holdings[].stockNamestring | null
holdings[].exchangestring | null
holdings[].currencystring
holdings[].unitsnumber
holdings[].avgCostnumber
holdings[].currentUsdPricenumber
holdings[].localPricenumber
holdings[].currentValuenumber
holdings[].investedCapitalnumber
holdings[].unrealisedPnlnumber
holdings[].priceIsLiveboolean

Backwards-compatible freshness flag for the delayed production catalogue; never implies real-time tick data.

holdings[].lastPriceUpdatestring | null
holdings[].asOfstring | null

Upstream capture timestamp for the price used in this valuation.

holdings[].staleboolean
holdings[].priceSourcePRODUCTION_CATALOGUE | SANDBOX_HOLDING
holdings[].dataQualityobject

The 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.