curl --request DELETE \
--url https://api.elections.kalshi.com/trade-api/v2/portfolio/orders/{order_id} \
--header 'KALSHI-ACCESS-KEY: <api-key>' \
--header 'KALSHI-ACCESS-SIGNATURE: <api-key>' \
--header 'KALSHI-ACCESS-TIMESTAMP: <api-key>'{
"order": {
"order_id": "<string>",
"user_id": "<string>",
"client_order_id": "<string>",
"ticker": "<string>",
"side": "yes",
"action": "buy",
"type": "limit",
"status": "resting",
"yes_price": 123,
"no_price": 123,
"yes_price_dollars": "0.5600",
"no_price_dollars": "0.5600",
"fill_count": 123,
"remaining_count": 123,
"initial_count": 123,
"taker_fees": 123,
"maker_fees": 123,
"taker_fill_cost": 123,
"maker_fill_cost": 123,
"taker_fill_cost_dollars": "0.5600",
"maker_fill_cost_dollars": "0.5600",
"queue_position": 123,
"taker_fees_dollars": "0.5600",
"maker_fees_dollars": "0.5600",
"expiration_time": "2023-11-07T05:31:56Z",
"created_time": "2023-11-07T05:31:56Z",
"last_update_time": "2023-11-07T05:31:56Z",
"self_trade_prevention_type": "taker_at_cross",
"order_group_id": "<string>",
"cancel_order_on_pause": true
},
"reduced_by": 123
}Endpoint for canceling orders. The value for the orderId should match the id field of the order you want to decrease. Commonly, DELETE-type endpoints return 204 status with no body content on success. But we can’t completely delete the order, as it may be partially filled already. Instead, the DeleteOrder endpoint reduce the order completely, essentially zeroing the remaining resting contracts on it. The zeroed order is returned on the response payload as a form of validation for the client.
curl --request DELETE \
--url https://api.elections.kalshi.com/trade-api/v2/portfolio/orders/{order_id} \
--header 'KALSHI-ACCESS-KEY: <api-key>' \
--header 'KALSHI-ACCESS-SIGNATURE: <api-key>' \
--header 'KALSHI-ACCESS-TIMESTAMP: <api-key>'{
"order": {
"order_id": "<string>",
"user_id": "<string>",
"client_order_id": "<string>",
"ticker": "<string>",
"side": "yes",
"action": "buy",
"type": "limit",
"status": "resting",
"yes_price": 123,
"no_price": 123,
"yes_price_dollars": "0.5600",
"no_price_dollars": "0.5600",
"fill_count": 123,
"remaining_count": 123,
"initial_count": 123,
"taker_fees": 123,
"maker_fees": 123,
"taker_fill_cost": 123,
"maker_fill_cost": 123,
"taker_fill_cost_dollars": "0.5600",
"maker_fill_cost_dollars": "0.5600",
"queue_position": 123,
"taker_fees_dollars": "0.5600",
"maker_fees_dollars": "0.5600",
"expiration_time": "2023-11-07T05:31:56Z",
"created_time": "2023-11-07T05:31:56Z",
"last_update_time": "2023-11-07T05:31:56Z",
"self_trade_prevention_type": "taker_at_cross",
"order_group_id": "<string>",
"cancel_order_on_pause": true
},
"reduced_by": 123
}Your API key ID
RSA-PSS signature of the request
Request timestamp in milliseconds
Order ID
Order cancelled successfully
Show child attributes
Unique identifier for users
yes, no buy, sell limit, market The status of an order
resting, canceled, executed The yes price for this order in fixed-point dollars
"0.5600"
The no price for this order in fixed-point dollars
"0.5600"
The number of contracts that have been filled
The initial size of the order (contract units)
Fees paid on filled taker contracts, in cents
Fees paid on filled maker contracts, in cents
The cost of filled taker orders in cents
The cost of filled maker orders in cents
The cost of filled taker orders in dollars
"0.5600"
The cost of filled maker orders in dollars
"0.5600"
DEPRECATED: This field is deprecated and will always return 0. Please use the GET /portfolio/orders/{order_id}/queue_position endpoint instead
Fees paid on filled taker contracts, in dollars
"0.5600"
Fees paid on filled maker contracts, in dollars
"0.5600"
The last update to an order (modify, cancel, fill)
The self-trade prevention type for orders
taker_at_cross, maker The order group this order is part of
If this flag is set to true, the order will be canceled if the order is open and trading on the exchange is paused for any reason.