Calculate MEP fees
Simulates the fee calculation for a USD-MEP operation without executing it.
POST
/v1/operations/usd-mep/calculate-feesRequest
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
person_type is validated server-side
The field is typed as optional, but the server rejects the request with a 400 if it cannot be resolved (either because it is omitted or because the account information required to infer it is incomplete).
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Amount to simulate, in ARS. |
side | string | Yes | Operation side. Possible values: buy, sell. |
account_id | string | Yes | Client account number the simulation applies to. |
person_type | string | No | Type of the account holder. Possible values: NATURAL, NATURAL_NON_RESIDENT, JURIDICAL. |
Response
2XX Success
| Field | Type | Description |
|---|---|---|
allaria_fee | number | Fee charged by Allaria for the operation. |
byma_fee | number | Fee charged by BYMA (Bolsas y Mercados Argentinos) for the operation. |
total_fees | number | Sum of all fees applied to the operation. |
gross_amount | number | Gross amount of the operation, before fees. |
net_amount | number | Net amount of the operation, after fees. |
Error Codes
| Status | Description |
|---|---|
400 | Bad Request — invalid or missing parameters |
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": "BAD_REQUEST",
"description": "person type is required"
}
Code Example
- cURL
- JavaScript
- Python
- Node.js
curl -X POST https://b2b.allaria.dev/v1/operations/usd-mep/calculate-fees \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 100000.00,
"side": "buy",
"account_id": "12345",
"person_type": "NATURAL"
}'
const response = await fetch('https://b2b.allaria.dev/v1/operations/usd-mep/calculate-fees', {
method: 'POST',
headers: {
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 100000.00,
side: 'buy',
account_id: '12345',
person_type: 'NATURAL'
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://b2b.allaria.dev/v1/operations/usd-mep/calculate-fees',
headers={
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
},
json={
'amount': 100000.00,
'side': 'buy',
'account_id': '12345',
'person_type': 'NATURAL'
}
)
data = response.json()
print(data)
const axios = require('axios');
const response = await axios.post(
'https://b2b.allaria.dev/v1/operations/usd-mep/calculate-fees',
{
amount: 100000.00,
side: 'buy',
account_id: '12345',
person_type: 'NATURAL'
},
{
headers: {
Authorization: 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
}
}
);
console.log(response.data);
2XX Success
{
"allaria_fee": 1250.00,
"byma_fee": 15.75,
"total_fees": 1265.75,
"gross_amount": 100000.00,
"net_amount": 98734.25
}