Sandbox
The sandbox is a full copy of the tastytrade API backed by simulated money. Use it to build and test order flow before pointing anything at a real account.
Orders placed in the sandbox never reach a real market. They stay inside the sandbox system.
Base URLs
| Production | Sandbox | |
|---|---|---|
| REST API | https://api.tastyworks.com | https://api.cert.tastyworks.com |
| Account streamer | wss://streamer.tastyworks.com | wss://streamer.cert.tastyworks.com |
Everything else about a request is identical: same paths, same payloads, same
Authorization and User-Agent header rules. See
Auth patterns.
How fills are decided
This is the part that surprises people. The sandbox does not simulate a real order book. Fill behaviour is derived from the order type and price, and nothing else:
| Order | Result |
|---|---|
| Market order | Always fills, at a price of $1 |
| Limit order priced under $3 | Fills immediately |
| Limit order priced $3 or above | Goes Live and never fills |
So a limit order that sits at Live forever is not a bug, and a market fill at
$1 is not a pricing error. If you are testing the transition from Live to
Filled, price the order under $3.
Because fills are synthetic, sandbox positions, balances and transaction history are only useful for exercising the shape of your code. They are not a simulation of trading outcomes.
Credentials are separate
Sandbox credentials are a different OAuth application from production, and the two are not interchangeable. A sandbox refresh token cannot mint an access token against production, and a production one cannot against the sandbox.
The failure is uninformative when you get this wrong: every call returns
invalid_credentials with nothing indicating the environment is the problem. If
you are getting auth errors that make no sense, check which base URL your token
was issued for first.
What the sandbox cannot do
- Market data is not served.
/market-dataand/market-metricsreturn HTTP 502 on every route, so quotes, quote snapshots, market metrics, historical dividends and earnings reports all fail. Everything else works: instruments, option chains, futures, accounts, balances, positions, transactions, orders, and the dry-run and submission paths. - Net liquidating value history is production-only.
- The environment resets every 24 hours, clearing trades, transactions and positions while leaving users and accounts intact. Do not build a test that depends on state surviving overnight.
Because quotes do not work in the sandbox, a common pattern is to read market data from production and submit orders to the sandbox, using two sets of credentials.
Getting a sandbox account
Use the sandbox account tool to create a sandbox user and
sign in, in your browser. It talks to api.cert.tastyworks.com directly and
cannot reach production.
It also creates the customer record and funded account most endpoints need, manages OAuth applications and grants, and carries live account-streamer and market-data demos.
Related
- OAuth2 — creating an application, grants and access tokens.
- Quickstart — first call, end to end.
- Place an equity order — the order path to exercise here.
- Order lifecycle — what the statuses mean.