Cancel and Replace an Order
A 3-step recipe with Backpack. We can help you get access.
Recipe · 3 steps
Cancel and Replace an Order
with Backpack
Cancel a resting order and replace it with a new limit order on the same side.
- Read the resting order by id to confirm it is still on the book before attempting to cancel it.
- Cancel the resting order from the order book by its id.
- Submit the replacement limit order on the same symbol and side at the new price and quantity.
What you'll need to have ready
- symbol: The market symbol the order exists on (e.g. SOL_USDC).
- orderId: The id of the resting order to cancel and replace.
- side: Side for the replacement order; Bid to buy, Ask to sell.
- newPrice: The new limit price as a decimal string.
- newQuantity: The new order quantity in the base asset as a decimal string.
- apiKey: Base64 encoded ED25519 verifying key for the X-API-KEY header.
- signature: Base64 encoded ED25519 signature for the X-SIGNATURE header.
- timestamp: Unix time in milliseconds for the X-TIMESTAMP header.
- window: Request validity window in milliseconds for the X-WINDOW header (default 5000).
For your developer
Arazzo workflow backpack:cancel-replace-order, 3 operations: get_order → cancel_order → execute_order. Specs on APIs.io.