{ "info": { "title": "Orders", "version": "0.0.1" }, "swagger": "2.0", "produces": [ "application/json" ], "host": "api.tastyworks.com", "tags": [ { "name": "complex-orders", "description": "Allows an API client to retreive information about complex orders on a per account basis." }, { "name": "orders", "description": "Allows an API client to view, filter, create, cancel and replace orders." } ], "paths": { "/accounts/{account_number}/complex-orders": { "get": { "description": "Returns a paginated list of all Complex Orders", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "in": "query", "name": "page-offset", "type": "integer", "format": "int32", "default": 0, "required": false }, { "in": "query", "name": "per-page", "type": "integer", "format": "int32", "default": 10, "minimum": 1, "maximum": 200, "required": false } ], "responses": { "200": { "description": "Returns a paginated list of all Complex Orders", "schema": { "type": "array", "items": { "$ref": "#/definitions/ComplexOrder" } } } }, "tags": [ "complex-orders" ], "operationId": "getAccountsAccountNumberComplexOrders" }, "post": { "description": "Creates a new Complex Order from supplied params", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "name": "postAccountsAccountNumberComplexOrders", "in": "body", "required": true, "schema": { "$ref": "#/definitions/postAccountsAccountNumberComplexOrders" } } ], "responses": { "201": { "description": "Creates a new Complex Order from supplied params", "schema": { "$ref": "#/definitions/PlacedOrderResponse" } } }, "tags": [ "complex-orders" ], "operationId": "postAccountsAccountNumberComplexOrders" } }, "/accounts/{account_number}/complex-orders/dry-run": { "post": { "description": "Performs a dry-run for a new ComplexOrder from supplied params. Allows validation of potential orders.", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "name": "postAccountsAccountNumberComplexOrdersDryRun", "in": "body", "required": true, "schema": { "$ref": "#/definitions/postAccountsAccountNumberComplexOrdersDryRun" } } ], "responses": { "201": { "description": "Performs a dry-run for a new ComplexOrder from supplied params. Allows validation of potential orders.", "schema": { "$ref": "#/definitions/PlacedOrderResponse" } } }, "tags": [ "complex-orders" ], "operationId": "postAccountsAccountNumberComplexOrdersDryRun" } }, "/accounts/{account_number}/complex-orders/live": { "get": { "description": "Returns all Complex Orders where a compenent order was placed today", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true } ], "responses": { "200": { "description": "Returns all Complex Orders where a compenent order was placed today", "schema": { "type": "array", "items": { "$ref": "#/definitions/ComplexOrder" } } } }, "tags": [ "complex-orders" ], "operationId": "getAccountsAccountNumberComplexOrdersLive" } }, "/accounts/{account_number}/complex-orders/{id}": { "get": { "description": "Returns a full representation of a Complex Order", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "in": "path", "name": "id", "type": "integer", "format": "int32", "required": true } ], "responses": { "200": { "description": "Returns a full representation of a Complex Order", "schema": { "$ref": "#/definitions/ComplexOrder" } } }, "tags": [ "complex-orders" ], "operationId": "getAccountsAccountNumberComplexOrdersId" }, "patch": { "description": "Edit threshold-price of a PAIRS trade.", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "in": "path", "name": "id", "type": "integer", "format": "int32", "required": true }, { "name": "patchAccountsAccountNumberComplexOrdersId", "in": "body", "required": true, "schema": { "$ref": "#/definitions/patchAccountsAccountNumberComplexOrdersId" } } ], "responses": { "200": { "description": "Edit threshold-price of a PAIRS trade.", "schema": { "$ref": "#/definitions/PlacedOrderResponse" } } }, "tags": [ "complex-orders" ], "operationId": "patchAccountsAccountNumberComplexOrdersId" }, "delete": { "description": "Request cancellation for all non terminal components of a Complex Order", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "in": "path", "name": "id", "type": "integer", "format": "int32", "required": true } ], "responses": { "200": { "description": "Request cancellation for all non terminal components of a Complex Order", "schema": { "$ref": "#/definitions/ComplexOrder" } } }, "tags": [ "complex-orders" ], "operationId": "deleteAccountsAccountNumberComplexOrdersId" } }, "/accounts/{account_number}/complex-orders/{id}/dry-run": { "post": { "description": "Performs a dry-run for editing a ComplexOrder from supplied params.", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "in": "path", "name": "id", "type": "integer", "format": "int32", "required": true }, { "name": "postAccountsAccountNumberComplexOrdersIdDryRun", "in": "body", "required": true, "schema": { "$ref": "#/definitions/postAccountsAccountNumberComplexOrdersIdDryRun" } } ], "responses": { "201": { "description": "Performs a dry-run for editing a ComplexOrder from supplied params.", "schema": { "$ref": "#/definitions/PlacedOrderResponse" } } }, "tags": [ "complex-orders" ], "operationId": "postAccountsAccountNumberComplexOrdersIdDryRun" } }, "/accounts/{account_number}/orders": { "get": { "description": "Returns a paginated list of the customer's orders (as identified by the provided authentication token)\n based on sort param. If no sort is passed in, it defaults to descending order.", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "in": "query", "name": "page-offset", "type": "integer", "format": "int32", "default": 0, "required": false }, { "in": "query", "name": "per-page", "type": "integer", "format": "int32", "default": 100, "minimum": 1, "maximum": 200, "required": false }, { "in": "query", "name": "end-at", "description": "DateTime end range for filtering orders in full date-time", "type": "string", "format": "date-time", "required": false }, { "in": "query", "name": "end-date", "type": "string", "format": "date", "required": false }, { "in": "query", "name": "futures-symbol", "description": "Used to fetch both futures and futures options orders", "type": "string", "required": false }, { "in": "query", "name": "sort", "description": "The order to sort results in. Accepts `Desc` or `Asc`. Defaults to `Desc`", "type": "string", "default": "Desc", "enum": [ "Desc", "Asc" ], "required": false }, { "in": "query", "name": "start-at", "description": "DateTime start rage for filtering orders in full date-time. Required if start-date param not provided", "type": "string", "format": "date-time", "required": false }, { "in": "query", "name": "start-date", "type": "string", "format": "date", "required": false }, { "in": "query", "name": "status", "description": " (example: status[]={value1}&status[]={value2})", "type": "array", "items": { "type": "string" }, "required": false }, { "in": "query", "name": "underlying-instrument-type", "description": "Underlying instrument type", "type": "string", "required": false }, { "in": "query", "name": "underlying-symbol", "type": "string", "required": false } ], "responses": { "200": { "description": "Returns a paginated list of the customer's orders (as identified by the provided authentication token)\n based on sort param. If no sort is passed in, it defaults to descending order.", "schema": { "type": "array", "items": { "$ref": "#/definitions/Order" } } } }, "tags": [ "orders" ], "operationId": "getAccountsAccountNumberOrders" }, "post": { "description": "Accepts a json document containing parameters to create an order for the client.", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "name": "postAccountsAccountNumberOrders", "in": "body", "required": true, "schema": { "$ref": "#/definitions/postAccountsAccountNumberOrders" } } ], "responses": { "201": { "description": "Accepts a json document containing parameters to create an order for the client.", "schema": { "$ref": "#/definitions/PlacedOrderResponse" } } }, "tags": [ "orders" ], "operationId": "postAccountsAccountNumberOrders" } }, "/accounts/{account_number}/orders/dry-run": { "post": { "description": "Accepts a json document containing parameters to create an order and \\\n then runs the prefights without placing the order.", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "name": "postAccountsAccountNumberOrdersDryRun", "in": "body", "required": true, "schema": { "$ref": "#/definitions/postAccountsAccountNumberOrdersDryRun" } } ], "responses": { "201": { "description": "Accepts a json document containing parameters to create an order and \\\n then runs the prefights without placing the order.", "schema": { "$ref": "#/definitions/PlacedOrderResponse" } } }, "tags": [ "orders" ], "operationId": "postAccountsAccountNumberOrdersDryRun" } }, "/accounts/{account_number}/orders/live": { "get": { "description": "Returns a list of orders from the current trading day. Includes all statuses, not only Live.", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "in": "query", "name": "page-offset", "type": "integer", "format": "int32", "default": 0, "required": false }, { "in": "query", "name": "per-page", "type": "integer", "format": "int32", "default": 100, "minimum": 1, "maximum": 200, "required": false } ], "responses": { "200": { "description": "Returns a list of orders from the current trading day. Includes all statuses, not only Live.", "schema": { "type": "array", "items": { "$ref": "#/definitions/Order" } } } }, "tags": [ "orders" ], "operationId": "getAccountsAccountNumberOrdersLive" } }, "/accounts/{account_number}/orders/{id}": { "get": { "description": "Returns a single order based on the id", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "in": "path", "name": "id", "type": "integer", "format": "int32", "required": true } ], "responses": { "200": { "description": "Returns a single order based on the id", "schema": { "$ref": "#/definitions/Order" } } }, "tags": [ "orders" ], "operationId": "getAccountsAccountNumberOrdersId" }, "put": { "description": "Replaces a live order with a new one. Subsequent fills of the original order will abort the replacement.", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "in": "path", "name": "id", "type": "integer", "format": "int32", "required": true }, { "name": "putAccountsAccountNumberOrdersId", "in": "body", "required": true, "schema": { "$ref": "#/definitions/putAccountsAccountNumberOrdersId" } } ], "responses": { "200": { "description": "Replaces a live order with a new one. Subsequent fills of the original order will abort the replacement.", "schema": { "$ref": "#/definitions/Order" } } }, "tags": [ "orders" ], "operationId": "putAccountsAccountNumberOrdersId" }, "patch": { "description": "Edit price and execution properties of a live order by replacement. Subsequent fills of the original order\n will abort the replacement.", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "in": "path", "name": "id", "type": "integer", "format": "int32", "required": true }, { "name": "patchAccountsAccountNumberOrdersId", "in": "body", "required": true, "schema": { "$ref": "#/definitions/patchAccountsAccountNumberOrdersId" } } ], "responses": { "200": { "description": "Edit price and execution properties of a live order by replacement. Subsequent fills of the original order\n will abort the replacement.", "schema": { "$ref": "#/definitions/Order" } } }, "tags": [ "orders" ], "operationId": "patchAccountsAccountNumberOrdersId" }, "delete": { "description": "Requests order cancellation", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "in": "path", "name": "id", "type": "integer", "format": "int32", "required": true } ], "responses": { "200": { "description": "Requests order cancellation", "schema": { "$ref": "#/definitions/Order" } } }, "tags": [ "orders" ], "operationId": "deleteAccountsAccountNumberOrdersId" } }, "/accounts/{account_number}/orders/{id}/dry-run": { "post": { "description": "Runs through preflights for cancel-replace and edit without routing", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "integer", "format": "int32", "required": true }, { "in": "path", "name": "id", "type": "integer", "format": "int32", "required": true }, { "name": "postAccountsAccountNumberOrdersIdDryRun", "in": "body", "required": true, "schema": { "$ref": "#/definitions/postAccountsAccountNumberOrdersIdDryRun" } } ], "responses": { "201": { "description": "Runs through preflights for cancel-replace and edit without routing", "schema": { "$ref": "#/definitions/PlacedOrderResponse" } } }, "tags": [ "orders" ], "operationId": "postAccountsAccountNumberOrdersIdDryRun" } }, "/customers/{customer_id}/orders": { "get": { "description": "Returns a paginated list of the customer's orders (as identified by the provided authentication token)\n based on sort param. If no sort is passed in, it defaults to descending order.", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "customer_id", "type": "integer", "format": "int32", "required": true }, { "in": "query", "name": "account-numbers", "description": "The account numbers to use for the lookup (example: account-numbers[]={value1}&account-numbers[]={value2})", "type": "array", "items": { "type": "string" }, "required": true }, { "in": "query", "name": "page-offset", "type": "integer", "format": "int32", "default": 0, "required": false }, { "in": "query", "name": "per-page", "type": "integer", "format": "int32", "default": 100, "minimum": 1, "maximum": 200, "required": false }, { "in": "query", "name": "end-at", "description": "DateTime end range for filtering orders in full date-time", "type": "string", "format": "date-time", "required": false }, { "in": "query", "name": "end-date", "type": "string", "format": "date", "required": false }, { "in": "query", "name": "futures-symbol", "description": "Used to fetch both futures and futures options orders", "type": "string", "required": false }, { "in": "query", "name": "sort", "description": "The order to sort results in. Accepts `Desc` or `Asc`. Defaults to `Desc`", "type": "string", "default": "Desc", "enum": [ "Desc", "Asc" ], "required": false }, { "in": "query", "name": "start-at", "description": "DateTime start rage for filtering orders in full date-time. Required if start-date param not provided", "type": "string", "format": "date-time", "required": false }, { "in": "query", "name": "start-date", "type": "string", "format": "date", "required": false }, { "in": "query", "name": "status", "description": " (example: status[]={value1}&status[]={value2})", "type": "array", "items": { "type": "string" }, "required": false }, { "in": "query", "name": "underlying-instrument-type", "description": "Underlying instrument type", "type": "string", "required": false }, { "in": "query", "name": "underlying-symbol", "type": "string", "required": false } ], "responses": { "200": { "description": "Returns a paginated list of the customer's orders (as identified by the provided authentication token)\n based on sort param. If no sort is passed in, it defaults to descending order.", "schema": { "type": "array", "items": { "$ref": "#/definitions/Order" } } } }, "tags": [ "orders" ], "operationId": "getCustomersCustomerIdOrders" } }, "/customers/{customer_id}/orders/live": { "get": { "description": "Returns a list of orders from the current trading day. Includes all statuses, not only Live.", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "customer_id", "type": "integer", "format": "int32", "required": true }, { "in": "query", "name": "account-numbers", "description": "The account numbers to use for the lookup (example: account-numbers[]={value1}&account-numbers[]={value2})", "type": "array", "items": { "type": "string" }, "required": true }, { "in": "query", "name": "page-offset", "type": "integer", "format": "int32", "default": 0, "required": false }, { "in": "query", "name": "per-page", "type": "integer", "format": "int32", "default": 100, "minimum": 1, "maximum": 200, "required": false } ], "responses": { "200": { "description": "Returns a list of orders from the current trading day. Includes all statuses, not only Live.", "schema": { "type": "array", "items": { "$ref": "#/definitions/Order" } } } }, "tags": [ "orders" ], "operationId": "getCustomersCustomerIdOrdersLive" } } }, "definitions": { "ComplexOrder": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "account-number": { "description": "", "type": "string" }, "ratio-price-comparator": { "description": "", "type": "string" }, "ratio-price-is-threshold-based-on-notional": { "description": "", "type": "boolean" }, "ratio-price-threshold": { "description": "", "type": "number", "format": "double" }, "terminal-at": { "description": "", "type": "string" }, "type": { "description": "", "type": "string" }, "related-orders": { "type": "array", "items": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "complex-order-id": { "description": "", "type": "string" }, "complex-order-tag": { "description": "", "type": "string" }, "replaces-order-id": { "description": "", "type": "string" }, "replacing-order-id": { "description": "", "type": "string" }, "status": { "description": "", "type": "string" } }, "description": "Non-current orders. This includes replaced orders, unfilled orders, and terminal orders." } }, "orders": { "type": "array", "items": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "account-number": { "description": "", "type": "string" }, "cancel-user-id": { "description": "", "type": "string" }, "cancel-username": { "description": "", "type": "string" }, "cancellable": { "description": "", "type": "boolean" }, "cancelled-at": { "description": "", "type": "string", "format": "date-time" }, "cancelled-size": { "description": "", "type": "number", "format": "double" }, "complex-order-id": { "description": "", "type": "string" }, "complex-order-tag": { "description": "", "type": "string" }, "contingent-status": { "description": "", "type": "string" }, "editable": { "description": "", "type": "boolean" }, "edited": { "description": "", "type": "boolean" }, "external-identifier": { "description": "", "type": "string" }, "global-request-id": { "description": "", "type": "string" }, "gtc-date": { "description": "", "type": "string", "format": "date" }, "in-flight-at": { "description": "", "type": "string", "format": "date-time" }, "leg-count": { "description": "", "type": "string" }, "live-at": { "description": "", "type": "string", "format": "date-time" }, "order-type": { "description": "", "type": "string" }, "preflight-id": { "description": "", "type": "string" }, "price": { "description": "", "type": "number", "format": "double" }, "price-effect": { "description": "", "type": "string" }, "received-at": { "description": "", "type": "string", "format": "date-time" }, "reject-reason": { "description": "", "type": "string" }, "replaces-order-id": { "description": "", "type": "string" }, "replacing-order-id": { "description": "", "type": "string" }, "size": { "description": "", "type": "string" }, "source": { "description": "", "type": "string" }, "status": { "description": "", "type": "string" }, "stop-trigger": { "description": "", "type": "string" }, "terminal-at": { "description": "", "type": "string", "format": "date-time" }, "time-in-force": { "description": "", "type": "string" }, "underlying-instrument-type": { "description": "", "type": "string" }, "underlying-symbol": { "description": "", "type": "string" }, "updated-at": { "description": "", "type": "string" }, "user-id": { "description": "", "type": "string" }, "username": { "description": "", "type": "string" }, "value": { "description": "", "type": "number", "format": "double" }, "value-effect": { "description": "", "type": "string" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "string" }, "remaining-quantity": { "description": "", "type": "string" }, "symbol": { "description": "", "type": "string" }, "fills": { "type": "array", "items": { "type": "object", "properties": { "destination-venue": { "description": "", "type": "string" }, "ext-exec-id": { "description": "", "type": "string" }, "ext-group-fill-id": { "description": "", "type": "string" }, "fill-id": { "description": "", "type": "string" }, "fill-price": { "description": "", "type": "number", "format": "double" }, "filled-at": { "description": "", "type": "string", "format": "date-time" }, "quantity": { "description": "", "type": "string" } }, "description": "" } } }, "description": "" } }, "order-rule": { "type": "object", "properties": { "cancel-at": { "description": "", "type": "string", "format": "date-time" }, "cancelled-at": { "description": "", "type": "string", "format": "date-time" }, "route-after": { "description": "", "type": "string", "format": "date-time" }, "routed-at": { "description": "", "type": "string", "format": "date-time" }, "order-conditions": { "type": "array", "items": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "action": { "description": "", "type": "string" }, "comparator": { "description": "", "type": "string" }, "indicator": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "is-threshold-based-on-notional": { "description": "", "type": "boolean" }, "symbol": { "description": "", "type": "string" }, "threshold": { "description": "", "type": "number", "format": "double" }, "triggered-at": { "description": "", "type": "string", "format": "date-time" }, "triggered-value": { "description": "", "type": "number", "format": "double" }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "string" }, "quantity-direction": { "description": "", "type": "string" }, "symbol": { "description": "", "type": "string" } }, "description": "" } } }, "description": "" } } }, "description": "" } }, "description": "Orders with complex-order-tag: '::order'. For example, 'OTO::order' for OTO complex orders." } }, "trigger-order": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "account-number": { "description": "", "type": "string" }, "cancel-user-id": { "description": "", "type": "string" }, "cancel-username": { "description": "", "type": "string" }, "cancellable": { "description": "", "type": "boolean" }, "cancelled-at": { "description": "", "type": "string", "format": "date-time" }, "cancelled-size": { "description": "", "type": "number", "format": "double" }, "complex-order-id": { "description": "", "type": "string" }, "complex-order-tag": { "description": "", "type": "string" }, "contingent-status": { "description": "", "type": "string" }, "editable": { "description": "", "type": "boolean" }, "edited": { "description": "", "type": "boolean" }, "external-identifier": { "description": "", "type": "string" }, "global-request-id": { "description": "", "type": "string" }, "gtc-date": { "description": "", "type": "string", "format": "date" }, "in-flight-at": { "description": "", "type": "string", "format": "date-time" }, "leg-count": { "description": "", "type": "string" }, "live-at": { "description": "", "type": "string", "format": "date-time" }, "order-type": { "description": "", "type": "string" }, "preflight-id": { "description": "", "type": "string" }, "price": { "description": "", "type": "number", "format": "double" }, "price-effect": { "description": "", "type": "string" }, "received-at": { "description": "", "type": "string", "format": "date-time" }, "reject-reason": { "description": "", "type": "string" }, "replaces-order-id": { "description": "", "type": "string" }, "replacing-order-id": { "description": "", "type": "string" }, "size": { "description": "", "type": "string" }, "source": { "description": "", "type": "string" }, "status": { "description": "", "type": "string" }, "stop-trigger": { "description": "", "type": "string" }, "terminal-at": { "description": "", "type": "string", "format": "date-time" }, "time-in-force": { "description": "", "type": "string" }, "underlying-instrument-type": { "description": "", "type": "string" }, "underlying-symbol": { "description": "", "type": "string" }, "updated-at": { "description": "", "type": "string" }, "user-id": { "description": "", "type": "string" }, "username": { "description": "", "type": "string" }, "value": { "description": "", "type": "number", "format": "double" }, "value-effect": { "description": "", "type": "string" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "string" }, "remaining-quantity": { "description": "", "type": "string" }, "symbol": { "description": "", "type": "string" }, "fills": { "type": "array", "items": { "type": "object", "properties": { "destination-venue": { "description": "", "type": "string" }, "ext-exec-id": { "description": "", "type": "string" }, "ext-group-fill-id": { "description": "", "type": "string" }, "fill-id": { "description": "", "type": "string" }, "fill-price": { "description": "", "type": "number", "format": "double" }, "filled-at": { "description": "", "type": "string", "format": "date-time" }, "quantity": { "description": "", "type": "string" } }, "description": "" } } }, "description": "" } }, "order-rule": { "type": "object", "properties": { "cancel-at": { "description": "", "type": "string", "format": "date-time" }, "cancelled-at": { "description": "", "type": "string", "format": "date-time" }, "route-after": { "description": "", "type": "string", "format": "date-time" }, "routed-at": { "description": "", "type": "string", "format": "date-time" }, "order-conditions": { "type": "array", "items": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "action": { "description": "", "type": "string" }, "comparator": { "description": "", "type": "string" }, "indicator": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "is-threshold-based-on-notional": { "description": "", "type": "boolean" }, "symbol": { "description": "", "type": "string" }, "threshold": { "description": "", "type": "number", "format": "double" }, "triggered-at": { "description": "", "type": "string", "format": "date-time" }, "triggered-value": { "description": "", "type": "number", "format": "double" }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "string" }, "quantity-direction": { "description": "", "type": "string" }, "symbol": { "description": "", "type": "string" } }, "description": "" } } }, "description": "" } } }, "description": "" } }, "description": "Order with complex-order-tag: '::trigger-order'. For example, 'OTO::trigger-order for OTO complex orders." } }, "description": "ComplexOrder model" }, "postAccountsAccountNumberComplexOrders": { "type": "object", "properties": { "orders": { "type": "array", "description": "Array of orders for OCO/BLAST orders", "items": { "type": "object", "properties": { "gtc-date": { "type": "string", "format": "date", "description": "The date in which a GTD order will expire. Can only be provided if time-in-force is GTD." }, "order-type": { "type": "string", "description": "The type of order in regards to the price. i.e.\n `Limit`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`", "enum": [ "Limit", "Market", "Marketable Limit", "Notional Market", "Stop", "Stop Limit" ] }, "stop-trigger": { "type": "number", "format": "double", "description": "The price trigger at which a stop or stop-limit order becomes valid." }, "time-in-force": { "type": "string", "description": "The length in time before the order expires. i.e.\n `Day`, `Ext`, `Ext Overnight`, `GTC`, `GTC Ext`, `GTC Ext Overnight`, `GTD` or `IOC`", "enum": [ "Day", "Ext", "Ext Overnight", "GTC", "GTC Ext", "GTC Ext Overnight", "GTD", "IOC" ] }, "price": { "type": "number", "format": "double", "description": "The price of the Order. Required for limit and stop-limit orders." }, "price-effect": { "type": "string", "description": "If pay or receive payment for placing the order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "value": { "type": "number", "format": "double", "description": "The notional value of the Order, required for notional market orders." }, "value-effect": { "type": "string", "description": "If pay or receive payment for placing the notional market order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "automated-source": { "type": "boolean", "description": "If the order was placed from an automated source", "default": false }, "external-identifier": { "type": "string", "description": "External identifier for the order" }, "partition-key": { "type": "string", "description": "Account partition key" }, "preflight-id": { "type": "string", "description": "Transient order identifier used for matching preflight errors to an individual order" }, "source": { "type": "string", "description": "The source the order is coming from" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The directional action of the leg. i.e.\n `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.\n Note: `Buy` and `Sell` are only applicable to Futures orders.", "enum": [ "Allocate", "Buy", "Buy to Close", "Buy to Open", "Sell", "Sell to Close", "Sell to Open" ] }, "instrument-type": { "type": "string", "description": "The type of Instrument. i.e.\n `Cryptocurrency`, `Equity`, `Equity Option`, `Event Contract`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`", "enum": [ "Cryptocurrency", "Equity", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Liquidity Pool" ] }, "quantity": { "type": "number", "format": "double", "description": "The size of the contract. Required for all orders but notional market." }, "symbol": { "type": "string", "description": "The Stock Ticker Symbol `AAPL`, OCC Option Symbol `AAPL 191004P00275000`, \\\n TW Future Symbol `/ESZ9`, or TW Future Option Symbol `./ESZ9 EW4U9 190927P2975`" } }, "required": [ "action", "instrument-type", "symbol" ] } }, "rules": { "type": "object", "properties": { "cancel-at": { "type": "string", "format": "date-time", "description": "Latest time an order should be canceled at" }, "conditions": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The action in which the trigger is enacted. i.e.\n `cancel` and `route`", "enum": [ "cancel", "route" ] }, "instrument-type": { "type": "string", "description": "The instrument's type in relation to the condition. e.g. \\\n `Equity` or `Future`", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" }, "comparator": { "type": "string", "description": "How to compare against the threshold. \\\n Currently Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)", "enum": [ "gte", "lte" ] }, "indicator": { "type": "string", "description": "The indicator for the trigger, currently only supports `last`", "enum": [ "last", "nat" ] }, "threshold": { "type": "number", "format": "double", "description": "The price at which the condition triggers." }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "type": "string", "description": "The instrument's type in relation to the symbol.", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "quantity": { "type": "number", "format": "double", "description": "The Ratio quantity in relation to the symbol" }, "quantity-direction": { "type": "string", "description": "The quantity direction(ie Long or Short) in relation to the symbol", "enum": [ "Long", "Short" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" } }, "required": [ "instrument-type", "quantity", "quantity-direction", "symbol" ] } } }, "required": [ "action", "comparator", "indicator", "threshold" ] } }, "route-after": { "type": "string", "format": "date-time", "description": "Earliest time an order should route at" } } }, "advanced-instructions": { "type": "object", "properties": { "strict-position-effect-validation": { "type": "boolean", "description": "If the order should be rejected the open/close position effect is not valid", "default": false } } } }, "required": [ "order-type", "stop-trigger", "time-in-force", "price-effect", "value-effect", "legs" ] } }, "trigger-order": { "type": "object", "description": "Initial live order for OTO based orders", "properties": { "gtc-date": { "type": "string", "format": "date", "description": "The date in which a GTD order will expire. Can only be provided if time-in-force is GTD." }, "order-type": { "type": "string", "description": "The type of order in regards to the price. i.e.\n `Limit`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`", "enum": [ "Limit", "Market", "Marketable Limit", "Notional Market", "Stop", "Stop Limit" ] }, "stop-trigger": { "type": "number", "format": "double", "description": "The price trigger at which a stop or stop-limit order becomes valid." }, "time-in-force": { "type": "string", "description": "The length in time before the order expires. i.e.\n `Day`, `Ext`, `Ext Overnight`, `GTC`, `GTC Ext`, `GTC Ext Overnight`, `GTD` or `IOC`", "enum": [ "Day", "Ext", "Ext Overnight", "GTC", "GTC Ext", "GTC Ext Overnight", "GTD", "IOC" ] }, "price": { "type": "number", "format": "double", "description": "The price of the Order. Required for limit and stop-limit orders." }, "price-effect": { "type": "string", "description": "If pay or receive payment for placing the order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "value": { "type": "number", "format": "double", "description": "The notional value of the Order, required for notional market orders." }, "value-effect": { "type": "string", "description": "If pay or receive payment for placing the notional market order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "automated-source": { "type": "boolean", "description": "If the order was placed from an automated source", "default": false }, "external-identifier": { "type": "string", "description": "External identifier for the order" }, "partition-key": { "type": "string", "description": "Account partition key" }, "preflight-id": { "type": "string", "description": "Transient order identifier used for matching preflight errors to an individual order" }, "source": { "type": "string", "description": "The source the order is coming from" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The directional action of the leg. i.e.\n `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.\n Note: `Buy` and `Sell` are only applicable to Futures orders.", "enum": [ "Allocate", "Buy", "Buy to Close", "Buy to Open", "Sell", "Sell to Close", "Sell to Open" ] }, "instrument-type": { "type": "string", "description": "The type of Instrument. i.e.\n `Cryptocurrency`, `Equity`, `Equity Option`, `Event Contract`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`", "enum": [ "Cryptocurrency", "Equity", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Liquidity Pool" ] }, "quantity": { "type": "number", "format": "double", "description": "The size of the contract. Required for all orders but notional market." }, "symbol": { "type": "string", "description": "The Stock Ticker Symbol `AAPL`, OCC Option Symbol `AAPL 191004P00275000`, \\\n TW Future Symbol `/ESZ9`, or TW Future Option Symbol `./ESZ9 EW4U9 190927P2975`" } }, "required": [ "action", "instrument-type", "symbol" ] } }, "rules": { "type": "object", "properties": { "cancel-at": { "type": "string", "format": "date-time", "description": "Latest time an order should be canceled at" }, "conditions": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The action in which the trigger is enacted. i.e.\n `cancel` and `route`", "enum": [ "cancel", "route" ] }, "instrument-type": { "type": "string", "description": "The instrument's type in relation to the condition. e.g. \\\n `Equity` or `Future`", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" }, "comparator": { "type": "string", "description": "How to compare against the threshold. \\\n Currently Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)", "enum": [ "gte", "lte" ] }, "indicator": { "type": "string", "description": "The indicator for the trigger, currently only supports `last`", "enum": [ "last", "nat" ] }, "threshold": { "type": "number", "format": "double", "description": "The price at which the condition triggers." }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "type": "string", "description": "The instrument's type in relation to the symbol.", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "quantity": { "type": "number", "format": "double", "description": "The Ratio quantity in relation to the symbol" }, "quantity-direction": { "type": "string", "description": "The quantity direction(ie Long or Short) in relation to the symbol", "enum": [ "Long", "Short" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" } }, "required": [ "instrument-type", "quantity", "quantity-direction", "symbol" ] } } }, "required": [ "action", "comparator", "indicator", "threshold" ] } }, "route-after": { "type": "string", "format": "date-time", "description": "Earliest time an order should route at" } } }, "advanced-instructions": { "type": "object", "properties": { "strict-position-effect-validation": { "type": "boolean", "description": "If the order should be rejected the open/close position effect is not valid", "default": false } } } }, "required": [ "order-type", "stop-trigger", "time-in-force", "price-effect", "value-effect", "legs" ] }, "type": { "type": "string", "description": "The type of stragegy for the complex order i.e.\n `BLAST`, `OCO`, `OTO`, `OTOCO` or `PAIRS`", "enum": [ "BLAST", "OCO", "OTO", "OTOCO", "PAIRS" ] }, "ratio-price-comparator": { "type": "string", "description": "How to compare against the ratio price. \\\n Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)", "enum": [ "gte", "lte" ] }, "ratio-price-is-threshold-based-on-notional": { "type": "boolean", "description": "If comparison is in notional value instead of price." }, "ratio-price-threshold": { "type": "number", "format": "double", "description": "Ratio price for a PAIRS trade" }, "source": { "type": "string", "description": "The source the order is coming from" } }, "required": [ "orders", "type", "ratio-price-comparator", "ratio-price-threshold" ], "description": "Creates a new Complex Order from supplied params" }, "PlacedOrderResponse": { "type": "object", "properties": { "buying-power-effect": { "description": "", "type": "string" }, "closing-fee-calculation": { "description": "", "type": "string" }, "complex-order": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "account-number": { "description": "", "type": "string" }, "ratio-price-comparator": { "description": "", "type": "string" }, "ratio-price-is-threshold-based-on-notional": { "description": "", "type": "boolean" }, "ratio-price-threshold": { "description": "", "type": "number", "format": "double" }, "terminal-at": { "description": "", "type": "string" }, "type": { "description": "", "type": "string" }, "related-orders": { "type": "array", "items": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "complex-order-id": { "description": "", "type": "string" }, "complex-order-tag": { "description": "", "type": "string" }, "replaces-order-id": { "description": "", "type": "string" }, "replacing-order-id": { "description": "", "type": "string" }, "status": { "description": "", "type": "string" } }, "description": "Non-current orders. This includes replaced orders, unfilled orders, and terminal orders." } }, "orders": { "type": "array", "items": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "account-number": { "description": "", "type": "string" }, "cancel-user-id": { "description": "", "type": "string" }, "cancel-username": { "description": "", "type": "string" }, "cancellable": { "description": "", "type": "boolean" }, "cancelled-at": { "description": "", "type": "string", "format": "date-time" }, "cancelled-size": { "description": "", "type": "number", "format": "double" }, "complex-order-id": { "description": "", "type": "string" }, "complex-order-tag": { "description": "", "type": "string" }, "contingent-status": { "description": "", "type": "string" }, "editable": { "description": "", "type": "boolean" }, "edited": { "description": "", "type": "boolean" }, "external-identifier": { "description": "", "type": "string" }, "global-request-id": { "description": "", "type": "string" }, "gtc-date": { "description": "", "type": "string", "format": "date" }, "in-flight-at": { "description": "", "type": "string", "format": "date-time" }, "leg-count": { "description": "", "type": "string" }, "live-at": { "description": "", "type": "string", "format": "date-time" }, "order-type": { "description": "", "type": "string" }, "preflight-id": { "description": "", "type": "string" }, "price": { "description": "", "type": "number", "format": "double" }, "price-effect": { "description": "", "type": "string" }, "received-at": { "description": "", "type": "string", "format": "date-time" }, "reject-reason": { "description": "", "type": "string" }, "replaces-order-id": { "description": "", "type": "string" }, "replacing-order-id": { "description": "", "type": "string" }, "size": { "description": "", "type": "string" }, "source": { "description": "", "type": "string" }, "status": { "description": "", "type": "string" }, "stop-trigger": { "description": "", "type": "string" }, "terminal-at": { "description": "", "type": "string", "format": "date-time" }, "time-in-force": { "description": "", "type": "string" }, "underlying-instrument-type": { "description": "", "type": "string" }, "underlying-symbol": { "description": "", "type": "string" }, "updated-at": { "description": "", "type": "string" }, "user-id": { "description": "", "type": "string" }, "username": { "description": "", "type": "string" }, "value": { "description": "", "type": "number", "format": "double" }, "value-effect": { "description": "", "type": "string" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "string" }, "remaining-quantity": { "description": "", "type": "string" }, "symbol": { "description": "", "type": "string" }, "fills": { "type": "array", "items": { "type": "object", "properties": { "destination-venue": { "description": "", "type": "string" }, "ext-exec-id": { "description": "", "type": "string" }, "ext-group-fill-id": { "description": "", "type": "string" }, "fill-id": { "description": "", "type": "string" }, "fill-price": { "description": "", "type": "number", "format": "double" }, "filled-at": { "description": "", "type": "string", "format": "date-time" }, "quantity": { "description": "", "type": "string" } }, "description": "" } } }, "description": "" } }, "order-rule": { "type": "object", "properties": { "cancel-at": { "description": "", "type": "string", "format": "date-time" }, "cancelled-at": { "description": "", "type": "string", "format": "date-time" }, "route-after": { "description": "", "type": "string", "format": "date-time" }, "routed-at": { "description": "", "type": "string", "format": "date-time" }, "order-conditions": { "type": "array", "items": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "action": { "description": "", "type": "string" }, "comparator": { "description": "", "type": "string" }, "indicator": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "is-threshold-based-on-notional": { "description": "", "type": "boolean" }, "symbol": { "description": "", "type": "string" }, "threshold": { "description": "", "type": "number", "format": "double" }, "triggered-at": { "description": "", "type": "string", "format": "date-time" }, "triggered-value": { "description": "", "type": "number", "format": "double" }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "string" }, "quantity-direction": { "description": "", "type": "string" }, "symbol": { "description": "", "type": "string" } }, "description": "" } } }, "description": "" } } }, "description": "" } }, "description": "Orders with complex-order-tag: '::order'. For example, 'OTO::order' for OTO complex orders." } }, "trigger-order": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "account-number": { "description": "", "type": "string" }, "cancel-user-id": { "description": "", "type": "string" }, "cancel-username": { "description": "", "type": "string" }, "cancellable": { "description": "", "type": "boolean" }, "cancelled-at": { "description": "", "type": "string", "format": "date-time" }, "cancelled-size": { "description": "", "type": "number", "format": "double" }, "complex-order-id": { "description": "", "type": "string" }, "complex-order-tag": { "description": "", "type": "string" }, "contingent-status": { "description": "", "type": "string" }, "editable": { "description": "", "type": "boolean" }, "edited": { "description": "", "type": "boolean" }, "external-identifier": { "description": "", "type": "string" }, "global-request-id": { "description": "", "type": "string" }, "gtc-date": { "description": "", "type": "string", "format": "date" }, "in-flight-at": { "description": "", "type": "string", "format": "date-time" }, "leg-count": { "description": "", "type": "string" }, "live-at": { "description": "", "type": "string", "format": "date-time" }, "order-type": { "description": "", "type": "string" }, "preflight-id": { "description": "", "type": "string" }, "price": { "description": "", "type": "number", "format": "double" }, "price-effect": { "description": "", "type": "string" }, "received-at": { "description": "", "type": "string", "format": "date-time" }, "reject-reason": { "description": "", "type": "string" }, "replaces-order-id": { "description": "", "type": "string" }, "replacing-order-id": { "description": "", "type": "string" }, "size": { "description": "", "type": "string" }, "source": { "description": "", "type": "string" }, "status": { "description": "", "type": "string" }, "stop-trigger": { "description": "", "type": "string" }, "terminal-at": { "description": "", "type": "string", "format": "date-time" }, "time-in-force": { "description": "", "type": "string" }, "underlying-instrument-type": { "description": "", "type": "string" }, "underlying-symbol": { "description": "", "type": "string" }, "updated-at": { "description": "", "type": "string" }, "user-id": { "description": "", "type": "string" }, "username": { "description": "", "type": "string" }, "value": { "description": "", "type": "number", "format": "double" }, "value-effect": { "description": "", "type": "string" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "string" }, "remaining-quantity": { "description": "", "type": "string" }, "symbol": { "description": "", "type": "string" }, "fills": { "type": "array", "items": { "type": "object", "properties": { "destination-venue": { "description": "", "type": "string" }, "ext-exec-id": { "description": "", "type": "string" }, "ext-group-fill-id": { "description": "", "type": "string" }, "fill-id": { "description": "", "type": "string" }, "fill-price": { "description": "", "type": "number", "format": "double" }, "filled-at": { "description": "", "type": "string", "format": "date-time" }, "quantity": { "description": "", "type": "string" } }, "description": "" } } }, "description": "" } }, "order-rule": { "type": "object", "properties": { "cancel-at": { "description": "", "type": "string", "format": "date-time" }, "cancelled-at": { "description": "", "type": "string", "format": "date-time" }, "route-after": { "description": "", "type": "string", "format": "date-time" }, "routed-at": { "description": "", "type": "string", "format": "date-time" }, "order-conditions": { "type": "array", "items": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "action": { "description": "", "type": "string" }, "comparator": { "description": "", "type": "string" }, "indicator": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "is-threshold-based-on-notional": { "description": "", "type": "boolean" }, "symbol": { "description": "", "type": "string" }, "threshold": { "description": "", "type": "number", "format": "double" }, "triggered-at": { "description": "", "type": "string", "format": "date-time" }, "triggered-value": { "description": "", "type": "number", "format": "double" }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "string" }, "quantity-direction": { "description": "", "type": "string" }, "symbol": { "description": "", "type": "string" } }, "description": "" } } }, "description": "" } } }, "description": "" } }, "description": "Order with complex-order-tag: '::trigger-order'. For example, 'OTO::trigger-order for OTO complex orders." } }, "description": "" }, "errors": { "type": "array", "items": { "type": "object", "properties": { "code": { "description": "", "type": "string" }, "message": { "description": "", "type": "string" }, "preflight-id": { "description": "", "type": "string" } }, "description": "" } }, "fee-calculation": { "description": "", "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "properties": { "code": { "description": "", "type": "string" }, "message": { "description": "", "type": "string" }, "preflight-id": { "description": "", "type": "string" }, "url": { "description": "", "type": "string" } }, "description": "" } }, "order": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "account-number": { "description": "", "type": "string" }, "cancel-user-id": { "description": "", "type": "string" }, "cancel-username": { "description": "", "type": "string" }, "cancellable": { "description": "", "type": "boolean" }, "cancelled-at": { "description": "", "type": "string", "format": "date-time" }, "cancelled-size": { "description": "", "type": "number", "format": "double" }, "complex-order-id": { "description": "", "type": "string" }, "complex-order-tag": { "description": "", "type": "string" }, "contingent-status": { "description": "", "type": "string" }, "editable": { "description": "", "type": "boolean" }, "edited": { "description": "", "type": "boolean" }, "external-identifier": { "description": "", "type": "string" }, "global-request-id": { "description": "", "type": "string" }, "gtc-date": { "description": "", "type": "string", "format": "date" }, "in-flight-at": { "description": "", "type": "string", "format": "date-time" }, "leg-count": { "description": "", "type": "string" }, "live-at": { "description": "", "type": "string", "format": "date-time" }, "order-type": { "description": "", "type": "string" }, "preflight-id": { "description": "", "type": "string" }, "price": { "description": "", "type": "number", "format": "double" }, "price-effect": { "description": "", "type": "string" }, "received-at": { "description": "", "type": "string", "format": "date-time" }, "reject-reason": { "description": "", "type": "string" }, "replaces-order-id": { "description": "", "type": "string" }, "replacing-order-id": { "description": "", "type": "string" }, "size": { "description": "", "type": "string" }, "source": { "description": "", "type": "string" }, "status": { "description": "", "type": "string" }, "stop-trigger": { "description": "", "type": "string" }, "terminal-at": { "description": "", "type": "string", "format": "date-time" }, "time-in-force": { "description": "", "type": "string" }, "underlying-instrument-type": { "description": "", "type": "string" }, "underlying-symbol": { "description": "", "type": "string" }, "updated-at": { "description": "", "type": "string" }, "user-id": { "description": "", "type": "string" }, "username": { "description": "", "type": "string" }, "value": { "description": "", "type": "number", "format": "double" }, "value-effect": { "description": "", "type": "string" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "string" }, "remaining-quantity": { "description": "", "type": "string" }, "symbol": { "description": "", "type": "string" }, "fills": { "type": "array", "items": { "type": "object", "properties": { "destination-venue": { "description": "", "type": "string" }, "ext-exec-id": { "description": "", "type": "string" }, "ext-group-fill-id": { "description": "", "type": "string" }, "fill-id": { "description": "", "type": "string" }, "fill-price": { "description": "", "type": "number", "format": "double" }, "filled-at": { "description": "", "type": "string", "format": "date-time" }, "quantity": { "description": "", "type": "string" } }, "description": "" } } }, "description": "" } }, "order-rule": { "type": "object", "properties": { "cancel-at": { "description": "", "type": "string", "format": "date-time" }, "cancelled-at": { "description": "", "type": "string", "format": "date-time" }, "route-after": { "description": "", "type": "string", "format": "date-time" }, "routed-at": { "description": "", "type": "string", "format": "date-time" }, "order-conditions": { "type": "array", "items": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "action": { "description": "", "type": "string" }, "comparator": { "description": "", "type": "string" }, "indicator": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "is-threshold-based-on-notional": { "description": "", "type": "boolean" }, "symbol": { "description": "", "type": "string" }, "threshold": { "description": "", "type": "number", "format": "double" }, "triggered-at": { "description": "", "type": "string", "format": "date-time" }, "triggered-value": { "description": "", "type": "number", "format": "double" }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "string" }, "quantity-direction": { "description": "", "type": "string" }, "symbol": { "description": "", "type": "string" } }, "description": "" } } }, "description": "" } } }, "description": "" } }, "description": "" }, "warnings": { "type": "array", "items": { "type": "object", "properties": { "code": { "description": "", "type": "string" }, "message": { "description": "", "type": "string" }, "preflight-id": { "description": "", "type": "string" } }, "description": "" } } }, "description": "PlacedOrderResponse model" }, "postAccountsAccountNumberComplexOrdersDryRun": { "type": "object", "properties": { "orders": { "type": "array", "description": "Array of orders for OCO/BLAST orders", "items": { "type": "object", "properties": { "gtc-date": { "type": "string", "format": "date", "description": "The date in which a GTD order will expire. Can only be provided if time-in-force is GTD." }, "order-type": { "type": "string", "description": "The type of order in regards to the price. i.e.\n `Limit`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`", "enum": [ "Limit", "Market", "Marketable Limit", "Notional Market", "Stop", "Stop Limit" ] }, "stop-trigger": { "type": "number", "format": "double", "description": "The price trigger at which a stop or stop-limit order becomes valid." }, "time-in-force": { "type": "string", "description": "The length in time before the order expires. i.e.\n `Day`, `Ext`, `Ext Overnight`, `GTC`, `GTC Ext`, `GTC Ext Overnight`, `GTD` or `IOC`", "enum": [ "Day", "Ext", "Ext Overnight", "GTC", "GTC Ext", "GTC Ext Overnight", "GTD", "IOC" ] }, "price": { "type": "number", "format": "double", "description": "The price of the Order. Required for limit and stop-limit orders." }, "price-effect": { "type": "string", "description": "If pay or receive payment for placing the order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "value": { "type": "number", "format": "double", "description": "The notional value of the Order, required for notional market orders." }, "value-effect": { "type": "string", "description": "If pay or receive payment for placing the notional market order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "automated-source": { "type": "boolean", "description": "If the order was placed from an automated source", "default": false }, "external-identifier": { "type": "string", "description": "External identifier for the order" }, "partition-key": { "type": "string", "description": "Account partition key" }, "preflight-id": { "type": "string", "description": "Transient order identifier used for matching preflight errors to an individual order" }, "source": { "type": "string", "description": "The source the order is coming from" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The directional action of the leg. i.e.\n `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.\n Note: `Buy` and `Sell` are only applicable to Futures orders.", "enum": [ "Allocate", "Buy", "Buy to Close", "Buy to Open", "Sell", "Sell to Close", "Sell to Open" ] }, "instrument-type": { "type": "string", "description": "The type of Instrument. i.e.\n `Cryptocurrency`, `Equity`, `Equity Option`, `Event Contract`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`", "enum": [ "Cryptocurrency", "Equity", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Liquidity Pool" ] }, "quantity": { "type": "number", "format": "double", "description": "The size of the contract. Required for all orders but notional market." }, "symbol": { "type": "string", "description": "The Stock Ticker Symbol `AAPL`, OCC Option Symbol `AAPL 191004P00275000`, \\\n TW Future Symbol `/ESZ9`, or TW Future Option Symbol `./ESZ9 EW4U9 190927P2975`" } }, "required": [ "action", "instrument-type", "symbol" ] } }, "rules": { "type": "object", "properties": { "cancel-at": { "type": "string", "format": "date-time", "description": "Latest time an order should be canceled at" }, "conditions": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The action in which the trigger is enacted. i.e.\n `cancel` and `route`", "enum": [ "cancel", "route" ] }, "instrument-type": { "type": "string", "description": "The instrument's type in relation to the condition. e.g. \\\n `Equity` or `Future`", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" }, "comparator": { "type": "string", "description": "How to compare against the threshold. \\\n Currently Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)", "enum": [ "gte", "lte" ] }, "indicator": { "type": "string", "description": "The indicator for the trigger, currently only supports `last`", "enum": [ "last", "nat" ] }, "threshold": { "type": "number", "format": "double", "description": "The price at which the condition triggers." }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "type": "string", "description": "The instrument's type in relation to the symbol.", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "quantity": { "type": "number", "format": "double", "description": "The Ratio quantity in relation to the symbol" }, "quantity-direction": { "type": "string", "description": "The quantity direction(ie Long or Short) in relation to the symbol", "enum": [ "Long", "Short" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" } }, "required": [ "instrument-type", "quantity", "quantity-direction", "symbol" ] } } }, "required": [ "action", "comparator", "indicator", "threshold" ] } }, "route-after": { "type": "string", "format": "date-time", "description": "Earliest time an order should route at" } } }, "advanced-instructions": { "type": "object", "properties": { "strict-position-effect-validation": { "type": "boolean", "description": "If the order should be rejected the open/close position effect is not valid", "default": false } } } }, "required": [ "order-type", "stop-trigger", "time-in-force", "price-effect", "value-effect", "legs" ] } }, "trigger-order": { "type": "object", "description": "Initial live order for OTO based orders", "properties": { "gtc-date": { "type": "string", "format": "date", "description": "The date in which a GTD order will expire. Can only be provided if time-in-force is GTD." }, "order-type": { "type": "string", "description": "The type of order in regards to the price. i.e.\n `Limit`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`", "enum": [ "Limit", "Market", "Marketable Limit", "Notional Market", "Stop", "Stop Limit" ] }, "stop-trigger": { "type": "number", "format": "double", "description": "The price trigger at which a stop or stop-limit order becomes valid." }, "time-in-force": { "type": "string", "description": "The length in time before the order expires. i.e.\n `Day`, `Ext`, `Ext Overnight`, `GTC`, `GTC Ext`, `GTC Ext Overnight`, `GTD` or `IOC`", "enum": [ "Day", "Ext", "Ext Overnight", "GTC", "GTC Ext", "GTC Ext Overnight", "GTD", "IOC" ] }, "price": { "type": "number", "format": "double", "description": "The price of the Order. Required for limit and stop-limit orders." }, "price-effect": { "type": "string", "description": "If pay or receive payment for placing the order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "value": { "type": "number", "format": "double", "description": "The notional value of the Order, required for notional market orders." }, "value-effect": { "type": "string", "description": "If pay or receive payment for placing the notional market order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "automated-source": { "type": "boolean", "description": "If the order was placed from an automated source", "default": false }, "external-identifier": { "type": "string", "description": "External identifier for the order" }, "partition-key": { "type": "string", "description": "Account partition key" }, "preflight-id": { "type": "string", "description": "Transient order identifier used for matching preflight errors to an individual order" }, "source": { "type": "string", "description": "The source the order is coming from" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The directional action of the leg. i.e.\n `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.\n Note: `Buy` and `Sell` are only applicable to Futures orders.", "enum": [ "Allocate", "Buy", "Buy to Close", "Buy to Open", "Sell", "Sell to Close", "Sell to Open" ] }, "instrument-type": { "type": "string", "description": "The type of Instrument. i.e.\n `Cryptocurrency`, `Equity`, `Equity Option`, `Event Contract`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`", "enum": [ "Cryptocurrency", "Equity", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Liquidity Pool" ] }, "quantity": { "type": "number", "format": "double", "description": "The size of the contract. Required for all orders but notional market." }, "symbol": { "type": "string", "description": "The Stock Ticker Symbol `AAPL`, OCC Option Symbol `AAPL 191004P00275000`, \\\n TW Future Symbol `/ESZ9`, or TW Future Option Symbol `./ESZ9 EW4U9 190927P2975`" } }, "required": [ "action", "instrument-type", "symbol" ] } }, "rules": { "type": "object", "properties": { "cancel-at": { "type": "string", "format": "date-time", "description": "Latest time an order should be canceled at" }, "conditions": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The action in which the trigger is enacted. i.e.\n `cancel` and `route`", "enum": [ "cancel", "route" ] }, "instrument-type": { "type": "string", "description": "The instrument's type in relation to the condition. e.g. \\\n `Equity` or `Future`", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" }, "comparator": { "type": "string", "description": "How to compare against the threshold. \\\n Currently Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)", "enum": [ "gte", "lte" ] }, "indicator": { "type": "string", "description": "The indicator for the trigger, currently only supports `last`", "enum": [ "last", "nat" ] }, "threshold": { "type": "number", "format": "double", "description": "The price at which the condition triggers." }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "type": "string", "description": "The instrument's type in relation to the symbol.", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "quantity": { "type": "number", "format": "double", "description": "The Ratio quantity in relation to the symbol" }, "quantity-direction": { "type": "string", "description": "The quantity direction(ie Long or Short) in relation to the symbol", "enum": [ "Long", "Short" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" } }, "required": [ "instrument-type", "quantity", "quantity-direction", "symbol" ] } } }, "required": [ "action", "comparator", "indicator", "threshold" ] } }, "route-after": { "type": "string", "format": "date-time", "description": "Earliest time an order should route at" } } }, "advanced-instructions": { "type": "object", "properties": { "strict-position-effect-validation": { "type": "boolean", "description": "If the order should be rejected the open/close position effect is not valid", "default": false } } } }, "required": [ "order-type", "stop-trigger", "time-in-force", "price-effect", "value-effect", "legs" ] }, "type": { "type": "string", "description": "The type of stragegy for the complex order i.e.\n `BLAST`, `OCO`, `OTO`, `OTOCO` or `PAIRS`", "enum": [ "BLAST", "OCO", "OTO", "OTOCO", "PAIRS" ] }, "ratio-price-comparator": { "type": "string", "description": "How to compare against the ratio price. \\\n Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)", "enum": [ "gte", "lte" ] }, "ratio-price-is-threshold-based-on-notional": { "type": "boolean", "description": "If comparison is in notional value instead of price." }, "ratio-price-threshold": { "type": "number", "format": "double", "description": "Ratio price for a PAIRS trade" }, "source": { "type": "string", "description": "The source the order is coming from" } }, "required": [ "orders", "type", "ratio-price-comparator", "ratio-price-threshold" ], "description": "Performs a dry-run for a new ComplexOrder from supplied params. Allows validation of potential orders." }, "patchAccountsAccountNumberComplexOrdersId": { "type": "object", "properties": { "ratio-price-comparator": { "type": "string", "description": "How to compare against the ratio price. \\\n Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)", "enum": [ "gte", "lte" ] }, "ratio-price-threshold": { "type": "number", "format": "double", "description": "Ratio price for a PAIRS trade" } }, "description": "Edit threshold-price of a PAIRS trade." }, "postAccountsAccountNumberComplexOrdersIdDryRun": { "type": "object", "properties": { "ratio-price-comparator": { "type": "string", "description": "How to compare against the ratio price. \\\n Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)", "enum": [ "gte", "lte" ] }, "ratio-price-threshold": { "type": "number", "format": "double", "description": "Ratio price for a PAIRS trade" } }, "description": "Performs a dry-run for editing a ComplexOrder from supplied params." }, "postAccountsAccountNumberOrders": { "type": "object", "properties": { "gtc-date": { "type": "string", "format": "date", "description": "The date in which a GTD order will expire. Can only be provided if time-in-force is GTD." }, "order-type": { "type": "string", "description": "The type of order in regards to the price. i.e.\n `Limit`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`", "enum": [ "Limit", "Market", "Marketable Limit", "Notional Market", "Stop", "Stop Limit" ] }, "stop-trigger": { "type": "number", "format": "double", "description": "The price trigger at which a stop or stop-limit order becomes valid." }, "time-in-force": { "type": "string", "description": "The length in time before the order expires. i.e.\n `Day`, `Ext`, `Ext Overnight`, `GTC`, `GTC Ext`, `GTC Ext Overnight`, `GTD` or `IOC`", "enum": [ "Day", "Ext", "Ext Overnight", "GTC", "GTC Ext", "GTC Ext Overnight", "GTD", "IOC" ] }, "price": { "type": "number", "format": "double", "description": "The price of the Order. Required for limit and stop-limit orders." }, "price-effect": { "type": "string", "description": "If pay or receive payment for placing the order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "value": { "type": "number", "format": "double", "description": "The notional value of the Order, required for notional market orders." }, "value-effect": { "type": "string", "description": "If pay or receive payment for placing the notional market order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "automated-source": { "type": "boolean", "description": "If the order was placed from an automated source", "default": false }, "external-identifier": { "type": "string", "description": "External identifier for the order" }, "partition-key": { "type": "string", "description": "Account partition key" }, "preflight-id": { "type": "string", "description": "Transient order identifier used for matching preflight errors to an individual order" }, "source": { "type": "string", "description": "The source the order is coming from" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The directional action of the leg. i.e.\n `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.\n Note: `Buy` and `Sell` are only applicable to Futures orders.", "enum": [ "Allocate", "Buy", "Buy to Close", "Buy to Open", "Sell", "Sell to Close", "Sell to Open" ] }, "instrument-type": { "type": "string", "description": "The type of Instrument. i.e.\n `Cryptocurrency`, `Equity`, `Equity Option`, `Event Contract`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`", "enum": [ "Cryptocurrency", "Equity", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Liquidity Pool" ] }, "quantity": { "type": "number", "format": "double", "description": "The size of the contract. Required for all orders but notional market." }, "symbol": { "type": "string", "description": "The Stock Ticker Symbol `AAPL`, OCC Option Symbol `AAPL 191004P00275000`, \\\n TW Future Symbol `/ESZ9`, or TW Future Option Symbol `./ESZ9 EW4U9 190927P2975`" } }, "required": [ "action", "instrument-type", "symbol" ] } }, "rules": { "type": "object", "properties": { "cancel-at": { "type": "string", "format": "date-time", "description": "Latest time an order should be canceled at" }, "conditions": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The action in which the trigger is enacted. i.e.\n `cancel` and `route`", "enum": [ "cancel", "route" ] }, "instrument-type": { "type": "string", "description": "The instrument's type in relation to the condition. e.g. \\\n `Equity` or `Future`", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" }, "comparator": { "type": "string", "description": "How to compare against the threshold. \\\n Currently Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)", "enum": [ "gte", "lte" ] }, "indicator": { "type": "string", "description": "The indicator for the trigger, currently only supports `last`", "enum": [ "last", "nat" ] }, "threshold": { "type": "number", "format": "double", "description": "The price at which the condition triggers." }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "type": "string", "description": "The instrument's type in relation to the symbol.", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "quantity": { "type": "number", "format": "double", "description": "The Ratio quantity in relation to the symbol" }, "quantity-direction": { "type": "string", "description": "The quantity direction(ie Long or Short) in relation to the symbol", "enum": [ "Long", "Short" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" } }, "required": [ "instrument-type", "quantity", "quantity-direction", "symbol" ] } } }, "required": [ "action", "comparator", "indicator", "threshold" ] } }, "route-after": { "type": "string", "format": "date-time", "description": "Earliest time an order should route at" } } }, "advanced-instructions": { "type": "object", "properties": { "strict-position-effect-validation": { "type": "boolean", "description": "If the order should be rejected the open/close position effect is not valid", "default": false } } } }, "required": [ "order-type", "stop-trigger", "time-in-force", "price-effect", "value-effect", "legs" ], "description": "Accepts a json document containing parameters to create an order for the client." }, "postAccountsAccountNumberOrdersDryRun": { "type": "object", "properties": { "gtc-date": { "type": "string", "format": "date", "description": "The date in which a GTD order will expire. Can only be provided if time-in-force is GTD." }, "order-type": { "type": "string", "description": "The type of order in regards to the price. i.e.\n `Limit`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`", "enum": [ "Limit", "Market", "Marketable Limit", "Notional Market", "Stop", "Stop Limit" ] }, "stop-trigger": { "type": "number", "format": "double", "description": "The price trigger at which a stop or stop-limit order becomes valid." }, "time-in-force": { "type": "string", "description": "The length in time before the order expires. i.e.\n `Day`, `Ext`, `Ext Overnight`, `GTC`, `GTC Ext`, `GTC Ext Overnight`, `GTD` or `IOC`", "enum": [ "Day", "Ext", "Ext Overnight", "GTC", "GTC Ext", "GTC Ext Overnight", "GTD", "IOC" ] }, "price": { "type": "number", "format": "double", "description": "The price of the Order. Required for limit and stop-limit orders." }, "price-effect": { "type": "string", "description": "If pay or receive payment for placing the order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "value": { "type": "number", "format": "double", "description": "The notional value of the Order, required for notional market orders." }, "value-effect": { "type": "string", "description": "If pay or receive payment for placing the notional market order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "automated-source": { "type": "boolean", "description": "If the order was placed from an automated source", "default": false }, "external-identifier": { "type": "string", "description": "External identifier for the order" }, "partition-key": { "type": "string", "description": "Account partition key" }, "preflight-id": { "type": "string", "description": "Transient order identifier used for matching preflight errors to an individual order" }, "source": { "type": "string", "description": "The source the order is coming from" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The directional action of the leg. i.e.\n `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.\n Note: `Buy` and `Sell` are only applicable to Futures orders.", "enum": [ "Allocate", "Buy", "Buy to Close", "Buy to Open", "Sell", "Sell to Close", "Sell to Open" ] }, "instrument-type": { "type": "string", "description": "The type of Instrument. i.e.\n `Cryptocurrency`, `Equity`, `Equity Option`, `Event Contract`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`", "enum": [ "Cryptocurrency", "Equity", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Liquidity Pool" ] }, "quantity": { "type": "number", "format": "double", "description": "The size of the contract. Required for all orders but notional market." }, "symbol": { "type": "string", "description": "The Stock Ticker Symbol `AAPL`, OCC Option Symbol `AAPL 191004P00275000`, \\\n TW Future Symbol `/ESZ9`, or TW Future Option Symbol `./ESZ9 EW4U9 190927P2975`" } }, "required": [ "action", "instrument-type", "symbol" ] } }, "rules": { "type": "object", "properties": { "cancel-at": { "type": "string", "format": "date-time", "description": "Latest time an order should be canceled at" }, "conditions": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The action in which the trigger is enacted. i.e.\n `cancel` and `route`", "enum": [ "cancel", "route" ] }, "instrument-type": { "type": "string", "description": "The instrument's type in relation to the condition. e.g. \\\n `Equity` or `Future`", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" }, "comparator": { "type": "string", "description": "How to compare against the threshold. \\\n Currently Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)", "enum": [ "gte", "lte" ] }, "indicator": { "type": "string", "description": "The indicator for the trigger, currently only supports `last`", "enum": [ "last", "nat" ] }, "threshold": { "type": "number", "format": "double", "description": "The price at which the condition triggers." }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "type": "string", "description": "The instrument's type in relation to the symbol.", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "quantity": { "type": "number", "format": "double", "description": "The Ratio quantity in relation to the symbol" }, "quantity-direction": { "type": "string", "description": "The quantity direction(ie Long or Short) in relation to the symbol", "enum": [ "Long", "Short" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" } }, "required": [ "instrument-type", "quantity", "quantity-direction", "symbol" ] } } }, "required": [ "action", "comparator", "indicator", "threshold" ] } }, "route-after": { "type": "string", "format": "date-time", "description": "Earliest time an order should route at" } } }, "advanced-instructions": { "type": "object", "properties": { "strict-position-effect-validation": { "type": "boolean", "description": "If the order should be rejected the open/close position effect is not valid", "default": false } } } }, "required": [ "order-type", "stop-trigger", "time-in-force", "price-effect", "value-effect", "legs" ], "description": "Accepts a json document containing parameters to create an order and \\\n then runs the prefights without placing the order." }, "Order": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "account-number": { "description": "", "type": "string" }, "cancel-user-id": { "description": "", "type": "string" }, "cancel-username": { "description": "", "type": "string" }, "cancellable": { "description": "", "type": "boolean" }, "cancelled-at": { "description": "", "type": "string", "format": "date-time" }, "cancelled-size": { "description": "", "type": "number", "format": "double" }, "complex-order-id": { "description": "", "type": "string" }, "complex-order-tag": { "description": "", "type": "string" }, "contingent-status": { "description": "", "type": "string" }, "editable": { "description": "", "type": "boolean" }, "edited": { "description": "", "type": "boolean" }, "external-identifier": { "description": "", "type": "string" }, "global-request-id": { "description": "", "type": "string" }, "gtc-date": { "description": "", "type": "string", "format": "date" }, "in-flight-at": { "description": "", "type": "string", "format": "date-time" }, "leg-count": { "description": "", "type": "string" }, "live-at": { "description": "", "type": "string", "format": "date-time" }, "order-type": { "description": "", "type": "string" }, "preflight-id": { "description": "", "type": "string" }, "price": { "description": "", "type": "number", "format": "double" }, "price-effect": { "description": "", "type": "string" }, "received-at": { "description": "", "type": "string", "format": "date-time" }, "reject-reason": { "description": "", "type": "string" }, "replaces-order-id": { "description": "", "type": "string" }, "replacing-order-id": { "description": "", "type": "string" }, "size": { "description": "", "type": "string" }, "source": { "description": "", "type": "string" }, "status": { "description": "", "type": "string" }, "stop-trigger": { "description": "", "type": "string" }, "terminal-at": { "description": "", "type": "string", "format": "date-time" }, "time-in-force": { "description": "", "type": "string" }, "underlying-instrument-type": { "description": "", "type": "string" }, "underlying-symbol": { "description": "", "type": "string" }, "updated-at": { "description": "", "type": "string" }, "user-id": { "description": "", "type": "string" }, "username": { "description": "", "type": "string" }, "value": { "description": "", "type": "number", "format": "double" }, "value-effect": { "description": "", "type": "string" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "string" }, "remaining-quantity": { "description": "", "type": "string" }, "symbol": { "description": "", "type": "string" }, "fills": { "type": "array", "items": { "type": "object", "properties": { "destination-venue": { "description": "", "type": "string" }, "ext-exec-id": { "description": "", "type": "string" }, "ext-group-fill-id": { "description": "", "type": "string" }, "fill-id": { "description": "", "type": "string" }, "fill-price": { "description": "", "type": "number", "format": "double" }, "filled-at": { "description": "", "type": "string", "format": "date-time" }, "quantity": { "description": "", "type": "string" } }, "description": "" } } }, "description": "" } }, "order-rule": { "type": "object", "properties": { "cancel-at": { "description": "", "type": "string", "format": "date-time" }, "cancelled-at": { "description": "", "type": "string", "format": "date-time" }, "route-after": { "description": "", "type": "string", "format": "date-time" }, "routed-at": { "description": "", "type": "string", "format": "date-time" }, "order-conditions": { "type": "array", "items": { "type": "object", "properties": { "id": { "description": "", "type": "string" }, "action": { "description": "", "type": "string" }, "comparator": { "description": "", "type": "string" }, "indicator": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "is-threshold-based-on-notional": { "description": "", "type": "boolean" }, "symbol": { "description": "", "type": "string" }, "threshold": { "description": "", "type": "number", "format": "double" }, "triggered-at": { "description": "", "type": "string", "format": "date-time" }, "triggered-value": { "description": "", "type": "number", "format": "double" }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "string" }, "quantity-direction": { "description": "", "type": "string" }, "symbol": { "description": "", "type": "string" } }, "description": "" } } }, "description": "" } } }, "description": "" } }, "description": "Order model" }, "patchAccountsAccountNumberOrdersId": { "type": "object", "properties": { "gtc-date": { "type": "string", "format": "date", "description": "The date in which a GTD order will expire. Can only be provided if time-in-force is GTD." }, "order-type": { "type": "string", "description": "The type of order in regards to the price. i.e.\n `Limit`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`", "enum": [ "Limit", "Market", "Marketable Limit", "Notional Market", "Stop", "Stop Limit" ] }, "stop-trigger": { "type": "number", "format": "double", "description": "The price trigger at which a stop or stop-limit order becomes valid." }, "time-in-force": { "type": "string", "description": "The length in time before the order expires. i.e.\n `Day`, `Ext`, `Ext Overnight`, `GTC`, `GTC Ext`, `GTC Ext Overnight`, `GTD` or `IOC`", "enum": [ "Day", "Ext", "Ext Overnight", "GTC", "GTC Ext", "GTC Ext Overnight", "GTD", "IOC" ] }, "price": { "type": "number", "format": "double", "description": "The price of the Order. Required for limit and stop-limit orders." }, "price-effect": { "type": "string", "description": "If pay or receive payment for placing the order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "value": { "type": "number", "format": "double", "description": "The notional value of the Order, required for notional market orders." }, "value-effect": { "type": "string", "description": "If pay or receive payment for placing the notional market order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "automated-source": { "type": "boolean", "description": "If the order was placed from an automated source", "default": false }, "external-identifier": { "type": "string", "description": "External identifier for the order" }, "partition-key": { "type": "string", "description": "Account partition key" }, "preflight-id": { "type": "string", "description": "Transient order identifier used for matching preflight errors to an individual order" }, "source": { "type": "string", "description": "The source the order is coming from" }, "rules": { "type": "object", "properties": { "cancel-at": { "type": "string", "format": "date-time", "description": "Latest time an order should be canceled at" }, "conditions": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The action in which the trigger is enacted. i.e.\n `cancel` and `route`", "enum": [ "cancel", "route" ] }, "instrument-type": { "type": "string", "description": "The instrument's type in relation to the condition. e.g. \\\n `Equity` or `Future`", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" }, "comparator": { "type": "string", "description": "How to compare against the threshold. \\\n Currently Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)", "enum": [ "gte", "lte" ] }, "indicator": { "type": "string", "description": "The indicator for the trigger, currently only supports `last`", "enum": [ "last", "nat" ] }, "threshold": { "type": "number", "format": "double", "description": "The price at which the condition triggers." }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "type": "string", "description": "The instrument's type in relation to the symbol.", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "quantity": { "type": "number", "format": "double", "description": "The Ratio quantity in relation to the symbol" }, "quantity-direction": { "type": "string", "description": "The quantity direction(ie Long or Short) in relation to the symbol", "enum": [ "Long", "Short" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" } }, "required": [ "instrument-type", "quantity", "quantity-direction", "symbol" ] } } }, "required": [ "action", "comparator", "indicator", "threshold" ] } }, "route-after": { "type": "string", "format": "date-time", "description": "Earliest time an order should route at" } } } }, "required": [ "order-type", "stop-trigger", "time-in-force", "price-effect", "value-effect" ], "description": "Edit price and execution properties of a live order by replacement. Subsequent fills of the original order\n will abort the replacement." }, "putAccountsAccountNumberOrdersId": { "type": "object", "properties": { "gtc-date": { "type": "string", "format": "date", "description": "The date in which a GTD order will expire. Can only be provided if time-in-force is GTD." }, "order-type": { "type": "string", "description": "The type of order in regards to the price. i.e.\n `Limit`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`", "enum": [ "Limit", "Market", "Marketable Limit", "Notional Market", "Stop", "Stop Limit" ] }, "stop-trigger": { "type": "number", "format": "double", "description": "The price trigger at which a stop or stop-limit order becomes valid." }, "time-in-force": { "type": "string", "description": "The length in time before the order expires. i.e.\n `Day`, `Ext`, `Ext Overnight`, `GTC`, `GTC Ext`, `GTC Ext Overnight`, `GTD` or `IOC`", "enum": [ "Day", "Ext", "Ext Overnight", "GTC", "GTC Ext", "GTC Ext Overnight", "GTD", "IOC" ] }, "price": { "type": "number", "format": "double", "description": "The price of the Order. Required for limit and stop-limit orders." }, "price-effect": { "type": "string", "description": "If pay or receive payment for placing the order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "value": { "type": "number", "format": "double", "description": "The notional value of the Order, required for notional market orders." }, "value-effect": { "type": "string", "description": "If pay or receive payment for placing the notional market order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "automated-source": { "type": "boolean", "description": "If the order was placed from an automated source", "default": false }, "external-identifier": { "type": "string", "description": "External identifier for the order" }, "partition-key": { "type": "string", "description": "Account partition key" }, "preflight-id": { "type": "string", "description": "Transient order identifier used for matching preflight errors to an individual order" }, "source": { "type": "string", "description": "The source the order is coming from" }, "rules": { "type": "object", "properties": { "cancel-at": { "type": "string", "format": "date-time", "description": "Latest time an order should be canceled at" }, "conditions": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "The action in which the trigger is enacted. i.e.\n `cancel` and `route`", "enum": [ "cancel", "route" ] }, "instrument-type": { "type": "string", "description": "The instrument's type in relation to the condition. e.g. \\\n `Equity` or `Future`", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" }, "comparator": { "type": "string", "description": "How to compare against the threshold. \\\n Currently Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)", "enum": [ "gte", "lte" ] }, "indicator": { "type": "string", "description": "The indicator for the trigger, currently only supports `last`", "enum": [ "last", "nat" ] }, "threshold": { "type": "number", "format": "double", "description": "The price at which the condition triggers." }, "price-components": { "type": "array", "items": { "type": "object", "properties": { "instrument-type": { "type": "string", "description": "The instrument's type in relation to the symbol.", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ] }, "quantity": { "type": "number", "format": "double", "description": "The Ratio quantity in relation to the symbol" }, "quantity-direction": { "type": "string", "description": "The quantity direction(ie Long or Short) in relation to the symbol", "enum": [ "Long", "Short" ] }, "symbol": { "type": "string", "description": "The symbol to apply the condition to. \\\n e.g. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`" } }, "required": [ "instrument-type", "quantity", "quantity-direction", "symbol" ] } } }, "required": [ "action", "comparator", "indicator", "threshold" ] } }, "route-after": { "type": "string", "format": "date-time", "description": "Earliest time an order should route at" } } } }, "required": [ "order-type", "stop-trigger", "time-in-force", "price-effect", "value-effect" ], "description": "Replaces a live order with a new one. Subsequent fills of the original order will abort the replacement." }, "postAccountsAccountNumberOrdersIdDryRun": { "type": "object", "properties": { "gtc-date": { "type": "string", "format": "date", "description": "The date in which a GTD order will expire. Can only be provided if time-in-force is GTD." }, "order-type": { "type": "string", "description": "The type of order in regards to the price. i.e.\n `Limit`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`", "enum": [ "Limit", "Market", "Marketable Limit", "Notional Market", "Stop", "Stop Limit" ] }, "stop-trigger": { "type": "number", "format": "double", "description": "The price trigger at which a stop or stop-limit order becomes valid." }, "time-in-force": { "type": "string", "description": "The length in time before the order expires. i.e.\n `Day`, `Ext`, `Ext Overnight`, `GTC`, `GTC Ext`, `GTC Ext Overnight`, `GTD` or `IOC`", "enum": [ "Day", "Ext", "Ext Overnight", "GTC", "GTC Ext", "GTC Ext Overnight", "GTD", "IOC" ] }, "price": { "type": "number", "format": "double", "description": "The price of the Order. Required for limit and stop-limit orders." }, "price-effect": { "type": "string", "description": "If pay or receive payment for placing the order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "value": { "type": "number", "format": "double", "description": "The notional value of the Order, required for notional market orders." }, "value-effect": { "type": "string", "description": "If pay or receive payment for placing the notional market order. i.e. `Credit` or `Debit`", "enum": [ "Credit", "Debit" ] }, "automated-source": { "type": "boolean", "description": "If the order was placed from an automated source", "default": false }, "external-identifier": { "type": "string", "description": "External identifier for the order" }, "partition-key": { "type": "string", "description": "Account partition key" }, "preflight-id": { "type": "string", "description": "Transient order identifier used for matching preflight errors to an individual order" }, "source": { "type": "string", "description": "The source the order is coming from" }, "legs": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "description": "TODO", "enum": [ "Allocate", "Buy", "Buy to Close", "Buy to Open", "Sell", "Sell to Close", "Sell to Open" ] }, "instrument-type": { "type": "string", "description": "The type of Instrument.", "enum": [ "Cryptocurrency", "Equity", "Equity Option", "Event Contract", "Fixed Income Security", "Future", "Future Option", "Liquidity Pool" ] }, "quantity": { "type": "number", "format": "double", "description": "TODO" }, "symbol": { "type": "string", "description": "Symbol for stock, specific option symbol in the\n OCC symbology or specific future symbol. e.g. \"AAPL\", \"AAPL 150515C00120000\", \"/ESM5\"" } }, "required": [ "action", "instrument-type", "symbol" ] } } }, "required": [ "order-type", "stop-trigger", "time-in-force", "price-effect", "value-effect" ], "description": "Runs through preflights for cancel-replace and edit without routing" } } }