Create an account.
POST
/api/accounts
const url = 'https://api.tradr.cloud/api/accounts';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"brokerageId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","currency":"example","name":"example","startingBalance":"example","timezone":"America/New_York"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tradr.cloud/api/accounts \ --header 'Content-Type: application/json' \ --data '{ "brokerageId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "currency": "example", "name": "example", "startingBalance": "example", "timezone": "America/New_York" }'Authed. Creates a trading account for the current user. When feature gating is enabled and the user is a non-admin Free user at the L1 account cap, the create is refused with 403 TIER_LIMIT_ACCOUNTS (plan-tiers REQ-6.1) — admins and gating-off deployments pass through unchanged.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
brokerageId
string format: uuid
currency
required
string
name
required
string
startingBalance
string
timezone
IANA zone name (canonical spelling, e.g. America/New_York, Etc/UTC). Defines the account’s trading day. Omitted defaults to America/New_York; an unknown zone is a 400.
string
Example
America/New_YorkResponses
Section titled “Responses”The created account.
Validation error.
TIER_LIMIT_ACCOUNTS (account cap reached on the current plan) or FORBIDDEN (cross-user brokerage).
Duplicate account name.