Edit order
Edits the quantity, amount, limit price, or stop price of an existing pending order.
PUT
/v1/broker/orders/edit/{order-id}Request
Headers
| Field | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Access token in Bearer ACCESS_TOKEN format |
Content-Type | string | Yes | Must be application/json |
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
order-id | integer | Yes | Internal identifier of the order to edit. |
Not applicable: Query Parameters.
Body
All fields are optional
Include only the fields you want to change. stop_price only applies to stop-limit orders.
| Field | Type | Required | Description |
|---|---|---|---|
quantity | number | No | New quantity of nominal values for the order. |
limit_price | number | No | New limit price for the order. |
amount | number | No | New monetary amount for the order. |
stop_price | number | No | New stop price for the order. Only valid for stop-limit orders. |
Response
2XX Success
| Field | Type | Description |
|---|---|---|
status | string | Result of the edition. Possible values: OK, ERROR. |
description | string | Human-readable description of the result. |
Error Codes
| Status | Description |
|---|---|
400 | Bad Request — no order exists with the given order-id, the order is not in a state that can be edited, or the new values are invalid |
401 | Unauthorized — invalid or missing access token |
403 | Forbidden — the token does not have permission to access this resource |
500 | Internal Server Error |
Error structure:
{
"code": "invalid_request",
"description": "Order 984512 not found"
}
Code Example
- cURL
- JavaScript
- Python
- Node.js
curl -X PUT https://b2b.allaria.dev/v1/broker/orders/edit/984512 \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"quantity": 100.0
}'
const orderId = 984512;
const response = await fetch(
`https://b2b.allaria.dev/v1/broker/orders/edit/${orderId}`,
{
method: 'PUT',
headers: {
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({ quantity: 100.0 })
}
);
const data = await response.json();
console.log(data);
import requests
order_id = 984512
response = requests.put(
f'https://b2b.allaria.dev/v1/broker/orders/edit/{order_id}',
headers={
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
},
json={ 'quantity': 100.0 }
)
data = response.json()
print(data)
const axios = require('axios');
const orderId = 984512;
const response = await axios.put(
`https://b2b.allaria.dev/v1/broker/orders/edit/${orderId}`,
{ quantity: 100.0 },
{
headers: {
Authorization: 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
}
}
);
console.log(response.data);
2XX Success
{
"status": "OK",
"description": "Order edited successfully."
}