Sandbox playground Read-only sandbox request Sandbox API key Your key stays in this page’s memory.
https://mystocks.africa/api/sandbox/v1/partner/portfolio Send{
"type": "object",
"required": [
"accountType",
"summary",
"holdings"
],
"properties": {
"accountType": {
"type": "string",
"enum": [
"MASTER",
"SUBACCOUNT"
]
},
"subAccountId": {
"type": "string"
},
"externalId": {
"type": "string"
},
"summary": {
"type": "object",
"required": [
"walletBalance",
"portfolioValue",
"investedCapital",
"unrealisedPnl",
"totalValue"
],
"properties": {
"walletBalance": {
"type": "number"
},
"portfolioValue": {
"type": "number"
},
"investedCapital": {
"type": "number"
},
"unrealisedPnl": {
"type": "number"
},
"totalValue": {
"type": "number"
}
}
},
"holdings": {
"type": "array",
"items": {
"type": "object",
"required": [
"symbol",
"currency",
"units",
"avgCost",
"currentUsdPrice",
"currentValue",
"investedCapital",
"unrealisedPnl",
"priceIsLive",
"asOf",
"stale",
"priceSource",
"dataQuality"
],
"properties": {
"symbol": {
"type": "string"
},
"stockName": {
"type": [
"string",
"null"
]
},
"exchange": {
"type": [
"string",
"null"
]
},
"currency": {
"type": "string"
},
"units": {
"type": "number"
},
"avgCost": {
"type": "number"
},
"currentUsdPrice": {
"type": "number"
},
"localPrice": {
"type": "number"
},
"currentValue": {
"type": "number"
},
"investedCapital": {
"type": "number"
},
"unrealisedPnl": {
"type": "number"
},
"priceIsLive": {
"type": "boolean",
"description": "Backwards-compatible freshness flag. True only when the production catalogue price is within the delayed-feed freshness window; never implies real-time tick data."
},
"lastPriceUpdate": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"asOf": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Upstream capture timestamp for the price used in this valuation."
},
"stale": {
"type": "boolean",
"description": "True when the price timestamp is missing or older than the published freshness window."
},
"priceSource": {
"type": "string",
"enum": [
"PRODUCTION_CATALOGUE",
"SANDBOX_HOLDING",
"STORED_HOLDING"
]
},
"dataQuality": {
"oneOf": [
{
"type": "object",
"description": "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.\n",
"required": [
"asOf",
"ageSeconds",
"stale",
"delayMode",
"delayMinutes",
"refreshIntervalSeconds",
"provider",
"disclaimer"
],
"properties": {
"asOf": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Timestamp of the exchange observation, not the time the API response was generated."
},
"ageSeconds": {
"type": [
"integer",
"null"
],
"description": "Age of the price in seconds (now − asOf)."
},
"stale": {
"type": "boolean",
"description": "True when the price is older than two refresh intervals."
},
"delayMode": {
"type": "string",
"enum": [
"DELAYED",
"END_OF_DAY"
],
"description": "DELAYED — exchange-supplied data in the 15-minute-delayed latency class. END_OF_DAY — outside the window; this is the most recent close, not a live quote.\n"
},
"delayMinutes": {
"type": "integer",
"example": 15,
"description": "Exchange feed latency class in minutes. This is distinct from the API refresh target."
},
"refreshIntervalSeconds": {
"type": "integer",
"example": 900,
"description": "Target interval between API ingestion refreshes during the published coverage window."
},
"provider": {
"type": "string",
"enum": [
"mstocks",
"mansa"
],
"description": "MyStocks ingestion connector for this exchange feed. This field does not describe exchange licensing or partner entitlement."
},
"disclaimer": {
"type": "string",
"description": "Plain-English statement of what this price is and is not."
}
}
},
{
"type": "object",
"description": "Stored valuation evidence, distinct from an exchange quote or executable price. Zero delay and refresh fields mean no market-feed cadence is claimed.",
"required": [
"asOf",
"ageSeconds",
"stale",
"delayMode",
"delayMinutes",
"refreshIntervalSeconds",
"provider",
"disclaimer"
],
"properties": {
"asOf": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"ageSeconds": {
"type": [
"integer",
"null"
]
},
"stale": {
"type": "boolean",
"const": true
},
"delayMode": {
"type": "string",
"enum": [
"STORED_VALUATION"
]
},
"delayMinutes": {
"type": "integer",
"const": 0
},
"refreshIntervalSeconds": {
"type": "integer",
"const": 0
},
"provider": {
"type": "string",
"enum": [
"STORED_HOLDING"
]
},
"disclaimer": {
"type": "string"
}
}
}
]
},
"assetType": {
"type": "string"
},
"assetId": {
"type": "string"
},
"valuationBasis": {
"type": "string",
"description": "Stored NAV",
"unit price or commitment cost; never an executable quote.": null
},
"valuationAvailable": {
"type": "boolean"
},
"id": {
"type": "string",
"deprecated": true,
"description": "Legacy master-account alias."
},
"name": {
"type": [
"string",
"null"
],
"deprecated": true,
"description": "Legacy alias of stockName."
},
"costBasis": {
"type": "number",
"deprecated": true,
"description": "Legacy alias of avgCost."
},
"amountInvested": {
"type": "number",
"deprecated": true,
"description": "Legacy alias of investedCapital."
},
"localCurrency": {
"type": [
"string",
"null"
],
"deprecated": true
},
"gainLoss": {
"type": "number",
"deprecated": true,
"description": "Legacy alias of unrealisedPnl."
},
"liquidityStatus": {
"type": [
"string",
"null"
],
"deprecated": true
}
}
}
},
"count": {
"type": "integer",
"description": "Legacy master-account total retained for compatibility."
},
"totalValue": {
"type": "number",
"deprecated": true
},
"totalInvested": {
"type": "number",
"deprecated": true
},
"currency": {
"type": "string",
"enum": [
"USD"
]
}
}
}cURL JavaScript Python
Copycurl -X GET 'https://mystocks.africa/api/sandbox/v1/partner/portfolio' \
-H "Authorization: Bearer $MYSTOCKS_SANDBOX_API_KEY"