Add a fill to a position.
const url = 'https://api.tradr.cloud/api/positions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/fills';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"fees":"0","filledAt":"2026-04-15T12:00:00Z","notes":"example","price":"example","quantity":"example","type":"entry"}'};
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/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/fills \ --header 'Content-Type: application/json' \ --data '{ "fees": "0", "filledAt": "2026-04-15T12:00:00Z", "notes": "example", "price": "example", "quantity": "example", "type": "entry" }'Authed. A position is a sequence of fills, not a single trade: add an entry fill to open or scale in, an exit fill to scale out or close. The position’s average price, open quantity, status, and realised P&L are all derived from its fills, so adding one recomputes them. Monetary and quantity fields are strings to preserve decimal precision.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The position the fill belongs to.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Non-negative decimal.
Non-negative decimal.
Positive decimal.
Responses
Section titled “Responses”The created fill, plus positionClosed — true when this was the exit that balanced the entered quantity, which closes the position in the same transaction.
object
Decimal.
Decimal.
Decimal.
Example
{ "type": "entry"}Validation error: an exit quantity beyond the available entry quantity, or a fractional quantity on an options position.
No such position for this user.
The position is closed, or an exit fill was sent to a position that is still a draft.