tastytradeDeveloper Docs
Legacy ↗

API Reference / Balances and Positions

List Account Positions

getAccountsAccountNumberPositions
get/accounts/{account_number}/positions

Base URL: https://api.cert.tastyworks.com (Sandbox) · https://api.tastyworks.com (Production)

Returns the account's positions. A position with a quantity of 0 is considered closed and is purged overnight, so by default only open positions are returned; pass include-closed-positions to include them. Filter by symbol, underlying-symbol, instrument-type, or underlying-product-code, and use net-positions to group by instrument type and symbol. The endpoint does not return live profit/loss or a mark unless include-marks is set; for up-to-date P/L, combine the cost-basis fields here with live quote data from streaming market data.

Code samples

curl -X GET 'https://api.cert.tastyworks.com/accounts/5WX01234/positions?underlying-symbol[]=AAPL&symbol=AAPL&instrument-type=Bond&include-closed-positions=true&underlying-product-code=ES&partition-keys=%7Bpartition-keys%7D&net-positions=true&include-marks=true' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'User-Agent: tastytrade-docs-example/1.0'

Parameters

NameInTypeDescription
underlying-symbolqueryarrayAn array of Underlying symbol(s) for positions (example: underlying-symbol[]={value1}&underlying-symbol[]={value2})
e.g. ["AAPL"]
symbolquerystringA single symbol. Stock Ticker Symbol `AAPL`, \ OCC Option Symbol `AAPL 191004P00275000`, \ TW Future Symbol `/ESZ9`, or \ TW Future Option Symbol `./ESZ9 EW4U9 190927P2975`
e.g. "AAPL"
instrument-typequerystringThe type of Instrument
enum: Bond, Cryptocurrency, Currency Pair, Equity, Equity Offering, Equity Option, Future, Future Option, Index, Unknown, Warrant
e.g. "Bond"
include-closed-positionsquerybooleanIf closed positions should be included in the query
e.g. true
underlying-product-codequerystringThe underlying Future's Product code. i.e `ES`
e.g. "ES"
partition-keysqueryarrayAccount partition keys (example: partition-keys[]={value1}&partition-keys[]={value2})
net-positionsquerybooleanReturns net positions grouped by instrument type and symbol
e.g. true
include-marksquerybooleanInclude current quote mark (note: can decrease performance)
e.g. true
account_number*pathstring
e.g. "5WX01234"

Responses

200A list of the account's positions, wrapped in a data.items array.application/json

Example response

{
  "data": {
    "items": [
      {
        "account-number": "5WX01234",
        "symbol": "AAPL",
        "instrument-type": "Equity",
        "underlying-symbol": "AAPL",
        "quantity": "100",
        "quantity-direction": "Long",
        "close-price": "282.48",
        "average-open-price": "288.7",
        "average-yearly-market-close-price": "123.18",
        "average-daily-market-close-price": "282.48",
        "mark": "285.10",
        "mark-price": "285.10",
        "multiplier": 1,
        "cost-effect": "Credit",
        "is-suppressed": false,
        "is-frozen": false,
        "restricted-quantity": "0.0",
        "expires-at": "2024-12-20T21:15:00.000+00:00",
        "fixing-price": "0.0",
        "deliverable-type": "Equity",
        "realized-day-gain": "0.0",
        "realized-day-gain-effect": "None",
        "realized-day-gain-date": "2026-06-08",
        "realized-today": "0.0",
        "realized-today-effect": "None",
        "realized-today-date": "2026-06-08",
        "created-at": "2022-08-22T17:56:51.872+00:00",
        "updated-at": "2026-06-08T21:49:54.095+00:00",
        "order-id": 123456
      }
    ]
  },
  "context": "/accounts/{account_number}/positions",
  "pagination": {
    "per-page": 0,
    "page-offset": 0,
    "item-offset": 0,
    "total-items": 0,
    "total-pages": 0,
    "current-item-count": 0
  }
}

Schema

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

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

  • paginationobject

    Paging metadata, present on paginated list responses.

    • per-pageinteger
    • page-offsetinteger
    • item-offsetinteger
    • total-itemsinteger
    • total-pagesinteger
    • current-item-countinteger
401Missing or invalid access token, or a missing/malformed User-Agent header. Access tokens last 15 minutes; send Authorization: Bearer <token> and a User-Agent like my-app/1.0 on every request.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.

403Authenticated, but the token's scope or the account's authority level does not permit reading positions for this account.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.

404Account not found. Verify the account_number and confirm you are hitting the correct environment (sandbox api.cert.tastyworks.com vs production api.tastyworks.com).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 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.