Socketrade

Guide · Orders

Place an order. Once.

An order is the one call where a blind retry can cost money. This is the sequence, the response to expect, and the rule for timeouts.

01Wait for ready

A new account starts as starting. Do not send an order until status says ready. On Deriv the first login can take up to a minute while it syncs.

curl https://api.socketrade.com/v2/acc_.../status \
  -H "X-API-Key: $SOCKETRADE_KEY"

{ "status": "ready", "account": { "tradeAllowed": true } }

02Check the symbol

Use the broker's exact spelling. A symbol that is not in Market Watch can take a moment to produce its first price. On a weekend, forex is closed; use a synthetic or wait for Monday.

03Send the order

A market order needs symbol, volume and operation: 0 buys, 1 sells. Stops take sl and tp. Start with 0.01 on a demo. Pending orders are not part of the current contract; this guide covers market orders.

curl -X POST https://api.socketrade.com/v2/acc_.../OrderSend \
  -H "X-API-Key: $SOCKETRADE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "symbol": "EURUSD", "operation": 0, "volume": 0.01 }'

{ "ticket": 4789544305, "symbol": "EURUSD", "volume": 0.01 }

04If the call times out

A timeout does not mean the order did not arrive. Read positions first. If the ticket is there, it filled. If it is not, the order did not reach the broker. Never resend before checking.

curl https://api.socketrade.com/v2/acc_.../positions \
  -H "X-API-Key: $SOCKETRADE_KEY"

When it fails

401Key missing or wrong.
402No free seat. Add a seat or remove an account.
404Account id wrong, or not yours.
No priceThe symbol is not selected yet, or the market is closed.
Trade disabledThe broker account is read-only, or Algo trading is off.
Insufficient fundsThe demo or live balance cannot cover the margin.

Related