Create a position (draft).
const url = 'https://api.tradr.cloud/api/positions';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"accountId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","assetType":"stock","notes":"example","side":"long","stopLoss":"140.00","symbol":"example","targetPrice":"150.00"}'};
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/positions \ --header 'Content-Type: application/json' \ --data '{ "accountId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "assetType": "stock", "notes": "example", "side": "long", "stopLoss": "140.00", "symbol": "example", "targetPrice": "150.00" }'Authed. Creates a draft position in one of the user’s accounts. When feature gating is enabled and the user is a non-admin Free user, the create is refused with 403 TIER_LIMIT_POSITIONS at the L2 position cap, or 403 TIER_ACCOUNT_NOT_WRITABLE when over the L1 account cap and targeting an account other than the writable designation (plan-tiers REQ-6.1/6.6). Admins and gating-off deployments pass through unchanged. Existing-data management (close/fills/edit/delete) is never blocked (REQ-6.5).
Request Bodyrequired
Section titled “Request Bodyrequired”object
Trade-plan stop-loss price. Positive decimal string with up to 8 decimal places, or null. Used to compute risk/reward.
Example
140.00Trade-plan target price. Positive decimal string with up to 8 decimal places, or null. Used to compute the target R/R.
Example
150.00Responses
Section titled “Responses”The created position.
Validation error.
TIER_LIMIT_POSITIONS (position cap reached) or TIER_ACCOUNT_NOT_WRITABLE (non-writable account while over the account cap).
Account not found (or not owned by the user).