Preview an order's cost
GET
/api/v1/orders/preview
const url = 'https://trongas.ai/api/v1/orders/preview?volume=1&days=example&resource=energy';const options = {method: 'GET', headers: {'X-Api-Key': '<X-Api-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://trongas.ai/api/v1/orders/preview?volume=1&days=example&resource=energy' \ --header 'X-Api-Key: <X-Api-Key>'Price an order before placing it: resource price, the address-activation fee if target is not activated yet, the estimated saving versus burning TRX (energy only), and your current TRX balance. Read-only — charges nothing. resource is energy (default) or bandwidth.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters”volume
required
integer | string format: int64
Amount of the resource: energy units or bandwidth bytes. Limits: see GET /orders/options (orders) or GET /automations/options (automations).
days
required
string
Rental period (despite the name): 15m, 1h or 1d. Same values as duration elsewhere; see GET /orders/options.
resource
string
energy or bandwidth. Defaults to energy where optional.
target
string
Recipient TRON address (T…). Lets the preview include the exact address-activation fee.
Responses
Section titled “ Responses ”OK
object
priceTrx
required
string
baseCostTrx
required
string
commissionTrx
required
string
activationTrx
required
string
burnCostTrx
required
string
savingsPercent
required
string
balanceTrx
required
string
object
priceTrx
required
string
baseCostTrx
required
string
commissionTrx
required
string
activationTrx
required
string
burnCostTrx
required
string
savingsPercent
required
string
balanceTrx
required
string
Examplegenerated
{ "priceTrx": "example", "baseCostTrx": "example", "commissionTrx": "example", "activationTrx": "example", "burnCostTrx": "example", "savingsPercent": "example", "balanceTrx": "example"}object
priceTrx
required
string
baseCostTrx
required
string
commissionTrx
required
string
activationTrx
required
string
burnCostTrx
required
string
savingsPercent
required
string
balanceTrx
required
string
Examplegenerated
{ "priceTrx": "example", "baseCostTrx": "example", "commissionTrx": "example", "activationTrx": "example", "burnCostTrx": "example", "savingsPercent": "example", "balanceTrx": "example"}