Withdraw from sub-account
Sub-Accounts & White-Label Retail KYC
/users/{userId}/withdraw
Withdraw from sub-account
createWithdrawNative 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. Moves USD from a sub-account's wallet back to your master wallet. Use this when your user requests a cash-out. The funds are immediately available in your master wallet. Pass a USD ledger amount or a supported local amount + currency; non-USD values are converted with MyStocks managed FX. Sandbox uses the same conversion model but virtual balances only. Missing FX rates and unsupported currencies are rejected. Pass Idempotency-Key to make withdrawals safe to retry.
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 move, 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: 200
amountUsdnumberExplicit USD ledger amount. Use this when you also include local cash-out display fields.
Example: 200
currencystringCurrency of amount. Defaults to USD. Non-USD amounts are converted with MyStocks managed FX.
Example: "KES"
notestringOptional description shown in transaction history.
localAmountnumberEquivalent in local currency for the audit trail.
Example: 26000
localCurrencystringISO 4217 code.
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
200Withdrawal processed.400Sub-account has insufficient wallet balance.