Skip to main content
DELETE
/
v1
/
pm
/
orders
/
batch
Batch cancel orders
curl --request DELETE \
  --url https://relay.bayse.markets/v1/pm/orders/batch \
  --header 'Content-Type: application/json' \
  --data '
{
  "orderIds": [
    {}
  ]
}
'
{
  "engine": "CLOB",
  "results": [
    { "orderId": "f6a7b8c9-d0e1-2345-fabc-678901234567", "success": true },
    {
      "orderId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "success": false,
      "error": {
        "code": "ORDER_NOT_FOUND",
        "message": "Order not found"
      }
    }
  ],
  "summary": { "total": 2, "succeeded": 1, "failed": 1 }
}

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.

Cancel up to 100 CLOB orders in a single request. Order IDs may belong to different markets and events. CLOB-only: any AMM order is rejected per-item with UNSUPPORTED_ENGINE. Ownership is enforced upstream — order IDs the caller does not own return ORDER_NOT_FOUND. See the Batch orders concept page for limits, semantics, and rate-limit behavior.

Authentication

Write authentication required — X-Public-Key, X-Timestamp, and X-Signature headers. See the Authentication guide.

Headers

Idempotency-Key
string
Optional. 1–255 characters of [A-Za-z0-9_-]. Retries within 24 hours that share the same key, body, and route replay the original response with Idempotent-Replayed: true. A retry with the same key but a different body is rejected with 422. A concurrent retry (sent while the first is still in flight) is rejected with 409 — back off briefly and retry once the first call has finished. Transient responses (5xx, 429, 408) are not cached, so you can recover by retrying.

Request body

orderIds
array
required
1–100 order UUIDs to cancel. Each ID is processed independently — failures on one ID do not abort the rest of the batch.

Example request

PUBLIC_KEY="pk_live_abcdef123456"
SECRET_KEY="sk_live_secret789xyz"
TIMESTAMP=$(date +%s)
METHOD="DELETE"
URL_PATH="/v1/pm/orders/batch"
BODY='{"orderIds":["f6a7b8c9-d0e1-2345-fabc-678901234567","a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}'

BODY_HASH=$(printf '%s' "$BODY" | openssl dgst -sha256 -hex 2>/dev/null | sed 's/.*= //')
PAYLOAD="${TIMESTAMP}.${METHOD}.${URL_PATH}.${BODY_HASH}"
SIGNATURE=$(printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET_KEY" -binary | base64)

curl -X DELETE "https://relay.bayse.markets${URL_PATH}" \
  -H "X-Public-Key: ${PUBLIC_KEY}" \
  -H "X-Timestamp: ${TIMESTAMP}" \
  -H "X-Signature: ${SIGNATURE}" \
  -H "Idempotency-Key: 9d3f2c0e-7b1a-4e5d-9f80-3a8b1c2d4e5f" \
  -H "Content-Type: application/json" \
  -d "$BODY"
This DELETE carries a JSON body, so the signing payload’s bodyHash is the SHA-256 hash of the body — not the empty hash used for body-less DELETEs like Cancel order.

Response

engine
string
Always CLOB for batch endpoints today.
results
array
Per-order outcomes, in the same order as the request.
summary
object
{
  "engine": "CLOB",
  "results": [
    { "orderId": "f6a7b8c9-d0e1-2345-fabc-678901234567", "success": true },
    {
      "orderId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "success": false,
      "error": {
        "code": "ORDER_NOT_FOUND",
        "message": "Order not found"
      }
    }
  ],
  "summary": { "total": 2, "succeeded": 1, "failed": 1 }
}
Only CLOB orders with status open or partial_filled can be cancelled. AMM orders execute instantly and cannot be cancelled — sell your shares to exit instead. Batch cancel charges one rate-limit token per ID.