Reverse Position Event
POST
/position-events/{event_id}/reverse
const url = 'https://example.com/position-events/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/reverse';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"note":"example"}'};
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://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.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”event_id
required
Event Id
string format: uuid
Request Body
Section titled “Request Body”Media typeapplication/json
Any of:
null
Example generated
{ "note": "example"}Responses
Section titled “Responses”Successful Response
Media typeapplication/json
PositionEventResult
The event written and the position after it.
object
event
required
PositionEventOut
object
created_at
required
Created At
string format: date-time
id
required
Id
string format: uuid
kind
required
Kind
string
occurred_on
required
Occurred On
string format: date
origin
required
Origin
string
position_id
required
Position Id
string format: uuid
quantity
required
Quantity
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
events
required
Events
integer
id
required
Id
string format: uuid
opened_on
required
Opened On
string format: date
quantity
required
Quantity
string
stale_price
required
Stale Price
boolean
symbol
required
Symbol
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>
ValidationErrorobject
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" } ]}