GeminiGemini
Demo environmentGet API key
  • Overview
  • Crypto Trading
  • Prediction Markets
  • Perpetuals
  • Stocks
  • API Reference
  • SDKs & Tools
Changelog
Gemini logoGemini logo

© 2026 Gemini Space Station, Inc.

Overview
Core Concepts
    Events, contracts, and outcomesCombo contracts
Market Data
    OverviewFetching Markets
    Ticker formats
      OverviewCryptoSportsSports Market TaxonomyCommoditiesWeather
Trading
    QuickstartOrder lifecycle and settlement
    Full REST reference
      Combo RFQ
      Events
      Volume
      Terms
      Order Management
        Place OrderPlace Batch OrdersCancel OrderCancel Batch OrdersGet Active OrdersGet Order History
      Positions
      Rewards
    WebSocket APIs
      OverviewAuthenticationMessage format
      Streams
        Book tickerL2 partial depthL2 differential depthTrade streamOrder eventsBalance updatesPosition updatesContract statusPrediction
      Utility
      Subscriptions
      L2 Data
      Order management
      Combo RFQ
        OverviewWebSocket streamsQuote methodsMaker integrationExamples
Market Makers
    Maker Fee-Free Trading PromoTaker Rewards ProgramMaker Rebate ProgramLiquidity Rewards ProgramMarket Maker Program
Resources
    SchemasDemo environmentRate limitsErrors

Cancel Batch Orders

REST APIsPrediction MarketsOrder ManagementCancel Batch Orders

Cancel Batch Orders

POSThttps://api.gemini.com/v1/prediction-markets/order/batch/cancel

Cancel 1 to 20 prediction market orders in one authenticated request. The batch is synchronous and non-atomic: invalid IDs reject the entire batch before cancellation begins, while exchange cancellation errors are returned per entry and do not stop later entries.

POSTv1/prediction-markets/order/batch/cancel
curl --request POST \
  --url https://api.gemini.com/v1/prediction-markets/order/batch/cancel \
  --header 'Content-Type: application/json' \
  --header 'X-GEMINI-APIKEY: <string>' \
  --header 'X-GEMINI-PAYLOAD: <string>' \
  --header 'X-GEMINI-SIGNATURE: <string>' \
  --data '
{
  "orderIds": [
    12345678,
    "12345679"
  ]
}
'

Roles

The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.

The OAuth scope must have orders:create assigned to access this endpoint. See OAuth Scopes for more information.

Batch Behavior

  • The complete
    Code
    {"orderIds":[...]}
    payload is encoded and signed once.
  • Each order ID may be a JSON integer or a quoted numeric string.
  • Gemini validates every ID before attempting any cancellation. An invalid ID, an empty batch, or more than 20 entries rejects the entire request.
  • After validation, cancellations are attempted sequentially and results remain aligned with request order.
  • An exchange rejection such as
    Code
    OrderNotFound
    is returned in that entry's result. Other valid cancellations continue to be attempted.

Headers

X-GEMINI-APIKEYstring·required
Your API key
X-GEMINI-SIGNATUREstring·required
HEX-encoded HMAC-SHA384 of payload signed with API secret
X-GEMINI-PAYLOADstring·required
Base64-encoded JSON payload
Content-Typestring
Default: text/plain
Content-Lengthstring
Default: 0
Cache-Controlstring
Default: no-cache

Request Body

orderIdsarray·required
Order IDs to cancel. Each ID may be an integer or a quoted numeric string. All IDs are validated before any cancellation is attempted.
Example request body
{
  "orderIds": [
    12345678,
    "12345679"
  ]
}

Responses

Batch processed. Results are returned in request order and may contain both successful cancellations and per-entry errors.

resultsarray·required
One result for each requested cancellation, in request order.
Example Responses
{
  "results": [
    {
      "orderId": 12345678,
      "result": "ok"
    },
    {
      "orderId": 12345679,
      "error": "OrderNotFound",
      "message": "Order 12345679 not found"
    }
  ]
}
PreviousCancel OrderNextGet Active Orders