Skip to content
MyStocks Developers
API v1

API v1

Current stable contract

Versioning policyRelease changelog
Sandbox console

Auto-register sub-account

Sub-Accounts & White-Label Retail KYC

POST

/auto-register

Auto-register sub-account

Sandbox availablecreateAutoRegister

Single-call convenience endpoint that creates a sub-account and returns an API token for it. Idempotent on uid — calling twice with the same uid returns the existing sub-account and a fresh token. Equivalent to POST /users but returns auth context in one round trip.

Parameters

This endpoint has no path or query parameters.

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Idempotency-KeystringheaderRequired

Unique 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

uidstringRequired

Your internal user identifier. Idempotency key -- calling twice with the same uid returns the same sub-account.

Example: "user_42"

emailstring

Email address for the sub-account user.

Example: "alice@yourapp.com"

namestring

Full name shown in the MyStocks admin console.

Example: "Alice K."

phonestring

User phone number in E.164 format.

Example: "+254712345678"

countrystring

ISO 3166-1 alpha-2 country code.

Example: "KE"

Response fields

subAccountIdstring
tokenstring

Short-lived auth token for the sub-account.

isNewboolean

true if this call created the account, false if it already existed.

Response codes

200Sub-account created or retrieved.