Cancel Order
This will cancel an order. If the order is already canceled, the message will succeed but have no effect.
<div class="p-4 text-sm section-icon section-info rounded-sm" role="alert"> <div class="flex"> <svg view-box="0 0 24 24" > <path fill-rule="evenodd" clip-rule="evenodd" d="M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM11 17V11H13V17H11ZM11 9V7H13V9H11Z" /> </svg> Enabled for perpetuals accounts from July 10th, 0100hrs ET onwards. </div> </div>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.
All Cancellation Reasons
Under unique circumstances, orders may be automatically cancelled by the exchange. These scenarios are detailed in the table below:
| Cancel Reason | Description |
|---|---|
| MakerOrCancelWouldTake | Occurs when the "maker-or-cancel" execution option is included in the order request and any part of the requested order could be filled immediately. |
| ExceedsPriceLimits | Occurs when there is not sufficient liquidity on the order book to support the entered trade. Orders will be automatically cancelled when liquidity conditions are such that the order would move price +/- 5%. |
| SelfCrossPrevented | Occurs when a user enters a bid that is higher than that user's lowest open ask or enters an ask that is lower than their highest open bid on the same pair. |
| ImmediateOrCancelWouldPost | Occurs when the "immediate-or-cancel" execution option is included in the order request and the requested order cannot be fully filled immediately. This type of cancellation will only cancel the unfulfilled part of any impacted order. |
| FillOrKillWouldNotFill | Occurs when the "fill-or-kill" execution option is included in the new order request and the entire order cannot be filled immediately.<br><br>Unlike "immediate-or-cancel" orders, this execution option will result in the entire order being cancelled rather than just the unfulfilled portion. |
| Requested | Cancelled via user request to /v1/order/cancel endpoint. |
| MarketClosed | Occurs when an order is placed for a trading pair that is currently closed. |
| TradingClosed | Occurs when an order is placed while the exchange is closed for trading. |
Request
- Base URLhttps://api.gemini.com
- URLhttps://api.gemini.com/v1/order/cancel
- AuthAPI key in header X-GEMINI-APIKEY and API key in header X-GEMINI-SIGNATURE and API key in header X-GEMINI-PAYLOAD
Headers
Your API key
HEX-encoded HMAC-SHA384 of payload signed with API secret
Base64-encoded JSON payload
Request body
Example request
{
"request": "/v1/order/cancel",
"nonce": "1495127793000",
"order_id": 106817811,
"account": "primary"
}Response
Response will be the fields included in Order Status. If the order was already canceled, then the request will have no effect and the status will be returned. Note the is_cancelled node will have a value of 'true'
Example response
{
"timestamp": "1495127793000",
"timestampms": "1495127793000"
}Changes
No recorded changes to this operation across all 1 revision of this API.