Skip to content

Quickstart

Five steps from nothing to a working order, with curl in a terminal. The examples use two shell variables:

Terminal window
export API="https://app.proofperps.com/v1/api"
export PP_KEY="ppk_..." # your key: keep it out of files you share
  1. Sign in to your trader space and open your Profile: the API keys panel is under Sessions and security.
  2. Name the key. Tick Allow trading for steps 4 and 5 (without it, the key reads only), and confirm.
  3. The key is shown once: copy it into PP_KEY right away. Only its hash is kept on our side, so it can never be shown again; if you lose it, revoke it and make a new one.

You can hold up to 5 active keys. Revoking one stops it at once. See Authentication.

Terminal window
curl "$API/accounts" -H "Authorization: Bearer $PP_KEY"

The answer lists every account of the key’s owner, with its account_id, program, size, stage, status, balance and equity. Keep the account_id you want to trade:

Terminal window
export ACCOUNT="ev-..." # an account_id from the list

Before trading, read the room left on it today:

Terminal window
curl "$API/accounts/$ACCOUNT/risk" -H "Authorization: Bearer $PP_KEY"

daily_loss_headroom is the room left to your Daily Loss Limit today and max_loss_headroom the room to your Max Drawdown, both in micro-USD (1,000,000 is 1 USD). A null means that rule does not apply to the account.

Terminal window
curl "$API/markets" -H "Authorization: Bearer $PP_KEY"

Each market has its symbol (the one every order names), its unit_e8 and whether it is frozen (a frozen market takes no new order). Then its last quote:

Terminal window
curl "$API/markets/BTC/quote" -H "Authorization: Bearer $PP_KEY"

The quote’s bid_e8, ask_e8 and mid_e8 are prices per coin (or share, or contract) times 100,000,000.

Every write carries an Idempotency-Key header: one new value per order (a UUID is fine). It also becomes the order’s client_order_id. If the answer is lost, send the same request with the same key: you get the first answer back instead of a second order. See Idempotency.

Terminal window
curl -X POST "$API/accounts/$ACCOUNT/orders" \
-H "Authorization: Bearer $PP_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"symbol": "BTC", "side": "buy", "qty": 100}'

qty is in market units: 100 units of BTC is 0.01 BTC. The answer, 201, holds the order (its order_id, status, filled_qty…), the decisions and replayed (true only when it is the stored answer of an earlier request with the same key). An order your account’s rules or the market refuse is a 422 whose code says why: nothing was done.

A limit order with its stop loss and take profit, armed on the position it opens:

Terminal window
curl -X POST "$API/accounts/$ACCOUNT/orders" \
-H "Authorization: Bearer $PP_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"symbol": "BTC", "side": "buy", "qty": 100, "order_type": "limit",
"limit_price": 7900000, "stop_loss": 7800000, "take_profit": 8200000}'

The same fields serve the other types: stop (with trigger_price) and stop_limit (with both). Add "stop_loss_trail" with a stop_loss for a stop loss that follows the price, or "take_profits" for up to three targets. Prices here are examples.

Change a working order (its rev comes from GET /accounts/{id}/orders):

Terminal window
curl -X PATCH "$API/accounts/$ACCOUNT/orders/$ORDER_ID" \
-H "Authorization: Bearer $PP_KEY" -H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" -d '{"expected_rev": 0, "limit_price": 7950000}'

Cancel it:

Terminal window
curl -X DELETE "$API/accounts/$ACCOUNT/orders/$ORDER_ID" \
-H "Authorization: Bearer $PP_KEY" -H "Idempotency-Key: $(uuidgen)"

Next: Trading with the API for positions, brackets and leverage, and the account stream to follow your orders live.