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:

API Key (Internal Account)
Signed Transaction

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

  1. Go to tronsave.io/market and click Connect to connect your wallet.

  2. After connecting, click the Address button → select Account Info → click Login TronSave and sign in to confirm.

  3. 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:

Field
Example
Description

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:

Value
When to use
Price level

"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:

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:

Value
Meaning

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

Full example (JavaScript)

A complete flow from estimate to order verification:

Prefer an SDK? The SDK (TypeScript, Rust, Python, Java, PHP) is faster to get started:

This installs the TypeScript package; see the SDK page for the other languages.

Test environment (Nile testnet)

Replace the base URL when testing:

Production
Testnet

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:


Need help? Reach out on Telegram or check the FAQ.

Last updated