Events


GET events

Description

Get a reverse-chronological list of trading events.

Resource URL

https://api.optionscity.com/events
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object Trading Event
Response Type Standard

Parameters

NameDescriptionRequired?Type
since_id Get only events more recent than the event with the specified ID. No String
embed_instrument Embed the full instrument definition related to the event, if applicable. Default is 'false'. No Boolean
embed_order Embed an order state snapshot from the time of the event, if applicable. Default is 'false'. No Boolean
order_id Retrieve all events for a given order id. This can be useful for order auditing. No Number
page 1-indexed page to retrieve. Default is 1. No Number
per_page Number of entries returned per page. Default is 100. No Number
account_id The Account ID of the trading events that should be returned. No Number
user_id The City API ID of the user whose trading events should be returned. No Number

Example Request

GET https://api.optionscity.com/events

Example Response

[ {
  "id" : "5bec26464700007600fc59b8",
  "event_type" : "OrderAction",
  "timestamp" : "2018-11-14T13:42:30.075Z",
  "order_action" : {
    "action_type" : "OrderCancellation",
    "order_id" : 1
  }
} ]

Trading Event Object

Description

One of any notable trading events for a user or account: order submission, order modification, order cancellation, exchange update to an order or an RFQ submission.

Fields

Field Type Optional Subtypes Description
id String No All City API identifier.
event_type String No All Indicates the type of event. One of 'OrderSubmit', 'OrderModify', 'OrderCancel', 'ExchangeOrderUpdate' or 'RfqSubmit'.
timestamp DateTime* No All The time the event occurred.
order_action Object No OrderActionEvent OrderActionErrorEvent The order action taken by the user.
order_update Object No ExchangeOrderUpdateEvent The order status update from the exchange.
error_msg String No OrderActionErrorEvent The error description for error events.
instrument Object Yes OrderActionEvent OrderActionErrorEvent ExchangeOrderUpdateEvent The full instrument definition related to this event, if embedded.
order Object Yes OrderActionEvent OrderActionErrorEvent ExchangeOrderUpdateEvent A snapshot of the full order state at the time of this action, if embedded.

JSON Sample

{
  "id" : "5bec26464700007600fc59b8",
  "event_type" : "OrderAction",
  "timestamp" : "2018-11-14T13:42:30.075Z",
  "order_action" : {
    "action_type" : "OrderCancellation",
    "order_id" : 1
  }
}

Order Update Object

Description

A notification from the exchange containing any status changes to an order (e.g. whether the order is open or closed, was partially filled, etc.).

Fields

Field Type Optional Description
last_msg_status String No One of 'NewAck', 'PartialFill', 'CompleteFill', 'CancelAck', 'ModifyAck', 'Rejected', 'Expired', 'Undefined', or 'OrderNotFound'.
price Number Yes Confirmation of the order's limit price.
last_filled_price Number Yes The last price at which the order was filled, if applicable.
total_filled_qty Number Yes The total quantity filled on the order.
remaining_qty Number Yes The remaining, unfilled quantity for the order.
rejection_reason String Yes A rejection reason, if applicable.
timestamp DateTime* No Time the notification was received.
order_id Number No The ID of the order on which the action was taken.

JSON Sample

{
  "last_msg_status" : "NewAck",
  "order_id" : 1,
  "price" : 100,
  "remaining_qty" : 10,
  "timestamp" : "2018-11-14T13:42:30.075Z"
}

* Date and time elements are ISO-8601 string representations