Deposit to sub-account
Sub-Accounts & White-Label Retail KYC
/users/{userId}/deposit
Deposit to sub-account
createDepositNative opt-in: ?walletContract=2 transfers actual specified currency between firm and customer wallets. Body contains only amount and currency. Requires traceable funding origin and settled available funds. Live requires approved currency capabilities and partner policy. No FX or external bank payout occurs. The v2 response contains transferId, direction, currency, amount, sourceBalance, targetBalance, simulationOnly, and externalPayout=false. Legacy v1 behavior below remains unchanged. Credits USD from your master wallet into a sub-account's wallet. Your master wallet must have sufficient balance — check via GET /account. Managed FX model — pass a USD ledger amount (amount or amountUsd) or pass amount with a non-USD currency such as KES. MyStocks converts supported non-USD amounts into the USD ledger using the managed conversion terms from the FX quote endpoints; bulk rate export is disabled. Sandbox uses the same conversion model but virtual balances only. Missing FX rates and unsupported currencies are rejected. Pass Idempotency-Key to make deposit retries safe on network failure.
Parameters
walletContract1 | 2queryVersion 2 transfers actual currency without FX. Internal transfer only; body contains amount and currency.
Example: 1
userIdstringpathRequiredExample: usr_abc123
Headers
AuthorizationstringRequiredBearer sk_sandbox_<your_key> for sandbox requests.
Idempotency-KeystringheaderRequiredUnique string that makes write calls safe to retry on network failure. Required for money movement, trading, KYC, subscriptions, and webhook creation. Deduplicated for 24 hours -- duplicate keys return the cached response. HTTP 409 if a concurrent request with the same key is still in progress.
Example: dep_user42_1743152580
Request body
amountnumberUSD ledger amount to deposit, unless currency is a non-USD ISO code. If currency is non-USD, amount is interpreted in that currency and converted to USD by MyStocks managed FX.
Example: 500
amountUsdnumberExplicit USD ledger amount. Use this when you also include local display fields.
Example: 500
currencystringCurrency of amount. Defaults to USD. Non-USD amounts are converted with MyStocks managed FX.
Example: "KES"
notestringOptional description shown in the transaction history.
Example: "Mpesa STK push ref KE2482"
localAmountnumberEquivalent amount in the user local currency. Stored for audit and compliance only.
Example: 65000
localCurrencystringISO 4217 code for the local amount.
Example: "KES"
fxRatenumberLegacy partner-provided exchange rate. Omit this to use MyStocks managed FX.
Example: 130
Response fields
See the response format and API Reference for this endpoint.
Response codes
200Deposit processed.400Master wallet has insufficient balance.409Idempotency conflict.