Developer Quickstart
Make your first TronSave API call — get a key, estimate, buy, and confirm an Energy order in about 10 minutes.
This guide walks you through your first TronSave API call — from getting an API key to having your first Energy order successfully filled — in about 10 minutes.
Before you begin
TronSave supports two authentication methods for API calls. Choose the one that fits your use case:
Best for
Automated bots, backend services
When you prefer not to hold TRX in TronSave
How it works
Deposit TRX into your internal account; TronSave deducts costs automatically
Sign a TRX transaction from your own wallet on each purchase
Complexity
Simpler
Requires TronWeb integration
Recommended
For most use cases
When you need full custody
This guide uses the API Key method. If you want to use Signed Transaction instead, see Buy Resources → Signed Transaction. For a deeper comparison, see Authentication.
Step 1 — Get an API key and deposit TRX
1.1 Get your API key
Go to tronsave.io/market and click Connect to connect your wallet.
After connecting, click the Address button → select Account Info → click Login TronSave and sign in to confirm.
Your API key and deposit address will be displayed — copy and save them.
Testing? Use the Nile testnet at testnet.tronsave.io — everything works the same way but uses no real TRX. See the Test Environment table below.
1.2 Deposit TRX into your internal account
Click Top Up to get your deposit address, then send TRX to that address from any wallet.
A few things to note:
Minimum deposit is 10 TRX per transaction.
Your first deposit requires an extra ~1 TRX to activate the new address.
You get 2 free deposits per day; each additional deposit costs 0.3 TRX.
Your balance updates automatically in about 3 seconds.
Verify your balance via API:
Step 2 — Estimate the cost
Before placing an order, call the estimate endpoint to see how much TRX the order will cost.
Request fields:
receiver
"TFwUFW..."
The TRON address that will receive the Energy
resourceAmount
32000
Amount of Energy to buy (a single USDT TRC-20 transfer costs ~32,000 Energy)
durationSec
259200
Rental duration in seconds — 259200 = 3 days
unitPrice
"MEDIUM"
See the pricing table below
Choosing unitPrice:
"MEDIUM"
Default — suitable for most cases
Moderate
"FAST"
Need the order filled immediately
Higher
"SLOW"
Not time-sensitive, prioritize savings
Lowest
number (SUN)
Full price control, e.g. 80
Custom
Response:
If availableResource If it is less than your requested resourceAmount, the market currently does not have enough Energy available to fill the order fully. See options.allowPartialFill in the next step.
Step 3 — Create a buy order
Once you've confirmed the cost looks reasonable, create the order:
Recommended options config:
Success response:
Save the orderId — You'll need it in the next step.
Step 4 — Check order status
Reading fulfilledPercent:
100
Order fully matched — Energy has been delegated
1–99
Partially matched (only possible when allowPartialFill: true)
0
Pending — waiting for a provider to match
Energy is typically delegated within a few seconds to a few minutes after the order is matched.
Full example (JavaScript)
A complete flow from estimate to order verification:
Test environment (Nile testnet)
Replace the base URL when testing:
Website
https://tronsave.io
https://testnet.tronsave.io
API
https://api.tronsave.io
https://api-dev.tronsave.io
All endpoint paths remain the same — only the domain changes. See Environments & Networks for details.
Next steps
Now that you've placed your first order, you can:
Extend an order — Renew the rental duration before it expires without creating a new order.
View order history — Track all orders under your account.
Buy with Signed Transaction — If you prefer not to hold TRX inside TronSave.
Full code examples — Complete working examples in JS, PHP, and Python.
Last updated