Replace Order
POST
https://api.unhedged.gg /api/v1/orders/replaceReplace or amend an open Limit order. quantity is the total fill limit (filled + desired remaining). Same-price size decrease keeps id/FIFO priority (status "amended") or cancels when nothing remains ("cancelled"). Price change or size increase cancel+places a new Limit sized to total − fills. Send postOnly: true on maker-only full replaces and on size decreases (would-take is skipped on decreases; postOnly still avoids maker-protection delay). Requires order:place and order:cancel.
Configure requestRequest
Security · Bearer token
Send your API key in the Authorization header. Required scope order:place, order:cancel.
Rate limit · 120 req/min · 60 per market
Request body
- Required
marketIdstring - Market ID (must be ORDER_BOOK and active).
- Optional
orderIdstring - Numeric string ID of the open Limit order to replace. Exactly one of orderId / clientOrderId.
- Optional
clientOrderIdstring - Client id of the open Limit order to replace. Exactly one of orderId / clientOrderId.
- Optional
replacementClientOrderIdstring - Optional client id for the replacement/amend. Omit to inherit. Must not collide on an actual amend.
- Required
pricestring - New limit price decimal string in (0,1) with exactly 2 decimals.
- Required
quantitystring | integer - Total fill limit (filled + desired remaining) in human shares: 0–2 decimal string or whole-contract integer. quoteQuantity is not supported.
- Optional
revisioninteger - Optional positive safe integer (1–9007199254740991) for this open order lineage. Must exceed its last accepted value; otherwise returns "stale order revision" without changing the order. Follows replacements and alias renames and survives engine restarts. Omit for legacy behavior, preserving the stored revision. Cancellation or full fill ends the lineage; use a fresh clientOrderId for a new order.
- Optional
postOnlyboolean - Defaults to false on each request; not inherited from the source order. Send true for maker-only full replaces and for size decreases (avoids maker-protection delay; would-take is skipped on decreases). Would-take on a full replace keeps the source.
Authorization
Bearer token
Authorization: Bearer ak_your_key_hereBody application/json
curl -X POST https://api.unhedged.gg/api/v1/orders/replace \
-H "Authorization: Bearer ak_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"marketId": "clx...",
"clientOrderId": "bot-42",
"price": "0.64",
"quantity": "50.00",
"revision": 12,
"postOnly": true
}' {
"result": {
"cancelledOrderId": "213",
"replacementOrderId": "214",
"cancelledOrder": { "id": "213", "status": "Cancelled", ... },
"replacementOrder": {
"id": "214",
"status": "Placed",
"price": "0.64",
"quantity": "50.00",
"client_order_id": "bot-42",
"revision": 12,