Order Completed

The order has been completed

Event NameEvent Type
orders.completedThe order has been filled, contains details of the full order. This event is considered to be a terminal state of the order.

Filled Order

An order is completely filled and considered terminal.

{
  "id": "event_ddb09679-2f16-4440-9ef1-4bd209dfba26",
  "type": "orders.completed",
  "timestamp": "2019-03-28T22:40:03.267813768Z",
  "payload": {
    "id": "GC.f7590a52-75c7-4f3a-92c7-6b03e02dc44f",
    "orderNo": "GCWS000039",
    "type": "MARKET",
    "side": "BUY",
    "lastExecution" : "2019-03-28T22:40:03.240Z",
    "status": "FILLED",
    "symbol": "AAPL",
    "averagePrice": 188.72,
    "totalOrderAmount": 188.72,
    "cumulativeQuantity": 1,
    "quantity": 1,
    "fees": 0,
    "orderExpires": "2019-03-29T20:00:00.000Z",
    "lastExecuted": "2019-01-04T14:36:17.378Z",
    "createdBy": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd",
    "userID": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd",
    "accountID": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd.1403540676095",
    "accountNo": "DWZR000001",
    "created": "2019-03-28T22:40:03.240Z"
  }

Rejected Order

An order is rejected and considered terminal. Please see Common Order Gateway Errors for typical rejection reasons.

{
  "id": "event_a5859ce6-7c4d-4514-af40-23a1473ceb60",
  "type": "orders.completed",
  "timestamp": "2019-03-29T22:11:37.841989687Z",
  "payload": {
    "id": "GC.f39b4618-a2fb-4fa2-808e-b956059a79c8",
    "orderNo": "GCWS000054",
    "type": "MARKET",
    "side": "SELL",
    "status": "REJECTED",
    "statusMessage": {
      "errorCode": "O105",
      "message": "Order quantity exceeds quantity available for sale.  Cannot SELL SHORT.  [orderNo=GCWS000054] [orderqty=10000.0] [openQty=20.9873] [sellingInMarket=0] [restingOrderSummary=]"
    },
    "symbol": "AMZN",
    "averagePrice": 0,
    "cumulativeQuantity": 0,
    "quantity": 10000,
    "fees": 0,
    "orderExpires": "2019-04-01T20:00:00.000Z",
    "createdBy": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd",
    "userID": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd",
    "accountID": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd.1403540676095",
    "accountNo": "DWZR000001",
    "created": "2019-03-29T22:02:12.818Z"
  }
}
{
  "id": "event_a5859ce6-7c4d-4514-af40-23a1473ceb60",
  "type": "orders.completed",
  "timestamp": "2019-03-29T22:11:37.841989687Z",
  "payload": {
    "id": "GC.f73275d5-e124-4711-8816-b7f28707738c",
    "orderNo": "GCGA000019",
    "type": "MARKET",
    "side": "BUY",
    "status": "REJECTED",
    "statusMessage": {
      "errorCode": "O409",
      "message": "Order marked preventQueuing=TRUE, market is not open, rejecting."
    },
    "symbol": "AMZN",
    "averagePrice": 0,
    "cumulativeQuantity": 0,
    "quantity": 0,
    "amountCash": 10,
    "fees": 0,
    "orderExpires": "2019-04-01T20:00:00.000Z",
    "createdBy": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd",
    "userID": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd",
    "accountID": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd.1491330741850",
    "accountNo": "DWEF000010",
    "created": "2019-03-30T00:10:36.491Z",
    "preventQueuing": true
  }
}

Canceled Order

An order is canceled and considered terminal.

{
  "id": "event_a5859ce6-7c4d-4514-af40-23a1473ceb60",
  "type": "orders.completed",
  "timestamp": "2019-03-29T22:11:37.841989687Z",
  "payload": {
    "id": "GC.82079a33-ae23-4a0d-ab9e-a80229963e02",
    "orderNo": "GCZZ000027",
    "type": "STOP",
    "side": "SELL",
    "status": "CANCELED",
    "statusMessage": {
            "errorCode": "O099",
            "message": "JOS TS CXL "
        },
    "symbol": "AMZN",
    "triggerPrice": 100,
    "averagePrice": 0,
    "cumulativeQuantity": 0,
    "quantity": 5,
    "fees": 0,
    "createdBy": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd",
    "userID": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd",
    "accountID": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd.1403540676095",
    "accountNo": "DWZR000001",
    "created": "2019-03-29T22:11:24.013Z"
  }
}
{
  "id": "event_a5859ce6-7c4d-4514-af40-23a1473ceb60",
  "type": "orders.completed",
  "timestamp": "2019-03-29T22:11:37.841989687Z",
  "payload": {
    "id": "GC.82079a33-ae23-4a0d-ab9e-a80229963e02",
    "orderNo": "GCZZ000027",
    "type": "STOP",
    "side": "SELL",
    "status": "CANCELED",
    "statusMessage": {
        "errorCode": "O124",
        "message": "Corporate action cancellation. Stock Spinoff, Dividends",
        "reason": ["STOCK_SPINOFF", "DIVIDEND_CASH"]
    },
    "symbol": "AMZN",
    "triggerPrice": 100,
    "averagePrice": 0,
    "cumulativeQuantity": 0,
    "quantity": 5,
    "fees": 0,
    "createdBy": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd",
    "userID": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd",
    "accountID": "b25f0d36-b4e4-41f8-b3d9-9249e46402cd.1403540676095",
    "accountNo": "DWZR000001",
    "created": "2019-03-29T22:11:24.013Z"
  }
}

Results Explained

AttributeTypeDescription
idstringunique event identifier
typestringthe type of event
timestampstringtime when the event was created
payloadobjectcontains the details of the order
payload.idstringunique order identifier
payload.orderNostringorder number
payload.typestringtype of order
payload.sidestringorder side:
BUY
SELL
payload.statusstringstatus of the order
payload.statusMessageobjectOnly present on REJECTED orders
payload.statusMessage.errorCodestringError code for rejection reason. See Common Order Gateway Errors
payload.statusMessage.messagestringHuman readable version of error code
payload.symbolstringticker symbol
payload.cumulativeQuantitynumbertotal quantity executed
payload.totalOrderAmountnumbertotal dollar amount of the order
payload.averagePricenumberaverage price of the order
payload.quantitynumberrequested quantity
payload.feesnumberthe total amount of fees paid
payload.orderExpiresstringthe timestamp of when the order expires
payload.createdBystringuserID of who created the order
payload.userIDstringunique user identifier
payload.accountIDstringunique account identifier
payload.accountNostringaccount number
payload.createdstringwhen the order was created
payload.lastExecutionstringtimestamp of when the order was last executed