Estimate Network Fee
HTTP Method: GET
Endpoint URL: /network-fee
Description: Estimates the on-chain network fee for a withdrawal — for a single asset or for every withdraw-enabled coin of a network — without broadcasting any transaction. The estimate uses the same calculation as a real withdrawal, so the returned fee matches what would actually be charged.
Security: Requires the API-KEY header.
Network fees are charged in the network's native coin (e.g. TRX on TRON, ETH on Ethereum). For TRON the fee depends on the sender's on-chain energy/bandwidth; see Transaction Fees for the overall fee structure.
Query Parameters
- assetNetwork (
string, required) — Blockchain network (e.g.tron,ethereum,bsc,solana). See Available Assets for API values. - addressFrom (
string, required) — Sender address. Must be one of your existing wallet addresses on this network. - addressTo (
string, required) — Recipient address. - assetShort (
string, optional) — Asset code (e.g.USDT). If omitted, the fee is estimated for every withdraw-enabled coin of the network.
Request Headers
API-KEY: your_account_api_key
Example cURL
curl "https://api.alppay.io/v2/network-fee?assetNetwork=tron&addressFrom=TSenderAddress...&addressTo=TRecipientAddress...&assetShort=USDT" \
-H "API-KEY: ak_live_1234567890abcdef"
Successful Response (200 OK)
{
"assetNetwork": "tron",
"fees": [
{
"assetShort": "USDT",
"fee": "27.00000000",
"feeCurrency": "TRX",
"canProceed": true,
"details": {
"energy": 130000,
"bandwidth": 345,
"isActivated": true,
"resource": { "energy": 0, "bandwidth": 0 }
}
}
]
}
When assetShort is omitted, fees contains one entry per withdraw-enabled coin of the network.
Response Field Descriptions
- assetNetwork — The network from the request
- fees — Array with one estimate per coin
- fees[].assetShort — Asset code (e.g.
TRX,USDT) - fees[].fee — Estimated network fee as a decimal string, expressed in
feeCurrency - fees[].feeCurrency — Native fee coin of the network (
TRX,ETH,BNB,SOL, …) - fees[].canProceed — Whether the sender currently has enough resources/balance to cover the fee
- fees[].details — Network-specific breakdown (for TRON see below). On insufficient EVM/Solana balance it carries
feeRequired,feeAvailable,feeDeficit. If the fee could not be computed for a coin (e.g. the network scanner is unavailable), the entry hascanProceed: falseanddetails: { "error": "..." }.
TRON details
For TRON, details explains the energy/bandwidth a transfer needs and the sender's current state:
- energy — Energy required for the transfer. TRC20 token transfers (e.g. USDT) consume energy; native TRX transfers need none.
- bandwidth — Bandwidth required for the transfer.
- isActivated — Whether the sender address is activated on TRON. An inactive account must be activated first (a small TRX cost).
- resource.energy / resource.bandwidth — The sender's currently available energy and bandwidth. When they don't cover the required
energy/bandwidth, the deficit is rented (Tronegy) or burned as TRX — reflected infeeandcanProceed.
Error Responses
Errors are returned as { "code", "num", "message" }, where num is a stable machine-readable error code:
{ "code": 400, "num": 10040, "message": "The assetNetwork query parameter is required." }
- 400 Bad Request — A required query parameter is missing (
assetNetwork,addressFrom,addressTo), theassetNetworkis unknown, or the request is rejected by validation (e.g.addressFrom: Address not found on this network). - 401 Unauthorized — Invalid or missing
API-KEYheader. - 429 Too Many Requests — Rate limit exceeded.
- 500 Internal Server Error — The fee could not be estimated due to a temporary backend issue.