tastytradeDeveloper Docs
Legacy ↗

API Reference / Orders

Search Orders

getAccountsAccountNumberOrders
get/accounts/{account_number}/orders

Base 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'

Parameters

NameInTypeDescription
account_number*pathstring
e.g. "5WX01234"
page-offsetqueryinteger
e.g. 10
per-pagequeryinteger
e.g. 10
end-datequerystring
e.g. "2024-01-15"
futures-symbolquerystringUsed to fetch both futures and futures options orders
e.g. "ESM3"
start-datequerystring
e.g. "2024-01-15"
statusqueryarray (example: status[]={value1}&status[]={value2})
e.g. ["Live","Filled"]
underlying-instrument-typequerystringUnderlying instrument type
e.g. "Equity"
underlying-symbolquerystring
e.g. "AAPL"
sortquerystringThe order to sort results in. Accepts `Desc` or `Asc`. Defaults to `Desc`
enum: Desc, Asc
e.g. "Desc"
end-atquerystringDateTime end range for filtering orders in full date-time
e.g. "2024-01-15T14:30:00.000Z"
start-atquerystringDateTime start rage for filtering orders in full date-time
e.g. "2024-01-15T14:30:00.000Z"

Responses

200A paginated list of the account's orders matching the filters.application/json

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

  • datarequiredobject
    • itemsrequiredarray<object>{42 fields}
  • contextrequiredstring

    example: "/accounts/{account_number}/orders"

  • paginationobject

    Paging metadata, present on paginated list responses.

    • per-pageinteger
    • page-offsetinteger
    • item-offsetinteger
    • total-itemsinteger
    • total-pagesinteger
    • current-item-countinteger
401Missing or expired access token, or a missing/malformed `User-Agent` header.application/json

Example response

{
  "error": {
    "code": "unauthorized",
    "message": "No valid access token was provided; access tokens expire after 15 minutes."
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

403The token's scope or the account authority does not permit reading this account's orders.application/json

Example response

{
  "error": {
    "code": "not_permitted",
    "message": "User not permitted access"
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

404The account number does not exist or is not accessible with this token.application/json

Example response

{
  "error": {
    "code": "string",
    "message": "string",
    "errors": [
      {
        "code": "string",
        "message": "string",
        "domain": "string"
      }
    ]
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

429Request rate exceeded. Back off exponentially and reduce your request rate.application/json

Example response

{
  "error": {
    "code": "string",
    "message": "string",
    "errors": [
      {
        "code": "string",
        "message": "string",
        "domain": "string"
      }
    ]
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

Related

Agents: this page is also Markdown (with the embedded OpenAPI definition) — append .md or send Accept: text/markdown. Index at /llms.txt.