Trading


POST orderactions

Description

Submit an order action to the exchange (submission, cancellation or modification). Note that only order submissions return an order object in the payload.

Resource URL

https://api.optionscity.com/orderactions
Authentication Required
HTTP Methods POST
Media Types application/json
Response Object Order Action Response
Response Type Standard
Request Object Order Action Response

Example Request

POST https://api.optionscity.com/orderactions
{
  "action_type" : "LimitOrderSub",
  "acct_id" : 1,
  "instrument_id" : 1,
  "side" : "Buy",
  "time_in_force" : "Day",
  "limit_price" : 123.45,
  "quantity" : 10,
  "trading_capacity" : 1,
  "liquidity_provision" : 0,
  "investment_decision" : 2345,
  "execution_decision" : 3456
}

Example Response

{
  "response_type" : "OrderActionSuccess",
  "order_id" : 1,
  "order" : {
    "id" : 1,
    "acct_id" : 1,
    "user_id" : 1,
    "instrument_id" : 1,
    "time_in_force" : "Day",
    "order_type" : "Limit",
    "side" : "Buy",
    "quantity" : 5,
    "remaining_quantity" : 5,
    "submitted_at" : "2019-09-23T14:57:47.714Z",
    "last_updated_at" : "2019-09-23T14:57:47.714Z",
    "limit_price" : 23.45,
    "last_msg_status" : "NewAck",
    "status" : "Open"
  }
}

POST cancelall

Description

Cancel all open orders for a customer.

Resource URL

https://api.optionscity.com/cancelall
Authentication Required
HTTP Methods POST
Media Types application/json
Response Object None
Response Type Standard

Example Request

POST https://api.optionscity.com/cancelall

Order Action Object

Description

Defines a trading action to be submitted to the exchange: order submission, modification or cancellation.

Fields

Field Type Optional Subtypes Description
action_type String No All Indicates action to take. Either 'LimitOrderSub', 'MarketOrderSub', 'StopOrderSub', 'StopLimitOrderSub', 'MarketLimitOrderSub', 'OrderCancellation', or 'OrderModification'.
acct_id Number No LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub City API account identifier.
instrument_id Number No LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub City API instrument identifier.
side String No All 'Buy' or 'Sell'.
quantity Number No LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub OrderModification The order quantity.
time_in_force String No LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub Specifies how long an unfilled order will remain open. One of 'Day', 'Gtc', 'Fok', 'Ioc', or 'Gtd'.
min_qty Number Yes LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub OrderModification The minimum quantity that can be filled, if desired.
max_show Number Yes LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub The maximum quantity shown at the exchange, if desired.
limit_price Number Yes LimitOrderSub StopLimitOrderSub OrderModification The limit price in a limit or stop-limit order.
stop_price Number Yes StopOrderSub StopLimitOrderSub OrderModification The stop price in a stop or stop-limit order.
order_id Number Yes OrderCancellation OrderModification The ID of the order on which the action was taken.
good_til_date DateTime* Yes Date on which the order will expire if time_in_force is set to Gtd. Format should be YYYY-MM-dd
position_effect String Yes Whether this order will be opening or cosing a position, must be one of "O" or "C"
client_id_code Number Yes LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub Client id code, as needed by MiFID II regulations
trading_capacity Number Yes LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub Trading capacity, as needed by MiFID II regulations. Allowed values are 0 = DEAL (own account) 1 = MTCH (matched principal) 2 = AOTC (any other capacity)
liquidity_provision Number Yes LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub Liquidity provision, as needed by MiFID II regulations
commodity_deriv_indicator Number Yes LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub Commodity derivative indicator, as needed by MiFID II regulations
investment_decision Number Yes LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub Investment decision, as needed by MiFID II regulations
execution_decision Number Yes LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub Execution decision, as needed by MiFID II regulations
mifid_id Number Yes LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub Mifid Id for ICEEU/LIFFE products that takes precedence over non-short code MiFID fields
trader_id String Yes LimitOrderSub MarketOrderSub StopOrderSub StopLimitOrderSub MarketLimitOrderSub Trader Id, as needed by MifID II regulations for Nordic products

JSON Sample

{
  "action_type" : "LimitOrderSub",
  "acct_id" : 1,
  "instrument_id" : 1,
  "side" : "Buy",
  "time_in_force" : "Day",
  "limit_price" : 123.45,
  "quantity" : 10,
  "trading_capacity" : 1,
  "liquidity_provision" : 0,
  "investment_decision" : 2345,
  "execution_decision" : 3456
}

Order Action Response Object

Description

Fields

Field Type Optional Subtypes Description
response_type String No All Indicates result of order action. One of 'OrderActionSuccess', 'OrderActionFailure', 'OrderActionRiskLimitBreach' or 'OrderActionNotConfigured'.
order_id Number No OrderActionSuccess The order ID of the order created as a result of the successful order submission.
order Object No OrderActionSuccess The order of the order created as a result of the successful order submission.
error_msg String No OrderActionFailure OrderActionRiskLimitBreach OrderActionNotConfigured Failure explanation when action fails.

JSON Sample

{
  "response_type" : "OrderActionSuccess",
  "order_id" : 1,
  "order" : {
    "id" : 1,
    "acct_id" : 1,
    "user_id" : 1,
    "instrument_id" : 1,
    "time_in_force" : "Day",
    "order_type" : "Limit",
    "side" : "Buy",
    "quantity" : 5,
    "remaining_quantity" : 5,
    "submitted_at" : "2019-09-23T14:57:47.714Z",
    "last_updated_at" : "2019-09-23T14:57:47.714Z",
    "limit_price" : 23.45,
    "last_msg_status" : "NewAck",
    "status" : "Open"
  }
}

* Date and time elements are ISO-8601 string representations