GeminiGemini
SandboxGet API key
  • Crypto Trading
  • Prediction Markets
Changelog
Gemini Crypto Exchange LogoGemini Crypto Exchange Logo

© 2026 Gemini Space Station, Inc.

Getting StartedAPI Specifications
Maker and Taker Incentives
    Market Maker ProgramMaker Rebate ProgramLiquidity Rewards ProgramTaker Rewards Program
WebSocket
    IntroductionAuthenticationMessage Format
    Streams
      Book TickerL2 Partial DepthL2 Differential DepthTrade StreamOrder EventsBalance UpdatesPosition UpdatesContract Status
    Playground
      OverviewconninfopingtimeSUBSCRIBEUNSUBSCRIBELIST_SUBSCRIPTIONSdepthorder.placeorder.cancelorder.cancel_allorder.cancel_session
REST APIs
    Combos
    Events
    Terms
    Order Management
      Place OrderPlace Batch OrdersCancel OrderCancel Batch OrdersGet Active OrdersGet Order History
    Positions
    Rewards
Combo Contracts
    Overview
Combos Request-for-Quote (RFQ)
    OverviewWebSocket StreamsQuote MethodsMaker IntegrationExamples
Tickers
    OverviewCryptoSportsCommoditiesWeather
Schemas

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
Last modified on July 21, 2026