{ "info": { "title": "Transactions", "version": "10.3.0" }, "swagger": "2.0", "produces": [ "application/json" ], "host": "api.tastyworks.com", "tags": [ { "name": "transactions", "description": "Operations about transactions" }, { "name": "accounts", "description": "Operations about accounts" } ], "paths": { "/accounts/{account_number}/transactions": { "get": { "description": "Returns a paginated list of the account's transactions (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": "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": 250, "minimum": 1, "maximum": 2000, "required": false }, { "in": "query", "name": "currency", "description": "Currency", "type": "string", "required": false }, { "in": "query", "name": "sort", "description": "The order to sort results in. Defaults to Desc, Accepts `Desc` or `Asc`.", "type": "string", "default": "Desc", "enum": [ "Desc", "Asc" ], "required": false }, { "in": "query", "name": "sub-type", "description": "Filter based on transaction_sub_type (example: sub-type[]={value1}&sub-type[]={value2})", "type": "array", "items": { "type": "string" }, "required": false }, { "in": "query", "name": "type", "description": "Filter based on transaction_type", "type": "string", "required": false }, { "in": "query", "name": "types", "description": "Allows filtering on multiple transaction_types (example: types[]={value1}&types[]={value2})", "type": "array", "items": { "type": "string" }, "required": false }, { "in": "query", "name": "action", "description": "The action of the transaction. i.e. `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`", "type": "string", "required": false }, { "in": "query", "name": "end-date", "description": "The end date of transactions to query. Defaults to now.", "type": "string", "format": "date", "default": {}, "required": false }, { "in": "query", "name": "futures-symbol", "description": "The full TW Future Symbol `/ESZ9` or \\\n `/NGZ19` if two year digit are appropriate", "type": "string", "required": false }, { "in": "query", "name": "instrument-type", "description": "The type of Instrument. i.e. `Bond`, `Cryptocurrency`, `Currency Pair`, `Equity`, `Equity Offering`, `Equity Option`, `Event Contract`, `Fixed Income Security`, `Future`, `Future Option`, `Index`, `Liquidity Pool`, `Unknown` or `Warrant`", "type": "string", "required": false }, { "in": "query", "name": "partition-key", "description": "Account partition key", "type": "string", "required": false }, { "in": "query", "name": "start-date", "description": "The start date of transactions to query.", "type": "string", "format": "date", "required": false }, { "in": "query", "name": "symbol", "description": "The Stock Ticker Symbol `AAPL`, OCC Option Symbol `AAPL 191004P00275000`, \\\n TW Future Symbol `/ESZ9`, or TW Future Option Symbol `./ESZ9 EW4U9 190927P2975`", "type": "string", "required": false }, { "in": "query", "name": "underlying-symbol", "description": "The Underlying Symbol. The Ticker Symbol `FB` or \\\n TW Future Symbol with out date component `/M6E` or\n the full TW Future Symbol `/ESU9`", "type": "string", "required": false }, { "in": "query", "name": "end-at", "description": "DateTime end range for filtering transactions in full date-time", "type": "string", "format": "date-time", "required": false }, { "in": "query", "name": "start-at", "description": "DateTime start range for filtering transactions in full date-time", "type": "string", "format": "date-time", "required": false } ], "responses": { "200": { "description": "Returns a paginated list of the account's transactions (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/Transaction" } } } }, "tags": [ "transactions" ], "operationId": "getAccountsAccountNumberTransactions" } }, "/accounts/{account_number}/transactions/total-fees": { "get": { "description": "Return the total fees for an account for a given day", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "string", "required": true }, { "in": "query", "name": "date", "description": "The date to get fees for, defaults to today", "type": "string", "format": "date", "default": {}, "required": false } ], "responses": { "200": { "description": "Return the total fees for an account for a given day" } }, "tags": [ "accounts" ], "operationId": "getAccountsAccountNumberTransactionsTotalFees" } }, "/accounts/{account_number}/transactions/{id}": { "get": { "description": "Retrieve a transaction by account number and ID", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "account_number", "type": "string", "required": true }, { "in": "path", "name": "id", "type": "integer", "format": "int32", "required": true } ], "responses": { "200": { "description": "Retrieve a transaction by account number and ID", "schema": { "$ref": "#/definitions/Transaction" } } }, "tags": [ "accounts" ], "operationId": "getAccountsAccountNumberTransactionsId" } } }, "definitions": { "Transaction": { "type": "object", "properties": { "id": { "description": "", "type": "integer", "format": "int32" }, "account-number": { "description": "", "type": "string" }, "action": { "description": "", "type": "string" }, "agency-price": { "description": "", "type": "number", "format": "double" }, "clearing-fees": { "description": "", "type": "number", "format": "double" }, "clearing-fees-effect": { "description": "", "type": "string" }, "commission": { "description": "", "type": "number", "format": "double" }, "commission-effect": { "description": "", "type": "string" }, "lots": { "description": "", "type": "object", "properties": { "id": { "description": "", "type": "string" }, "executed-at": { "description": "", "type": "string", "format": "date-time" }, "price": { "description": "", "type": "number", "format": "double" }, "quantity": { "description": "", "type": "number", "format": "double" }, "quantity-direction": { "description": "", "type": "string" }, "transaction-date": { "description": "", "type": "string", "format": "date" }, "transaction-id": { "description": "", "type": "integer", "format": "int32" } } }, "cost-basis-reconciliation-date": { "description": "", "type": "string", "format": "date" }, "created-at": { "description": "", "type": "string", "format": "date-time" }, "currency": { "description": "", "type": "string" }, "currency-conversion-fees": { "description": "", "type": "number", "format": "double" }, "currency-conversion-fees-effect": { "description": "", "type": "string" }, "description": { "description": "", "type": "string" }, "destination-venue": { "description": "", "type": "string" }, "exchange": { "description": "", "type": "string" }, "exchange-affiliation-identifier": { "description": "", "type": "string" }, "exec-id": { "description": "", "type": "string" }, "executed-at": { "description": "", "type": "string", "format": "date-time" }, "ext-exchange-order-number": { "description": "", "type": "string" }, "ext-exec-id": { "description": "", "type": "string" }, "ext-global-order-number": { "description": "", "type": "integer", "format": "int32" }, "ext-group-fill-id": { "description": "", "type": "string" }, "ext-group-id": { "description": "", "type": "string" }, "instrument-type": { "description": "", "type": "string" }, "is-estimated-fee": { "description": "", "type": "boolean" }, "leg-count": { "description": "", "type": "integer", "format": "int32" }, "net-value": { "description": "", "type": "number", "format": "double" }, "net-value-effect": { "description": "", "type": "string" }, "order-id": { "description": "", "type": "integer", "format": "int32" }, "other-charge": { "description": "", "type": "number", "format": "double" }, "other-charge-description": { "description": "", "type": "string" }, "other-charge-effect": { "description": "", "type": "string" }, "price": { "description": "", "type": "number", "format": "double" }, "principal-price": { "description": "", "type": "number", "format": "double" }, "proprietary-index-option-fees": { "description": "", "type": "number", "format": "double" }, "proprietary-index-option-fees-effect": { "description": "", "type": "string" }, "quantity": { "description": "", "type": "number", "format": "double" }, "regulatory-fees": { "description": "", "type": "number", "format": "double" }, "regulatory-fees-effect": { "description": "", "type": "string" }, "reverses-id": { "description": "", "type": "integer", "format": "int32" }, "symbol": { "description": "", "type": "string" }, "transaction-date": { "description": "", "type": "string", "format": "date" }, "transaction-sub-type": { "description": "", "type": "string" }, "transaction-type": { "description": "", "type": "string" }, "underlying-symbol": { "description": "", "type": "string" }, "value": { "description": "", "type": "number", "format": "double" }, "value-effect": { "description": "", "type": "string" } }, "description": "Transaction model" } } }