CoinfiraEnergy API
API v1 API Reference

Estimates and energy orders

#Currency and billing

currency: USDT means Coinfira simulates a TRC-20 USDT transfer to determine energy usage. Coinfira does not send the customer's USDT transaction.

The merchant balance, energy price, activation price, bandwidth funding, and total price are all denominated in TRX.

#Estimate

POST /api/v1/energy/estimate accepts the sender and recipient addresses. It calculates the required amount of energy and returns:

  • required: energy expected for the transfer;
  • available: energy currently available on the sender;
  • missing: required - available, never below zero;
  • recommended_purchase: missing energy plus the configured safety buffer and subject to the minimum purchasable quantity;
  • activation_required: whether the sender account must be activated first.

#Smart order

POST /api/v1/energy/orders is designed for a USDT transaction when you do not know in advance how much energy it will require. In a single request, provide the sender address, recipient address, preferred delegation duration, and the order number from your system. Coinfira calculates the required energy, activates the sender address when necessary, and supplies it with energy. The address is then ready for the planned transaction, and you are notified when the order is ready.

Set the optional bandwidth_control field to true when Coinfira should also verify that the sender can pay the bandwidth cost of the planned transaction. The option is false by default, so existing integrations do not need to change their requests.

When bandwidth control is enabled, Coinfira first uses the sender's available bandwidth. If it is insufficient but the sender already has enough TRX to burn for this transaction, no additional transfer is made. Only when both bandwidth and TRX are insufficient does Coinfira send TRX to the sender before delegating energy. The response, status endpoint, and terminal webhook then include a bandwidth object with the transfer price, Coinfira fee, status, and funding transaction ID.

{
  "client_order_id": "merchant-order-20261027-001",
  "from_address": "TESVFJJpXqHsTvdoHy58qFAvsZhHeqbQgZ",
  "to_address": "TSknn7sfj5qJEPYLesBuSDo9u1h87GveZk",
  "currency": "USDT",
  "duration": "5m",
  "bandwidth_control": true
}

If no energy is missing, the endpoint returns 409 with energy_purchase_not_required and includes the current estimate in error.details.estimate.

#Direct order

POST /api/v1/energy/orders/direct is designed for cases where you already know the desired energy quantity or want to purchase extra energy as a reserve. Provide the address, quantity, and delegation duration. Coinfira activates the address when necessary and supplies the requested amount of energy.

Current public constraints:

Field Constraint
quantity_energy Integer from 65000 through 5000000
duration 5m or 1h, default 1h
currency USDT, default USDT
client_order_id 12-120 characters: letters, digits, _, -

#Activation pricing

When activation.required is true, activation.price_trx is added to the energy price:

total_price_trx = energy.price_trx + activation.price_trx

If bandwidth funding was required, its total is also included:

total_price_trx = energy.price_trx + activation.price_trx + bandwidth.total_price_trx

Activation and energy prices remain separate in the response for accounting clarity.

#Responses

  • 202 Accepted: order is pending and processing continues asynchronously.
  • 200 OK: an idempotent retry returned an existing non-pending order, or an order status/wallet request succeeded.
  • 402 Payment Required: merchant balance is insufficient.
  • 409 Conflict: idempotency conflict or a smart purchase is unnecessary.

The provider used to fulfill an order is internal and is never exposed.