Create stop-limit order
Places a new BYMA stop-limit order to buy or sell a symbol once a stop price is reached, executing at a limit price, for a given account.
POST
/v1/broker/orders/byma/stop-limitRequest
Headers
| Field | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Access token in Bearer ACCESS_TOKEN format |
Content-Type | string | Yes | Must be application/json |
Not applicable: Path Parameters, Query Parameters.
Body
At least one of
amount or quantity is requiredAt least one of amount or quantity must be provided. If only amount is sent, the quantity of nominal values is estimated automatically; if only quantity is sent, the amount is estimated automatically.
price is conditionalprice is optional for standard orders, but required for repo orders (cauciones). It represents the reference price shown to the user before execution and is later overwritten by the actual execution price.
| Field | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Ticker of the instrument to operate (e.g. AL30). |
side | string | Yes | Operation side. Possible values: BUY, SELL. |
settled_period | string | Yes | Settlement period. Possible values: T0 (immediate settlement), T1 (24-hour settlement). |
account_number | integer | Yes | Account number the order is placed for. |
price_limit | number | Yes | Price at which the order is executed once triggered by stop_price. |
stop_price | number | Yes | Trigger price. Once the market reaches this price, the order is submitted at price_limit. |
quantity | number | Conditional | Quantity of nominal values to operate. Required if amount is not provided; otherwise estimated automatically from amount. |
amount | number | Conditional | Monetary amount to operate. Required if quantity is not provided; otherwise the quantity of nominals is estimated automatically. |
price | number | Conditional | Reference price shown to the user. Required only for repo orders (cauciones). |
tag | object | No | Freeform key-value metadata to associate with the order. |
Response
2XX Success
| Field | Type | Description |
|---|---|---|
order_id | integer | Identifier assigned to the newly created order. |
Error Codes
| Status | Description |
|---|---|
400 | Bad Request — invalid or missing parameters (e.g. neither amount nor quantity was specified), or the account is not allowed to operate |
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": "At least one of amount or quantity must be specified"
}
Code Example
- cURL
- JavaScript
- Python
- Node.js
curl -X POST https://b2b.allaria.cloud/v1/broker/orders/byma/stop-limit \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"symbol": "AL30",
"side": "BUY",
"settled_period": "T0",
"account_number": 70104,
"amount": 5000.00,
"price_limit": 800,
"stop_price": 700
}'
const response = await fetch('https://b2b.allaria.cloud/v1/broker/orders/byma/stop-limit', {
method: 'POST',
headers: {
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
symbol: 'AL30',
side: 'BUY',
settled_period: 'T0',
account_number: 70104,
amount: 5000.00,
price_limit: 800,
stop_price: 700
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://b2b.allaria.cloud/v1/broker/orders/byma/stop-limit',
headers={
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
},
json={
'symbol': 'AL30',
'side': 'BUY',
'settled_period': 'T0',
'account_number': 70104,
'amount': 5000.00,
'price_limit': 800,
'stop_price': 700
}
)
data = response.json()
print(data)
const axios = require('axios');
const response = await axios.post(
'https://b2b.allaria.cloud/v1/broker/orders/byma/stop-limit',
{
symbol: 'AL30',
side: 'BUY',
settled_period: 'T0',
account_number: 70104,
amount: 5000.00,
price_limit: 800,
stop_price: 700
},
{
headers: {
Authorization: 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
}
}
);
console.log(response.data);
2XX Success
{
"order_id": 984514
}