Edit a fill.
const url = 'https://api.tradr.cloud/api/positions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/fills/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"fees":"example","filledAt":"2026-04-15T12:00:00Z","lotSelection":[{"entryFillId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","quantity":"example"}],"notes":"example","price":"example","quantity":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.tradr.cloud/api/positions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/fills/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Content-Type: application/json' \ --data '{ "fees": "example", "filledAt": "2026-04-15T12:00:00Z", "lotSelection": [ { "entryFillId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "quantity": "example" } ], "notes": "example", "price": "example", "quantity": "example" }'Authed. Corrects a recorded fill and recomputes the position’s derived figures. type is immutable — an entry cannot become an exit; delete the fill and add the right one instead. Every field is optional; only what you send changes. On an exit, lotSelection replaces the stored specific-identification choice; null clears it back to FIFO; omitted, any stored selection is left as-is — except a quantity change on an exit that already carries a selection, which requires a new one.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Non-negative decimal.
Exit only. Replaces the stored selection; null clears it (reverting the exit to FIFO); omitted, the stored selection (if any) is kept.
object
Must be an entry fill of this position.
Positive decimal.
Non-negative decimal.
Positive decimal.
Examplegenerated
{ "fees": "example", "filledAt": "2026-04-15T12:00:00Z", "lotSelection": [ { "entryFillId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "quantity": "example" } ], "notes": "example", "price": "example", "quantity": "example"}Responses
Section titled “ Responses ”The updated fill, carrying its stored lotSelection (null for an entry or an unselected exit).
object
Decimal.
object
Decimal.
Decimal.
Decimal.
Example
{ "type": "entry"}Validation error: an exit quantity beyond the available entry quantity, a fractional quantity on an options position, or a lotSelection repeating an entryFillId.
No such position or fill for this user.
The change would leave the position inconsistent with its other fills; a quantity change on a selected exit with no new lotSelection; a lotSelection naming an entry fill that is not an entry of this position, its quantities do not sum to the (post-edit) exit quantity, its claims exceed a lot, or the write would change an earlier exit’s matched lots; an entry quantity edit that would leave a selected exit’s claim above the lot; or a quantity change on a fill that is in an in-kind transfer link (remove the link first).