Modify Order
Amend a resting order's price and/or quantity in place.
PATCH /orders/{orderId}
Auth: Authorization: Bearer <access_token>.
Request Body
At least one of price or quantity must be supplied.
| Field | Type | Required | Description |
|---|---|---|---|
price | number | Conditional | New price |
quantity | number | Conditional | New total quantity (not a delta) |
Only limit orders can be modified. peg order prices are derived from peg_reference and cannot be set directly — modify quantity instead. market orders and orders in a terminal state (FILLED, CANCELLED, REJECTED) cannot be modified.
Example
curl -X PATCH https://api.godarkdex.com/api/v1/orders/ord_01HXYZ12345 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"price": 96000,
"quantity": 0.15
}'
Success Response
{
"code": 0,
"data": {
"order_id": "ord_01HXYZ12345",
"price": 96000,
"quantity": 0.15,
"filled_quantity": 0.03,
"remaining_quantity": 0.12,
"status": "PARTIALLY_FILLED"
},
"timestamp": "2026-04-20T10:30:00.123Z",
"request_id": "req_01HXYZ..."
}
Queue Priority
Modify is implemented as an atomic amend, not cancel-replace. Priority rules:
| Change | Queue priority |
|---|---|
| Quantity decrease only | Preserved |
| Quantity increase (any) | Lost (treated as a new entry at the new size) |
| Price change (any) | Lost (re-enters the book at the new price level) |
Clients that care about priority should reduce-only rather than reprice where possible.
Errors
| Code | Meaning |
|---|---|
1400 | Order not found or in a terminal state |
1401 | Order belongs to a different account |
1402 | type does not support modification (e.g. market) |
1403 | Neither price nor quantity supplied |
1410–1413 | Risk check failed against the new order parameters |