Orders
Modify price or quantity of a pending order
Modifies one or more fields of a pending limit or stop order: price, quantity, take_profit, stop_loss.
Only working (pending) orders can be modified. The order goes through pending_replace → validation → working with updated values.
If the new quantity or price would violate trading rules (e.g., max contracts), the modification is rejected.
Requires x-idempotency-key header.
POST
/
trade
/
order
/
modify
const response = await fetch('/trade/order/modify', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_id: 'your-account-uuid',
order_id: 'order-to-modify-uuid',
price: 6100.00
})
});
const { data: order } = await response.json();
console.log('Modified price:', order.limit_price || order.stop_price);
{
"code": null,
"data": {
"accepted": true,
"command_id": "0d9f3c1e-7c2a-4b53-9d21-8f6a2e4b7c90",
"command_type": "ModifyOrder",
"status": "queued"
},
"error": null,
"success": true
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "UNAUTHORIZED",
"data": null,
"error": "Invalid or missing JWT token",
"success": false
}{
"code": "LOCKOUT_ACTIVE",
"data": null,
"error": "Account is locked out until 2026-03-12T16:00:00Z (mode: timed, 45 minutes remaining)",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "RATE_LIMITED",
"data": null,
"error": "Rate limit exceeded for order submissions. Max 10 requests per second per account. Retry after 100 ms.",
"rate_limit": {
"limit": 10,
"remaining": 0,
"reset": 1711800125,
"retry_after": 0.1
},
"success": false
}Authorizations
Body
application/json
Modify order request
Modify the price and/or quantity of a pending limit or stop order. Only pending orders can be modified.
Example
{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"order_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"price": 6100.00,
"quantity": 2
}
⌘I
const response = await fetch('/trade/order/modify', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_id: 'your-account-uuid',
order_id: 'order-to-modify-uuid',
price: 6100.00
})
});
const { data: order } = await response.json();
console.log('Modified price:', order.limit_price || order.stop_price);
{
"code": null,
"data": {
"accepted": true,
"command_id": "0d9f3c1e-7c2a-4b53-9d21-8f6a2e4b7c90",
"command_type": "ModifyOrder",
"status": "queued"
},
"error": null,
"success": true
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "UNAUTHORIZED",
"data": null,
"error": "Invalid or missing JWT token",
"success": false
}{
"code": "LOCKOUT_ACTIVE",
"data": null,
"error": "Account is locked out until 2026-03-12T16:00:00Z (mode: timed, 45 minutes remaining)",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "RATE_LIMITED",
"data": null,
"error": "Rate limit exceeded for order submissions. Max 10 requests per second per account. Retry after 100 ms.",
"rate_limit": {
"limit": 10,
"remaining": 0,
"reset": 1711800125,
"retry_after": 0.1
},
"success": false
}