Calculate fees for a BYMA order
Calculates the Allaria and BYMA fees for a market order before it is executed, given an order amount or quantity and a symbol.
POST
/v1/broker/fees/calculateRequest
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
amount is effectively requiredAlthough amount is an optional field of the shared order payload, this endpoint requires it to calculate fees: if amount is omitted (even when quantity is present), the request fails with a 400 Bad Request — see Error Codes below.
| Field | Type | Required | Description |
|---|---|---|---|
quantity | number | No | Quantity of nominal values to operate. If not specified, it is estimated based on amount. |
amount | number | No | Monetary amount to operate. Required in practice for this endpoint (see note above); if provided, the quantity of nominals is estimated automatically. |
symbol | string | Yes | Ticker symbol of the tradable asset. |
side | string | Yes | Order side. Possible values: BUY, SELL. |
settled_period | string | Yes | Settlement period. Possible values: T0 (immediate settlement / Contado Inmediato), T1 (24-hour settlement). |
account_number | integer | Yes | Account number associated with the Allaria account. |
price | number | No | Reference price shown to the user. Only relevant for repo market orders. |
tag | object | No | Optional key-value metadata tags attached to the order. |
Response
2XX Success
| Field | Type | Description |
|---|---|---|
symbol | string | Ticker symbol of the tradable asset. |
side | string | Order side. Possible values: BUY, SELL. |
received_amount | number | Net order amount before fees are applied. |
allaria_fee | number | Fee amount charged by Allaria for this order. |
byma_fee | number | Fee amount charged by BYMA (the exchange) for this order. |
allaria_fee_percentage | number | Fee percentage applied by Allaria over the order amount (decimal, e.g. 0.0015 = 0.15%). |
allaria_min_fee | number | Minimum fee amount configured for Allaria, applied when the percentage-based fee would be lower. |
total_fees | number | Sum of allaria_fee and byma_fee. |
total_amount_with_fees | number | Total amount resulting from adding total_fees to received_amount. |
Error Codes
| Status | Description |
|---|---|
400 | Bad Request — amount was not provided |
401 | Unauthorized — invalid or missing access token |
403 | Forbidden — the token does not have permission to access this resource |
500 | Internal Server Error |
400 response body shapeThis specific validation is not routed through the standard error mapper, so the response body is a plain message string instead of the code/description shape shown below:
Amount must be provided
Error structure (401, 403, 500):
{
"code": "INTERNAL_ERROR",
"description": "An unexpected error occurred"
}
Code Example
- cURL
- JavaScript
- Python
- Node.js
curl -X POST "https://b2b.allaria.cloud/v1/broker/fees/calculate" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"symbol": "AL30D",
"side": "SELL",
"amount": 184.75,
"settled_period": "T0",
"account_number": 5050
}'
const response = await fetch('https://b2b.allaria.cloud/v1/broker/fees/calculate', {
method: 'POST',
headers: {
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
symbol: 'AL30D',
side: 'SELL',
amount: 184.75,
settled_period: 'T0',
account_number: 5050,
}),
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://b2b.allaria.cloud/v1/broker/fees/calculate',
headers={
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json',
},
json={
'symbol': 'AL30D',
'side': 'SELL',
'amount': 184.75,
'settled_period': 'T0',
'account_number': 5050,
}
)
data = response.json()
print(data)
const axios = require('axios');
const response = await axios.post(
'https://b2b.allaria.cloud/v1/broker/fees/calculate',
{
symbol: 'AL30D',
side: 'SELL',
amount: 184.75,
settled_period: 'T0',
account_number: 5050,
},
{
headers: {
Authorization: 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json',
},
}
);
console.log(response.data);
2XX Success
{
"symbol": "AL30D",
"side": "SELL",
"received_amount": 184.75,
"allaria_fee": 0.27,
"byma_fee": 0.003,
"allaria_fee_percentage": 0.0015,
"allaria_min_fee": 0.00,
"total_fees": 0.273,
"total_amount_with_fees": 185.023
}