Batch endpoints let you submit many orders, amendments, or cancellations against the API in a single HTTP request. They are designed for market makers re-quoting on multiple books, latency-sensitive strategies that need to fan out activity in lockstep, and scripts that rebalance positions across many markets at once.Documentation Index
Fetch the complete documentation index at: https://docs.bayse.markets/llms.txt
Use this file to discover all available pages before exploring further.
Batch order endpoints are CLOB-only. AMM markets are rejected per-order with
UNSUPPORTED_ENGINE since AMM orders execute instantly and cannot be batched against an order book.Endpoints
| Operation | Endpoint | Max items per call |
|---|---|---|
| Place a batch | POST /v1/pm/orders/batch | 20 orders |
| Cancel a batch | DELETE /v1/pm/orders/batch | 100 orders |
| Amend a batch | POST /v1/pm/orders/batch/amend | 20 orders |
X-Public-Key, X-Timestamp, X-Signature). See Authentication.
Cross-market batches
Batches can span multiple markets and events in a single call.- Place — each item carries only
outcomeId. The server resolves the parent market and event from the outcome, so a batch can mix orders across different events. - Cancel — each item is a bare
orderId(UUID). The server looks up the owning market and enforces ownership before cancelling. - Amend — each item is
(orderId, newPrice, newSize). The server resolves the market from the order and enforces ownership before applying the change.
Per-order best-effort semantics
A batch is not all-or-nothing. Each item is evaluated independently, so one bad input does not roll back the rest of the batch.- A bad
outcomeId, an AMM market, an insufficient balance, or a missing required field on one item fails just that item. - The other items continue to execute and return their normal success or failure outcomes.
- The HTTP response is
200 OKwhenever the batch was processed, even if some items failed. Inspect thesummaryand per-itemsuccessflags to know what landed.
Rate limiting
Batch calls are charged per item against your API key’s write rate-limit bucket — a 20-order place batch costs 20 write tokens, not 1.- The check runs after the batch body is bound, so an over-budget batch returns
429 Too Many Requestswith aRetry-Afterheader before any orders are placed upstream. - Sizing batches close to the cap will exhaust your write budget more quickly. If you submit at the cap continuously, you will be limited by your tier’s write throughput just as if you’d placed the orders one by one.
Idempotency
Both endpoints accept an optionalIdempotency-Key header. When set, a retry of the same (API key, key, method, path) within 24 hours replays the original response and sets Idempotent-Replayed: true on the response — useful for safe retries after a network blip or a 5xx.
- The key must be 1–255 characters of
[A-Za-z0-9_-](UUIDs and ULIDs are good defaults). - A retry with the same key but a different request body is rejected with
422 Unprocessable Entity. Generate a fresh key for a different payload. - A concurrent retry — sent before the first request has finished — is rejected with
409 Conflict. Back off briefly and retry; once the first call completes you’ll either get the cached response (success or stable client error) or be allowed to re-execute (transient errors are not cached). - Transient errors are not cached:
5xx,429, and408are excluded so you can recover by retrying after the underlying condition clears. Stable2xxand4xxresponses are cached for the full 24-hour window.
Cancel-and-replace cycles
When re-quoting, the canonical pattern is three sibling batches in sequence:DELETE /v1/pm/orders/batch— cancel stale orders. Frees their locked USD (BIDs) and shares (ASKs) back to the wallet and balance sheet.POST /v1/pm/orders/batch/amend— modify in-place orders whose price or size moved. Uses the capacity just freed in step 1 for any size-up / price-up debits.POST /v1/pm/orders/batch— place brand-new orders for bands without an existing order to amend. Uses whatever capacity remains.
Choosing between single and batch endpoints
Use the single place and single cancel endpoints for ad-hoc trading and any AMM activity. Reach for batch when:- You’re a market maker re-quoting both sides of one or more books.
- You need orders on multiple markets to land together (e.g. a hedged pair).
- You’re cancelling a working set after a strategy switch and want one round-trip instead of N.
- You need to shift multiple resting orders’ prices or sizes without giving up queue priority.