Skip to content

Place and track an order

Goal: buy 10 units of an ETF in a portfolio and know when it filled. Scopes: read and trade. Also useful: a webhook endpoint subscribed to order.updated and order.expired.

Place and track an orderYour serverIDEALX APIMarket1GET /v1/investments?q=EXS2GET /v1/accounts/{id}/orders/fee3fee and estimate4POST /v1/accounts/{id}/orders + Idempotency-KeyCash set aside5200 order (placing)6Send order7Filled8Webhook order.updated (filled)9GET /v1/accounts/{id}/orders?status=done10GET /v1/orders/{id}/confirmation.pdf
Place and track an order
  1. Your server to IDEALX API: GET /v1/investments?q=EXS
  2. Your server to IDEALX API: GET /v1/accounts/{id}/orders/fee
  3. IDEALX API to Your server: fee and estimate
  4. Your server to IDEALX API: POST /v1/accounts/{id}/orders + Idempotency-Key
  5. IDEALX API: Cash set aside
  6. IDEALX API to Your server: 200 order (placing)
  7. IDEALX API to Market: Send order
  8. Market to IDEALX API: Filled
  9. IDEALX API to Your server: Webhook order.updated (filled)
  10. Your server to IDEALX API: GET /v1/accounts/{id}/orders?status=done
  11. Your server to IDEALX API: GET /v1/orders/{id}/confirmation.pdf
GET /v1/investmentsShares, ETFs, bonds and digital assets you can buy
Terminal window
curl "$IDEALX_API/v1/investments?q=EXS&country=AU&limit=5" -H "Authorization: Bearer $IDEALX_API_KEY"
{
"investments": [
{
"id": "XASX:EXS",
"symbol": "EXS",
"name": "Example Australian Shares ETF",
"assetClass": "etf",
"market": "XASX",
"currency": "AUD",
"description": "Tracks a broad index of Australian shares.",
"quantityDecimals": 0,
"priceDecimals": 4,
"securityType": "etf",
"logo": "/v1/logos/XASX:EXS",
"tradable": true,
"accent": "#2f6fd6",
"priceUsd": null,
"quote": {
"bid": "101.2500", "ask": "101.3100", "last": "101.2800", "previousClose": "100.9400",
"asOf": "2026-11-25T04:12:00.000Z", "freshness": "delayed"
},
"bond": null,
"term": null,
"shown": null,
"marketCap": null
}
],
"total": 1
}

Note quantityDecimals: 0: this listing trades in whole units.

GET /v1/accounts/{id}/orders/feeThe transaction fee an order would pay, before placing it
Terminal window
curl "$IDEALX_API/v1/accounts/acc_01937c4e8a2b7d1f9e0c3b5a6d7e8f90/orders/fee?instrumentId=XASX:EXS&side=buy&quantity=10&type=market" \
-H "Authorization: Bearer $IDEALX_API_KEY"
{
"estimate": { "amount": "1013.10", "currency": "AUD" },
"fee": { "amount": "5.00", "currency": "AUD" }
}

A market buy also sets aside 3% above the ask while it works (here about A$1,043.49 plus the fee); what is not used comes back when it fills. Make sure the portfolio has that much cash, or use a limit order.

POST /v1/accounts/{id}/ordersBuy or sell in a portfolio

Generate an Idempotency-Key when you decide to buy, store it with your own record of the order, and send the same key on every retry.

Terminal window
curl -X POST "$IDEALX_API/v1/accounts/acc_01937c4e8a2b7d1f9e0c3b5a6d7e8f90/orders" \
-H "Authorization: Bearer $IDEALX_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f1c0d7e-2b4a-4e8f-9a31-5c2d7e8f9a10" \
-d '{
"portfolioId": "ptf_01937c4e8a2b7d1f9e0c3b5a6d7e8fa1",
"instrumentId": "XASX:EXS",
"side": "buy",
"type": "market",
"quantity": "10"
}'
{
"id": "ord_01937e63c1d2e3f4a5b6c7d8e9f0a1b2",
"portfolioId": "ptf_01937c4e8a2b7d1f9e0c3b5a6d7e8fa1",
"instrumentId": "XASX:EXS",
"side": "buy",
"type": "market",
"quantity": "10",
"limitPrice": null,
"state": "placing",
"filledQuantity": "0",
"filledValue": { "amount": "0.00", "currency": "AUD" },
"setAside": "1048.49",
"approvalsRequired": 1,
"approvals": 1,
"approvedByMe": true,
"rejectReason": null,
"reason": null,
"createdAt": "2026-11-25T04:13:02.000Z"
}
If you get It means
409 conflict Not enough cash or units, or no price right now. Nothing was placed.
422 validation_failed A field is wrong, for example too many decimals in quantity (details.issues).
403 forbidden with details.scope: "trade" The key lacks the trade scope.
state: "pending_approval" The account needs more approvals; another person approves in the app or with POST /v1/orders/{id}/approve.
state: "waiting_market" The market is closed; the order is sent at the open.

With a webhook endpoint subscribed to order.updated, you receive each state change:

{
"id": "whd_01937e63e4f5a6b7c8d9e0f1a2b3c4d5",
"type": "order.updated",
"createdAt": "2026-11-25T04:13:09.000Z",
"data": { "accountId": "acc_01937c4e8a2b7d1f9e0c3b5a6d7e8f90", "orderId": "ord_01937e63c1d2e3f4a5b6c7d8e9f0a1b2", "state": "filled" }
}

Then read the order for its figures (there is no single-order read; filter the list):

GET /v1/accounts/{id}/ordersOrders on this account, newest first
Terminal window
curl "$IDEALX_API/v1/accounts/acc_01937c4e8a2b7d1f9e0c3b5a6d7e8f90/orders?status=done&q=EXS&limit=10" \
-H "Authorization: Bearer $IDEALX_API_KEY"
{
"orders": [
{
"id": "ord_01937e63c1d2e3f4a5b6c7d8e9f0a1b2",
"portfolioId": "ptf_01937c4e8a2b7d1f9e0c3b5a6d7e8fa1",
"instrumentId": "XASX:EXS",
"side": "buy",
"type": "market",
"quantity": "10",
"limitPrice": null,
"state": "filled",
"filledQuantity": "10",
"filledValue": { "amount": "1012.90", "currency": "AUD" },
"setAside": "0.00",
"approvalsRequired": 1,
"approvals": 1,
"approvedByMe": true,
"rejectReason": null,
"reason": null,
"createdAt": "2026-11-25T04:13:02.000Z"
}
],
"total": 1
}
GET /v1/orders/{id}/confirmation.pdfThe trade confirmation for an order that filled
Terminal window
curl -o confirmation.pdf "$IDEALX_API/v1/orders/ord_01937e63c1d2e3f4a5b6c7d8e9f0a1b2/confirmation.pdf" \
-H "Authorization: Bearer $IDEALX_API_KEY"

POST /v1/orders/{id}/cancelCancel an order that has not filled works until the order ends. An order still with IDEALX (waiting for approval, the market or funding) is cancelled at once; an order already at the market is cancelled there and the answer recorded, so read state in the response: cancelled, or still open / partially_filled if the market has not confirmed yet (an order.updated follows). Units already filled are kept. 409 means the order has already ended, or is being sent right now: try again in a moment. Whatever was set aside for the unfilled part comes back.

  1. One Idempotency-Key per order, stored before the first attempt and reused on retries.
  2. Quantities as strings, within the listing’s quantityDecimals.
  3. Handle pending_approval, waiting_market, waiting_funding and queued as “still working”.
  4. Treat filled, cancelled, rejected and expired as final; read rejectReason for rejections.
  5. Verify webhook signatures and ignore repeated delivery ids.