Skip to content
These docs describe Tradr v0.17.0. Running an older release? Check the release notes for what changed.

Edit a fill.

PUT
/api/positions/{id}/fills/{fillId}
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.

id
required
string format: uuid
fillId
required
string format: uuid
Media typeapplication/json
object
fees

Non-negative decimal.

string
filledAt
string format: date-time
lotSelection

Exit only. Replaces the stored selection; null clears it (reverting the exit to FIFO); omitted, the stored selection (if any) is kept.

Array<object>
nullable >= 1 items
object
entryFillId
required

Must be an entry fill of this position.

string format: uuid
quantity
required

Positive decimal.

string
notes
string
nullable <= 10000 characters
price

Non-negative decimal.

string
quantity

Positive decimal.

string
Examplegenerated
{
"fees": "example",
"filledAt": "2026-04-15T12:00:00Z",
"lotSelection": [
{
"entryFillId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"quantity": "example"
}
],
"notes": "example",
"price": "example",
"quantity": "example"
}

The updated fill, carrying its stored lotSelection (null for an entry or an unselected exit).

Media typeapplication/json
object
createdAt
string format: date-time
fees

Decimal.

string
filledAt
string format: date-time
id
string format: uuid
lotSelection
Array<object>
nullable
object
entryFillId
string format: uuid
quantity

Decimal.

string
notes
string
nullable
positionId
string format: uuid
price

Decimal.

string
quantity

Decimal.

string
type
string
Allowed values: entry exit
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).