Delete a position (any status).
DELETE
/api/positions/{id}
const url = 'https://api.tradr.cloud/api/positions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = {method: 'DELETE'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api.tradr.cloud/api/positions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0Authed. Hard-deletes a position in any status (draft, open, or closed) and cascades to its fills. When the position had written a ledger entry via its close, a compensating position_pnl_reversal row is posted in the same transaction so the account balance is not left inflated; the ledger stays append-only (positionId is set NULL on the affected rows, which net to zero in the balance).
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Responses
Section titled “Responses”Position deleted; its fills cascade and any prior close is reversed in the ledger.
Position not found (or not owned by the user).