> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trdrs.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Place your first order

> From a firm key to a filled order with exits attached, in five steps.

Every order-placing request in this guide is idempotent: it carries a `clientOrderId` you choose,
and retrying with the same id can never create a second order. Keep that habit from your first call.

<Steps>
  <Step title="Check the risk state first">
    An account that is risk-locked answers `423` to every order. Read the state before you trade,
    and treat `423` as a state to display, not an error to retry.

    ```bash theme={null}
    curl "$TRDRS_API_BASE_URL/api/risk" \
      -H "Authorization: Bearer $TRDRS_TENANT_KEY"
    ```
  </Step>

  <Step title="Place a market order with exits attached">
    `stopLoss` and `takeProfit` ride along with the order. Atomic: the exits are placed with the
    order as one unit or not at all.

    ```bash theme={null}
    curl -X POST "$TRDRS_API_BASE_URL/api/trading/order" \
      -H "Authorization: Bearer $TRDRS_TENANT_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "instrument": "ESU6",
        "side": "buy",
        "qty": 1,
        "orderType": "market",
        "clientOrderId": "my-first-order-1",
        "stopLoss": { "price": 6450, "offsetTicks": 120 },
        "takeProfit": { "price": 6510, "offsetTicks": 120 }
      }'
    ```

    Each leg carries both forms the wire contract defines — the absolute `price` and the tick
    offset from the entry.

    A saved exit plan can stand in for the two legs: send `exitPlan` (the plan, the revision you
    previewed, and the token you were given) instead of `stopLoss`/`takeProfit` — sending both
    answers `400`.
  </Step>

  <Step title="Confirm what the account now holds">
    The snapshot returns the summary, positions, and working orders at a single consistent
    revision — read it rather than stitching the one-shot reads together.

    ```bash theme={null}
    curl "$TRDRS_API_BASE_URL/api/account/snapshot" \
      -H "Authorization: Bearer $TRDRS_TENANT_KEY"
    ```
  </Step>

  <Step title="Move or cancel the resting orders">
    [Replace an order](/api-reference/trading/replace-an-order) moves one resting order to a new
    price — one operation under one idempotency claim. [Cancel an
    order](/api-reference/trading/cancel-an-order) removes it by its broker order id.
  </Step>

  <Step title="Know the way out">
    [Flatten a position](/api-reference/trading/flatten-a-position) cancels the instrument's
    working orders, then closes its position at market. It is the guide rail for every demo and
    the last step of every test run.
  </Step>
</Steps>

## Where to go deeper

* [Idempotency](/partner-platform/overview/idempotency) — why retries are safe, and what a claim is.
* [Set position exits](/api-reference/trading/set-position-exits) — change a position's stop and target after entry.
* [Errors](/partner-platform/overview/errors) — what `423`, `429`, and the refusal shapes mean.
