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

Link an exit fill to an entry fill as one in-kind transfer.

PUT
/api/positions/{id}/fills/{fillId}/transfer-link
curl --request PUT \
--url https://api.tradr.cloud/api/positions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/fills/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/transfer-link \
--header 'Content-Type: application/json' \
--data '{ "entryFillId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Authed. Stores the link only if entryFillId names one of the caller’s own entry fills, the first fill is an exit, their positions sit in different accounts, they share the exit position’s symbol and side, their quantities are equal, and neither fill is already in a link; otherwise refuses with 409 and a reason first in the message (not_an_entry, same_account, different_security, quantity_mismatch, exit_already_linked, entry_already_linked). An entryFillId naming another user’s fill is refused as not_an_entry and never otherwise resolved. The write touches only the link row — no fill hook, ledger write, or position change runs.

id
required
string format: uuid
fillId
required
string format: uuid

Must be an exit fill of this position.

Media typeapplication/json
object
entryFillId
required
string format: uuid
Examplegenerated
{
"entryFillId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

The created link.

Media typeapplication/json
object
createdAt
string format: date-time
entryAccountId
string format: uuid
entryAccountName
string
entryFillId
string format: uuid
entryPositionId
string format: uuid
exitFillId
string format: uuid
id
string format: uuid
Examplegenerated
{
"createdAt": "2026-04-15T12:00:00Z",
"entryAccountId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"entryAccountName": "example",
"entryFillId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"entryPositionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"exitFillId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

No such position for this user

One of the six link rules is violated; the message starts with its reason.