Order Completed

The order has been completed

Event Name

Event Type

orders.completed

The 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

Attribute

Type

Description

id

string

unique event identifier

type

string

the type of event

timestamp

string

time when the event was created

payload

object

contains the details of the order

payload.id

string

unique order identifier

payload.orderNo

string

order number

payload.type

string

type of order

payload.side

string

order side:

  • BUY
  • SELL

payload.status

string

status of the order

payload.statusMessage

object

Only present on REJECTED orders

payload.statusMessage.errorCode

string

Error code for rejection reason. See Common Order Gateway Errors

payload.statusMessage.message

string

Human readable version of error code

payload.symbol

string

ticker symbol

payload.cumulativeQuantity

number

total quantity executed

payload.totalOrderAmount

number

total dollar amount of the order

payload.averagePrice

number

average price of the order

payload.quantity

number

requested quantity

payload.fees

number

the total amount of fees paid

payload.orderExpires

string

the timestamp of when the order expires

payload.createdBy

string

userID of who created the order

payload.userID

string

unique user identifier

payload.accountID

string

unique account identifier

payload.accountNo

string

account number

payload.created

string

when the order was created

payload.lastExecution

string

timestamp of when the order was last executed