Skip to content
MyStocks Developers
API v1

API v1

Current stable contract

Versioning policyRelease changelog
Sandbox console
Operate

SSE Events

MyStocks Partner API

Subscribe to MyStocks Server-Sent Events for order, wallet, KYC, dividend, market, and incident updates.

Explore endpoints

43 of 43
GET

/account

Get partner account

Full endpoint documentation
Sandbox availablelistAccount

Returns your partner profile — tier, wallet balance, API key metadata, and feature flags.

Parameters

walletContract1 | 2query

Opt in to actual currency wallets. Legacy indicative views remain unchanged.

Example: 1

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Response fields

accountIdstring
businessNamestring
emailstring
walletobject
wallet.currencystring

Example: "USD"

wallet.balancenumber
walletContractVersion1 | 2
walletModelUSD_LEDGER_WITH_INDICATIVE_EQUIVALENTS | NATIVE_CURRENCY_WALLETS
supportedConversionCurrenciesstring[]
currencyWalletsobject[]
currencyWallets[].currencystring
currencyWallets[].balanceKindstring
currencyWallets[].cashBalancenumber
currencyWallets[].reservednumber
currencyWallets[].externallyReservednumber
currencyWallets[].totalCashnumber
currencyWallets[].availablenumber
currencyWallets[].withdrawablenumber
currencyWallets[].availableForConversionnumber
currencyWallets[].policyEligibleboolean
currencyWallets[].internalTransferAvailablenumber

Traceable available funds for internal transfers

currencyWallets[].nativeFundingEnabledboolean
currencyWallets[].nativePayoutEnabledboolean
currencyWallets[].conversionEnabledboolean
walletsobject[]
wallets[].balanceKindstring
wallets[].indicativeboolean
wallets[].spendableboolean
wallets[].currencystring

Example: "KES"

wallets[].balancenumber

Example: 65000

wallets[].availablenumber

Example: 65000

wallets[].ledgerCurrencystring

Example: "USD"

wallets[].ledgerBalancenumber

Example: 500

wallets[].fxRatenumber

Example: 130

wallets[].fxSourcestring

Example: "MYSTOCKS_MANAGED_FX"

wallets[].fxRateAsOfstring | null
managedFxobject
managedFx.ledgerCurrencystring

Example: "USD"

managedFx.sourcestring

Example: "MYSTOCKS_MANAGED_FX"

managedFx.rateConventionstring

Example: "local currency units per USD"

managedFx.supportedCurrenciesstring[]
managedFx.asOfstring | null
portfolioValuenumber
investedCapitalnumber
realizedGainUsdnumber
environmentproduction | sandbox
pilotobject

Controlled-production policy. When enabled, production mutations fail closed unless admission, ownership, feature, limit, and reconciliation controls pass.

pilot.enabledbooleanRequired
pilot.statusNOT_APPROVED | APPROVED | PAUSED | COMPLETEDRequired
pilot.operationalOwnerunion
pilot.incidentContactunion
pilot.manualTreasuryReviewbooleanRequired

Always true for a controlled pilot; master-wallet top-ups and payouts remain pending until MyStocks treasury review.

pilot.featuresobjectRequired
pilot.limitsobjectRequired
pilot.reconciliationobjectRequired
pilot.readinessobjectRequired

Evidence and approvals required before mutations may resume and before the controlled pilot may complete.

Response codes

200Partner account details.
401Invalid API key.

GET /stream is a Server-Sent Events feed for partner-facing state changes. Use it for live application updates; use signed webhooks for durable server-to-server processing and reconciliation.

Connect

The stream uses the same partner base URL and authentication model as REST:

const source = new EventSource(
  'https://mystocks.africa/api/v1/partner/stream?access_token=ms_oauth_<short-lived-token>'
);
 
source.onmessage = (message) => {
  const event = JSON.parse(message.data);
  console.log(event.eventId, event.event, event.data);
};

For browser clients, prefer a short-lived OAuth token over exposing a long-lived partner key. For server clients, send the normal Authorization: Bearer header.

Resume and reconnect

Each frame carries an opaque timestamp:documentId stream cursor so events sharing a timestamp remain replayable. Legacy millisecond cursors are accepted. Persist the last id: value and reconnect with Last-Event-ID or ?since= after a network interruption. The connection may close after approximately 110 seconds; reconnect is expected. Heartbeat comments are sent periodically and should reset your idle timer.

id: 1842
data: {"eventId":"evt_...","event":"order.filled","data":{...}}

Delivery semantics

  • Events are at-least-once and can be duplicated.
  • Events can arrive out of order; derive state from the event payload and current REST state.
  • Deduplicate by eventId, not by cursor alone.
  • SSE is not a tick-by-tick market-price stream.
  • A stream reconnect does not replace daily reconciliation.

The same business events can be delivered through signed webhooks. See Trading lifecycles for order transitions and Daily Reconciliation for the durable operating record.

Was this page useful?

Your signal helps us tighten partner onboarding docs.

Send note

Last updated on

On this page