Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dojifunded.com/llms.txt

Use this file to discover all available pages before exploring further.

Order endpoints require the TRADE or MANAGE_ORDERS permission scope depending on the operation. See Authentication for scope details.
BASE = https://engine.dojifunded.com/v1

Place an order

POST /v1/order
Required permission: TRADE Single endpoint for all order types — market, limit, stop, take-profit — across all venues.
curl -X POST "$BASE/order" \
  -H "X-API-Key: $KEY" \
  -H "X-API-Secret: $SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id":  "5e1c7a40-0000-…",
    "symbol":      "BTC-USD",
    "side":        "BUY",
    "kind":        "LIMIT",
    "quantity":    0.05,
    "price":       62500,
    "tif":         "GTC",
    "flags":       { "post_only": true, "reduce_only": false },
    "client_id":   "my-bot:strategy-A:1234",
    "platform_id": "GMX"
  }'

Request fields

account_id
string
required
UUID of the account to trade on. Must be owned by the authenticated user.
symbol
string
required
Tradable symbol, e.g. BTC-USD, ETH-USD, AAPL-USD. See GET /v1/tickers for the full catalog. Symbol variants like BTCUSD, BTC/USD, and btc-usd are also accepted.
side
string
required
BUY or SELL.
kind
string
required
Order type: MARKET | LIMIT | STOP | TAKE_PROFIT.
quantity
number
required
Base-asset quantity. Must be positive.
price
number
Limit price. Required when kind is LIMIT.
trigger_price
number
Trigger reference price. Required when kind is STOP or TAKE_PROFIT.
tif
string
Time-in-force. One of:
ValueMeaning
GTCGood till cancelled
GTDGood till date
GTXPost-only intent (same as GTC + post_only)
IOCImmediate or cancel
FOKFill or kill
flags.post_only
boolean
Reject the order if it would be immediately matched as a taker.
flags.reduce_only
boolean
Only reduce an existing position — never open or increase one.
flags.trigger_on_index
boolean
For stop/TP orders: trigger against the index price.
flags.trigger_on_mark
boolean
For stop/TP orders: trigger against the mark price.
client_id
string
Your own deduplication ID. Retrying with the same client_id is safe — the engine returns the original result rather than placing a duplicate. Surfaces in fills and audit logs.
platform_id
string
Execution venue override: GMX | OSTIUM. Overrides the account default for this order only.
parent_order_id
string
UUID of a parent order. Links a TP or SL to its entry.
position_id
string
UUID of a specific open position to target when reducing.

Response

{
  "order": {
    "id":     "…",
    "status": "OPEN",
    "…": "…"
  },
  "trades":     [],
  "violations": []
}
order
object
The created order with its current status.
trades
array
Fills generated immediately by the order (market orders, IOC/FOK).
violations
array
Non-empty when the order was rejected by a risk rule. Each entry includes rule, severity, and a human-readable message. The order is not placed when violations are present.
Risk-rule rejections come back with HTTP 200 but a non-empty violations array — check this field in every response.

List open orders

GET /v1/account/:account_id/orders
Required permission: READ_ONLY Returns all working orders for the account.
curl "$BASE/account/$ACC/orders" \
  -H "X-API-Key: $KEY" \
  -H "X-API-Secret: $SECRET"

Cancel an order

POST /v1/account/:account_id/orders/:order_id/cancel
Required permission: MANAGE_ORDERS Cancels a working order. Returns the final order state.
curl -X POST "$BASE/account/$ACC/orders/$ORDER_ID/cancel" \
  -H "X-API-Key: $KEY" \
  -H "X-API-Secret: $SECRET"

Close a position

POST /v1/account/:account_id/close-position
Required permission: TRADE Convenience endpoint that sends a reduce-only order against an open position.
curl -X POST "$BASE/account/$ACC/close-position" \
  -H "X-API-Key: $KEY" \
  -H "X-API-Secret: $SECRET" \
  -H "Content-Type: application/json" \
  -d '{ "symbol": "BTC-USD", "kind": "MARKET" }'
symbol
string
required
Symbol of the position to close.
quantity
number
Partial close quantity. Omit to close the full position.
kind
string
Order type for the closing order. Defaults to MARKET.
price
number
Limit price (required if kind is LIMIT).
tif
string
Time-in-force for the closing order.
client_id
string
Deduplication ID. Safe to retry.

Idempotency

Always set a stable client_id per trading intent. If a request times out or returns a 5xx error, retry with the same client_id — the engine returns the original result without placing a duplicate order. See Errors for retry guidance.