Search Orders
getAccountsAccountNumberOrders/accounts/{account_number}/ordersBase URL: https://api.cert.tastyworks.com (Sandbox) · https://api.tastyworks.com (Production)
Returns a paginated list of the account's orders, filterable by date range, underlying symbol, instrument type, and status. Results default to descending chronological order; pass `sort=Asc` to reverse. Use `page-offset` and `per-page` to page through results.
Code samples
curl -X GET 'https://api.cert.tastyworks.com/accounts/5WX01234/orders?page-offset=10&per-page=10&end-date=2024-01-15&futures-symbol=ESM3&start-date=2024-01-15&status[]=Live&status[]=Filled&underlying-instrument-type=Equity&underlying-symbol=AAPL&sort=Desc&end-at=2024-01-15T14%3A30%3A00.000Z&start-at=2024-01-15T14%3A30%3A00.000Z' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'User-Agent: tastytrade-docs-example/1.0'import requests
url = "https://api.cert.tastyworks.com/accounts/5WX01234/orders?page-offset=10&per-page=10&end-date=2024-01-15&futures-symbol=ESM3&start-date=2024-01-15&status[]=Live&status[]=Filled&underlying-instrument-type=Equity&underlying-symbol=AAPL&sort=Desc&end-at=2024-01-15T14%3A30%3A00.000Z&start-at=2024-01-15T14%3A30%3A00.000Z"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"User-Agent": "tastytrade-docs-example/1.0",
}
resp = requests.get(url, headers=headers)
print(resp.status_code, resp.json())const resp = await fetch("https://api.cert.tastyworks.com/accounts/5WX01234/orders?page-offset=10&per-page=10&end-date=2024-01-15&futures-symbol=ESM3&start-date=2024-01-15&status[]=Live&status[]=Filled&underlying-instrument-type=Equity&underlying-symbol=AAPL&sort=Desc&end-at=2024-01-15T14%3A30%3A00.000Z&start-at=2024-01-15T14%3A30%3A00.000Z", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"User-Agent": "tastytrade-docs-example/1.0",
},
})
const data = await resp.json()
console.log(resp.status, data)package main
import (
"net/http"
"io"
"fmt"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.cert.tastyworks.com/accounts/5WX01234/orders?page-offset=10&per-page=10&end-date=2024-01-15&futures-symbol=ESM3&start-date=2024-01-15&status[]=Live&status[]=Filled&underlying-instrument-type=Equity&underlying-symbol=AAPL&sort=Desc&end-at=2024-01-15T14%3A30%3A00.000Z&start-at=2024-01-15T14%3A30%3A00.000Z", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("User-Agent", "tastytrade-docs-example/1.0")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(out))
}import java.net.URI;
import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.cert.tastyworks.com/accounts/5WX01234/orders?page-offset=10&per-page=10&end-date=2024-01-15&futures-symbol=ESM3&start-date=2024-01-15&status[]=Live&status[]=Filled&underlying-instrument-type=Equity&underlying-symbol=AAPL&sort=Desc&end-at=2024-01-15T14%3A30%3A00.000Z&start-at=2024-01-15T14%3A30%3A00.000Z"))
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("User-Agent", "tastytrade-docs-example/1.0")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> resp = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(resp.statusCode() + " " + resp.body());Parameters
| Name | In | Type | Description |
|---|---|---|---|
| account_number* | path | string | e.g. "5WX01234" |
| page-offset | query | integer | e.g. 10 |
| per-page | query | integer | e.g. 10 |
| end-date | query | string | e.g. "2024-01-15" |
| futures-symbol | query | string | Used to fetch both futures and futures options orders e.g. "ESM3" |
| start-date | query | string | e.g. "2024-01-15" |
| status | query | array | (example: status[]={value1}&status[]={value2}) e.g. ["Live","Filled"] |
| underlying-instrument-type | query | string | Underlying instrument type e.g. "Equity" |
| underlying-symbol | query | string | e.g. "AAPL" |
| sort | query | string | The order to sort results in. Accepts `Desc` or `Asc`. Defaults to `Desc` enum: Desc, Asc e.g. "Desc" |
| end-at | query | string | DateTime end range for filtering orders in full date-time e.g. "2024-01-15T14:30:00.000Z" |
| start-at | query | string | DateTime start rage for filtering orders in full date-time e.g. "2024-01-15T14:30:00.000Z" |
Responses
Example response
{
"data": {
"items": [
{
"id": "771043",
"account-number": "5WX01234",
"cancel-user-id": "abc123",
"cancel-username": "string",
"cancellable": true,
"cancelled-at": "2024-07-31T16:50:23.417+00:00",
"complex-order-id": "2000010530",
"complex-order-tag": "OTOCO::order",
"confirmation-status": "string",
"contingent-status": "Pending Order",
"editable": true,
"edited": false,
"external-identifier": "string",
"global-request-id": "abc123",
"gtc-date": "2024-01-15",
"in-flight-at": "2024-01-15T14:30:00.000Z",
"liquidity-pool-instrument-type": "Equity",
"live-at": "2024-01-15T14:30:00.000Z",
"max-value-per-liquidity-allocation-fill": "100.00",
"order-type": "Limit",
"preflight-id": "abc123",
"price": "150.25",
"price-effect": "Debit",
"received-at": "2024-10-01T18:26:52.513+00:00",
"reject-reason": "You cannot buy for a credit.",
"replaces-order-id": "771043",
"replacing-order-id": "771044",
"size": "1",
"source": "string",
"status": "Live",
"stop-trigger": "150.0",
"terminal-at": "2024-07-31T16:50:23.417+00:00",
"time-in-force": "Day",
"underlying-instrument-type": "Equity",
"underlying-symbol": "AAPL",
"updated-at": "2024-01-15T14:30:00.000Z",
"user-id": "abc123",
"username": "string",
"value": "10.0",
"value-effect": "Debit",
"legs": [
{
"action": "string",
"instrument-type": "Equity",
"quantity": "1",
"remaining-quantity": "1",
"symbol": "AAPL",
"fills": []
}
],
"order-rule": {
"cancel-at": "2024-01-15T14:30:00.000Z",
"cancelled-at": "2024-01-15T14:30:00.000Z",
"route-after": "2024-01-15T14:30:00.000Z",
"routed-at": "2024-01-15T14:30:00.000Z",
"order-conditions": [
{}
]
}
}
]
},
"context": "/accounts/{account_number}/orders",
"pagination": {
"per-page": 0,
"page-offset": 0,
"item-offset": 0,
"total-items": 0,
"total-pages": 0,
"current-item-count": 0
}
}Schema
datarequiredobjectitemsrequiredarray<object>{42 fields}
contextrequiredstringexample:
"/accounts/{account_number}/orders"paginationobjectPaging metadata, present on paginated list responses.
per-pageintegerpage-offsetintegeritem-offsetintegertotal-itemsintegertotal-pagesintegercurrent-item-countinteger
Example response
{
"error": {
"code": "unauthorized",
"message": "No valid access token was provided; access tokens expire after 15 minutes."
}
}Schema
errorrequiredobjectcoderequiredstringMachine-readable error code (see the Error reference).
messagerequiredstringHuman-readable explanation.
errorsarray<object>{3 fields}Present for multi-error / validation failures; one entry per problem.
Example response
{
"error": {
"code": "not_permitted",
"message": "User not permitted access"
}
}Schema
errorrequiredobjectcoderequiredstringMachine-readable error code (see the Error reference).
messagerequiredstringHuman-readable explanation.
errorsarray<object>{3 fields}Present for multi-error / validation failures; one entry per problem.
Example response
{
"error": {
"code": "string",
"message": "string",
"errors": [
{
"code": "string",
"message": "string",
"domain": "string"
}
]
}
}Schema
errorrequiredobjectcoderequiredstringMachine-readable error code (see the Error reference).
messagerequiredstringHuman-readable explanation.
errorsarray<object>{3 fields}Present for multi-error / validation failures; one entry per problem.
Example response
{
"error": {
"code": "string",
"message": "string",
"errors": [
{
"code": "string",
"message": "string",
"domain": "string"
}
]
}
}Schema
errorrequiredobjectcoderequiredstringMachine-readable error code (see the Error reference).
messagerequiredstringHuman-readable explanation.
errorsarray<object>{3 fields}Present for multi-error / validation failures; one entry per problem.
Related
- Rate-limit class:
read· idempotent — Rate limits & backoff - Error reference — codes, causes, and fixes
Agents: this page is also Markdown (with the embedded OpenAPI definition) — append .md or send Accept: text/markdown. Index at /llms.txt.