Skip to main content

Batch Orders

POST /v1/orders/batch
Place up to N orders in a single request. Each order is processed independently — partial failures are reported per-order.

Batch Size Limits

TierMax Batch Size
free5
pro20
enterprise50

Request

curl -X POST https://api.polysimulator.com/v1/orders/batch \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "orders": [
      {
        "market_id": "0xabc...",
        "side": "BUY",
        "outcome": "Yes",
        "quantity": "5",
        "order_type": "market"
      },
      {
        "market_id": "0xdef...",
        "side": "BUY",
        "outcome": "No",
        "quantity": "3",
        "order_type": "market"
      },
      {
        "market_id": "0xghi...",
        "side": "BUY",
        "outcome": "Yes",
        "quantity": "10",
        "order_type": "limit",
        "price": "0.45",
        "time_in_force": "GTC"
      }
    ]
  }'
Each order in the array follows the same schema as POST /v1/orders.

Response

{
  "results": [
    {
      "order_id": 42,
      "status": "FILLED",
      "price": "0.65",
      "quantity": "5",
      "notional": "3.25"
    },
    {
      "order_id": 43,
      "status": "FILLED",
      "price": "0.40",
      "quantity": "3",
      "notional": "1.20"
    },
    {
      "error": "INSUFFICIENT_BALANCE",
      "message": "Insufficient balance for order"
    }
  ],
  "succeeded": 2,
  "failed": 1
}
Partial failures don’t roll back successful orders. Each order is independent — some may succeed while others fail. Always check the succeeded and failed counts.

Error Response Format

Per-order failures are returned inline in results with status="REJECTED" or status="ERROR". The shape currently matches OrderResponse and includes an error string. Each failed entry in results has this shape:
{
  "order_id": 0,
  "status": "REJECTED",
  "order_type": "market",
  "side": "BUY",
  "outcome": "Yes",
  "price": "0",
  "quantity": "1",
  "notional": "0",
  "fee": "0",
  "client_order_id": "bot-123",
  "error": "{'error': 'INSUFFICIENT_BALANCE', 'message': 'Insufficient balance for BUY order'}"
}
error is a stringified payload from the underlying exception detail. Parse or log it as text unless your client applies custom normalization.
A batch request itself returns HTTP 200 even when individual orders fail. Always iterate results to check per-order status. Only use HTTP status codes for request-level failures (auth, rate limit, malformed JSON).

Use Cases

Portfolio Rebalancing

Buy underweight positions and sell overweight positions in a single request.

Grid Trading

Place a ladder of limit orders at multiple price levels simultaneously.

Market Scanning

Buy small positions across multiple undervalued markets at once.

Rate Limit Optimization

1 batch request counts as 1 API call vs N individual calls.

Next Steps