</> REST API v1

TRONENS API

Complete TRONENS API v1 contract: pricing, Energy estimation, order creation, status, balance and webhooks.

Sign in

Response format

A real API response always contains success and, on success, data. Errors contain a machine-readable error code. The diagnostic test file also shows method, url, http_code, duration_ms, request, response and curl_error; those fields are not part of the public API. The actual TRONENS response is the value inside response.

{
  "success": true,
  "data": { ... }
}
{
  "success": false,
  "error": "ERROR_CODE"
}

Authentication

Authorization: Bearer te_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

Send the Bearer token in the Authorization header. The key is created in the account and shown in full only once.

ScopeAccess
quoteQuote + Energy estimate
orders:createCreate order + Bulk API
orders:readOrder status
balanceBalance

Each key can have an IP whitelist, per-minute rate limit and expiration. Responses include X-RateLimit-Limit and X-RateLimit-Remaining; HTTP 429 also includes Retry-After.

GET/api/v1/quote/

Quote

Returns the customer price including the account discount.

GET /api/v1/quote/?package_id=1&duration_minutes=15
GET /api/v1/quote/?energy_amount=65000&duration_minutes=60
FieldMeaning
typeQuote type: package or custom.
package_idPackage ID; package quotes only.
namePackage name; package quotes only.
energy_amountAmount of Energy the customer buys.
duration_minutesRental duration in minutes.
base_price_trxPrice before the account discount.
discount_percentDiscount actually applied, in percent.
discount_trxDiscount amount in TRX.
price_trxFinal amount charged to the customer.

Example response

{
  "success": true,
  "data": {
    "type": "custom",
    "energy_amount": 65000,
    "duration_minutes": 60,
    "base_price_trx": 1.961,
    "discount_percent": 0,
    "discount_trx": 0,
    "price_trx": 2.05
  }
}
POST/api/v1/estimate/

Energy estimate

Estimates the Energy requirement for a recipient TRON address.

{
  "recipient_address": "T...",
  "has_usdt": true
}
FieldMeaning
recipient_addressRecipient TRON address.
has_usdtOptional boolean: whether a USDT TRC20 operation is planned.
FieldMeaning
estimated_energyEstimated required Energy amount.
recommended_packageMatching active package or null when none fits.

Example response

{
  "success": true,
  "data": {
    "estimated_energy": 65000,
    "recommended_package": {
      "id": 1,
      "name": "65 000 Energy",
      "energy_amount": 65000,
      "duration_minutes": 15
    }
  }
}
POST/api/v1/order/

Create order

Creates a real order and debits the calculated amount from the account TRX balance. The recipient TRON address must already be activated before the order is created. New API orders are accepted asynchronously with HTTP 202. Always use external_id when possible: repeating it returns the existing order without a second debit.

{
  "external_id": "merchant_93481",
  "package_id": 1,
  "duration_minutes": 15,
  "address": "T..."
}
FieldMeaning
external_idYour unique ID (max 128 chars: A-Z, a-z, 0-9, . _ : -).
package_idPackage ID. Use package_id OR energy_amount.
energy_amountCustom Energy amount. Custom uses the available duration, currently 60 min.
duration_minutesRental duration.
addressRecipient TRON address.
FieldMeaning
order_idTRONENS order ID.
external_idYour order ID. Used for idempotency and status lookup.
statusCurrent public order status.
idempotenttrue means this external_id already existed and no new order was created.

Example response

HTTP 202
{
  "success": true,
  "data": {
    "order_id": 123,
    "external_id": "merchant_93481",
    "status": "processing",
    "idempotent": false
  }
}
POST

Bulk API

/api/v1/orders/bulk/

Creates up to 50 orders in one request. Every item has its own external_id and accepted/failed result. Requires orders:create. Accepted orders use the normal status and webhook flow.

Request fields

{
  "orders": [
    {"external_id":"bulk-001","package_id":1,"duration_minutes":15,"address":"T..."},
    {"external_id":"bulk-002","energy_amount":65000,"duration_minutes":60,"address":"T..."}
  ]
}

1–50 orders · permission: orders:create · HTTP 202 / 207

Example response

{
  "success": true,
  "data": {
    "accepted": 1,
    "failed": 1,
    "results": [
      {"index":0,"external_id":"bulk-001","status":"accepted","order":{"id":123}},
      {"index":1,"external_id":"bulk-002","status":"failed","error":"INVALID_TRON_ADDRESS"}
    ]
  }
}
GET/api/v1/status/

Order status

Returns the current order data and status.

GET /api/v1/status/?id=123
GET /api/v1/status/?external_id=merchant_93481
FieldMeaning
idTRONENS order ID.
external_idYour external ID or null.
addressRecipient TRON address.
energy_amountOrdered Energy amount.
duration_minutesRental duration in minutes.
price_trxTRX amount charged for the order.
statusCurrent status.
txidDelegation TXID when available; otherwise null.
refundedtrue when the order amount has already been refunded to the account balance.
error_codeSafe public code: ORDER_REVIEW, ORDER_FAILED or null.
created_atOrder creation time.
delivered_atConfirmed Energy delivery time or null.
completed_atFull rental completion time or null.
updated_atLast order update time.

Time fields use YYYY-MM-DD HH:MM:SS in the TRONENS server timezone.

Example response

{
  "success": true,
  "data": {
    "id": 123,
    "external_id": "merchant_93481",
    "address": "T...",
    "energy_amount": 65000,
    "duration_minutes": 15,
    "price_trx": 1.14,
    "status": "delegated",
    "txid": "...",
    "refunded": false,
    "error_code": null,
    "created_at": "2026-10-03 18:01:00",
    "delivered_at": "2026-10-03 18:01:12",
    "completed_at": null,
    "updated_at": "2026-10-03 18:01:12"
  }
}

Status

StatusMeaning
processingAccepted and being processed.
delegatingDelegation is being sent or awaiting confirmation.
delegatedEnergy delivered; rental is active.
undelegatingRental period ended; resource is being reclaimed.
completedRental lifecycle fully completed.
reviewAdditional verification is required. Do not create a duplicate order.
failedConfirmed failure. refunded tells whether the balance was already returned.
GET/api/v1/balance/

Balance

Current available TRX balance of the account.

FieldMeaning
balance_trxAvailable customer balance in TRX.
{"success":true,"data":{"balance_trx":125.5}}

Webhook

Webhooks deliver order data when its status changes. Verify the signature against the raw JSON body and webhook secret.

X-Webhook-Event: order.delegated
X-Webhook-Id: order-123-order.delegated-...
X-Webhook-Signature: sha256=<hex_hmac>

expected = HMAC_SHA256(raw_json_body, webhook_secret)
{
  "event": "order.delegated",
  "event_id": "order-123-order.delegated-...",
  "created_at": "2026-10-03T15:01:12Z",
  "data": {
    "order_id": 123,
    "external_id": "merchant_93481",
    "address": "T...",
    "energy_amount": 65000,
    "duration_minutes": 15,
    "price_trx": 1.14,
    "status": "delegated",
    "txid": "...",
    "refunded": false,
    "error_code": null,
    "created_at": "2026-10-03 18:01:00",
    "delivered_at": "2026-10-03 18:01:12",
    "completed_at": null,
    "updated_at": "2026-10-03 18:01:12"
  }
}

Events: order.processing, order.delegating, order.delegated, order.undelegating, order.completed, order.review, order.failed. HTTP 2xx marks delivery successful; temporary failures are retried up to 8 times with backoff. Deduplicate by event_id.

Errors

error codes are intended for programmatic handling. Use the HTTP status and the error field.

HTTPerrorMeaning
401UNAUTHORIZED / TOKEN_EXPIREDInvalid or expired API key.
403SCOPE_FORBIDDEN / IP_NOT_ALLOWEDRequired scope is missing or the IP is not allowed.
402INSUFFICIENT_BALANCEInsufficient TRX balance.
400INVALID_JSONInvalid JSON body.
413REQUEST_TOO_LARGEJSON body is too large.
400ID_REQUIREDstatus requires id or external_id.
404NOT_FOUND / PACKAGE_NOT_FOUNDOrder or package not found.
422EXTERNAL_ID_INVALIDexternal_id is invalid.
422INVALID_TRON_ADDRESSInvalid TRON address.
422ADDRESS_NOT_ACTIVEThe TRON address is not activated yet. Activate it before creating an order.
422PRODUCT_REQUIRED / PRODUCT_SELECTOR_CONFLICTProvide exactly one of package_id or energy_amount.
422CUSTOM_ENERGY_DISABLEDCustom Energy ordering is currently disabled.
422CUSTOM_ENERGY_OUT_OF_RANGECustom Energy amount is outside current limits.
422CUSTOM_ENERGY_INVALID_STEPCustom Energy amount does not match the configured step.
422RENTAL_DURATION_UNAVAILABLE / CUSTOM_DURATION_UNAVAILABLE / DURATION_PRICE_UNAVAILABLERequested rental duration is unavailable.
503SERVICE_UNAVAILABLEService temporarily unavailable; retry later.
429RATE_LIMITEDAPI key request limit exceeded.
405METHOD_NOT_ALLOWEDWrong HTTP method. Use the method documented for the endpoint.