Skip to main content
In this workflow, you discover a market, inspect its order book, place a limit order, check its status, and cancel any unfilled quantity.
1

Verify your account and create an API key

Open API keys and create a key with these scopes:
  • ORDER_READ
  • ORDER_CREATE
  • ORDER_CANCEL
Copy the complete key when it appears. PaperDrill shows it only once.
2

Store the key

Set the key in your shell so you do not paste it into source code:
See Authentication for permission and storage guidance.
3

Read the market rules

Never hardcode a symbol’s precision. Fetch the market before constructing an order.
For this market, price and qty accept up to two decimal places. Send both values as strings.
4

Inspect the order book

Choose a buy price below the best ask if you want the order to rest instead of executing immediately. The example below uses a deliberately low price; choose an appropriate value for the current book.
5

Place a limit order

Save the returned id. A limit order can be OPEN, PARTIALLY_FILLED, or FILLED immediately, so always use the returned status.
6

Check the order

Replace ORDER_ID with the returned ID:
You can also request every open order with GET /orders/open.
7

Cancel any remaining quantity

Only cancel an order whose status is OPEN or PARTIALLY_FILLED:
Continue to Place and manage orders for order behavior or Build a simple bot for a complete TypeScript workflow.