Skip to content

Reverse Position Event

POST
/position-events/{event_id}/reverse
curl --request POST \
--url https://example.com/position-events/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/reverse \
--header 'Content-Type: application/json' \
--data '{ "note": "example" }'

Reverse an event (corrections are reversals, never edits). Refused when the remaining history would go below zero on some date. The body (a note) is optional.

event_id
required
Event Id
string format: uuid
Media typeapplication/json
Any of:
PositionReverseRequest
object
note
Any of:
string
<= 500 characters

Example generated

{
"note": "example"
}

Successful Response

Media typeapplication/json
PositionEventResult

The event written and the position after it.

object
event
required
PositionEventOut
object
cost_basis
required
Any of:
string
created_at
required
Created At
string format: date-time
fees
required
Any of:
string
id
required
Id
string format: uuid
kind
required
Kind
string
Allowed values: set_quantity buy sell
note
required
Any of:
string
occurred_on
required
Occurred On
string format: date
origin
required
Origin
string
Allowed values: manual agent import
position_id
required
Position Id
string format: uuid
price
required
Any of:
string
quantity
required
Quantity
string
replaces_id
required
Any of:
string format: uuid
reversed_by
required
Any of:
string format: uuid
reverses_id
required
Any of:
string format: uuid
source_note
required
Any of:
string
position
required
PositionOut

A position as it stands today, computed from its events and the close in effect (newest date first; manual, then provider, then feed-implied only on a tie).

object
account_id
required
Account Id
string format: uuid
closed_at
required
Any of:
string format: date-time
cost_basis
required
Any of:
string
events
required
Events
integer
id
required
Id
string format: uuid
market_value
required
Any of:
string
name
required
Any of:
string
opened_on
required
Opened On
string format: date
price
required
Any of:
string
price_as_of
required
Any of:
string format: date
price_source
required
Any of:
string
quantity
required
Quantity
string
stale_price
required
Stale Price
boolean
symbol
required
Symbol
string
unrealized_gain
required
Any of:
string
value_out_of_range
required
Value Out Of Range
boolean

Example

{
"event": {
"kind": "set_quantity",
"origin": "manual"
}
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string

Example generated

{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}