Skip to content
MyStocks Developers
API v1

API v1

Current stable contract

Versioning policyRelease changelog
Sandbox console
Operate

Statements and Confirms

MyStocks Partner API

Build customer and partner statements from MyStocks ledgers, executions, fees, dividends, tax lots, and activity records.

Explore endpoints

24 of 24
GET

/users/{userId}/gains

Realized capital gains (sub-account)

Full endpoint documentation
Sandbox availablegetSubAccountGains

Realized gains/losses for a sub-account — each disposal FIFO-matched to its acquiring lot, with acquisition + disposal dates, cost basis, proceeds, holding period, and gain. Feed a capital-gains tax statement.

Parameters

userIdstringpathRequired

Example: usr_abc123

symbolstringquery
fromstringquery
tostringquery

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Response fields

subAccountIdstring | null
accountTypestring
currencystring

Example: "USD"

methodFIFO
countinteger
totalProceedsUsdnumber
totalCostUsdnumber
realizedGainUsdnumber
periodobject
period.fromstring | null
period.tostring | null
disposalsobject[]
disposals[].symbolstring
disposals[].exchangestring | null
disposals[].quantitynumber
disposals[].acquiredAtstring | null
disposals[].disposedAtstring | null
disposals[].holdingPeriodDaysinteger | null
disposals[].costBasisUsdnumber
disposals[].proceedsUsdnumber
disposals[].gainUsdnumber
disposals[].methodFIFO
disposals[].buyOrderIdstring
disposals[].sellOrderIdstring

Response codes

200Realized disposals.
404Sub-account not found.

MyStocks exposes source records for statements rather than prescribing your customer-facing statement layout. Combine the period-specific report endpoints with order executions and the client-activity feed.

Statement inputs

PurposeEndpoint
Customer activityGET /client-activity
Account transactionsGET /users/{userId}/transactions
Order and fill confirmsGET /users/{userId}/orders/{orderId}/executions
PositionsGET /report/positions or the sub-account portfolio endpoint
Fees and markupGET /report/fees and GET /report/revenue
DividendsGET /report/dividends and GET /dividends/{symbol}/history
Tax recordsGET /users/{userId}/tax-lots and GET /users/{userId}/gains
Partner invoiceGET /report/invoice?month=YYYY-MM

Store the source period, account identifier, symbol, currency, quantity, unit price, gross value, fees, FX metadata, order ID, execution sequence, event IDs, and request ID. Keep pending, settled, rejected, and cancelled states distinct.

For customer statements, clearly distinguish:

  • order acceptance from execution;
  • execution from settlement;
  • settled cash from unsettled proceeds;
  • local-market price from USD wallet impact;
  • MyStocks records from your own fees or disclosures.

Use the Daily Reconciliation process to verify statement totals before publication.

Was this page useful?

Your signal helps us tighten partner onboarding docs.

Send note

Last updated on

On this page