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

# Quick start

> Go from an API key to a placed duty-credit-scrip order in five curl calls: read the market, take a firm quote, place an idempotent order, then track it to settlement.

This guide walks one market trade end to end: market, quote, order, track. Every call is curl against production; swap in a `scripx_test_…` key to run the same thing in the [sandbox](/environments). The same five calls work whichever side you trade. For the role-specific flows, see [Sell scrips](/guides/exporter-sell), [Buy scrips](/guides/importer-buy), [Run a desk](/guides/broker-desk), [Net a group](/guides/enterprise-group) and [Embed ScripX](/guides/platform-embed).

## Before you begin

1. An API key from ScripX (see [Authentication](/authentication)). Export it: `export SCRIPX_KEY=scripx_live_…`
2. The base URL: `export BASE_URL=https://api.scripxhq.com`
3. Amounts ready in **paise**, prices read in **bps of face**. See [Money and price](/annexure/money-and-price).

<Note>
  Sandbox keys are unmetered and clearly marked. A test run is never mistaken for a live trade.
</Note>

Trading on behalf of a client firm? [Register](/api-reference/firms/create) and [verify](/api-reference/firms/verify) the firm first; its trades unlock when its connection state is `connected`.

## Steps to your first trade

<Steps>
  <Step title="Read the market">
    ```bash theme={"dark"}
    curl "$BASE_URL/v1/market/RODTEP" \
      -H "X-ScripX-Key: $SCRIPX_KEY"
    ```

    A snapshot of the scheme: reference price and current depth. For a living view, use the [SSE stream](/api-reference/trading/market-stream).
  </Step>

  <Step title="Take a firm quote">
    ```bash theme={"dark"}
    curl -X POST "$BASE_URL/v1/quote" \
      -H "X-ScripX-Key: $SCRIPX_KEY" \
      -H "Content-Type: application/json" \
      -d '{"side": "sell", "scheme": "RODTEP", "face_paise": 100000000}'
    ```

    The response carries `price_bps` and `all_in_paise`, the one number your client gets: everything included, nothing bolted on after.
  </Step>

  <Step title="Place the order">
    ```bash theme={"dark"}
    curl -X POST "$BASE_URL/v1/orders" \
      -H "X-ScripX-Key: $SCRIPX_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: 7f3d2c9a-order-1" \
      -d '{"side": "sell", "scheme": "RODTEP", "amount_paise": 100000000, "min_pct_bps": 9600}'
    ```

    `Idempotency-Key` makes the retry safe: re-sending the same key returns the original order instead of creating a second one. `min_pct_bps` is your price floor in bps of face.
  </Step>

  <Step title="Track it">
    ```bash theme={"dark"}
    curl "$BASE_URL/v1/orders/ord_01H…" \
      -H "X-ScripX-Key: $SCRIPX_KEY"
    ```

    Or list everything at once, wallet included, with [`GET /v1/positions`](/api-reference/trading/positions).
  </Step>

  <Step title="Stop polling, get pushed">
    ```bash theme={"dark"}
    curl -X POST "$BASE_URL/v1/webhooks" \
      -H "X-ScripX-Key: $SCRIPX_KEY" \
      -H "Content-Type: application/json" \
      -d '{"url": "https://example.com/hooks/scripx", "event": "*"}'
    ```

    Keep the returned `signing_secret`, it is shown exactly once. Verify every delivery per the [Webhooks guide](/webhooks).
  </Step>
</Steps>

## Go-live checklist

Before swapping the `scripx_test_` key for `scripx_live_`:

1. **Idempotency keys** on every `POST /v1/orders`, one per logical order, retried fearlessly.
2. **Webhook signatures verified** on the raw body, deliveries deduped on `X-ScripX-Delivery`, receiver returns 2xx fast.
3. **`Retry-After` honoured** on 429; no fixed-interval hammering.
4. **Tolerant reader**: unknown JSON fields and events ignored, enums treated as open sets.
5. **Keys server-side only**, one child key per service, revocation path rehearsed.
6. **Money maths in integer paise end to end**; no floats anywhere in the pipeline.
7. **Firm states handled**: your UI routes `verification_pending` and `reconnect_needed` firms back to their connect link.

## Need help?

<Card title="Write to support" icon="envelope" href="mailto:amin@eximfiles.io">
  Include your key prefix (never the full key) and the response body of the failing call.
</Card>
