For the complete documentation index, see llms.txt. This page is also available as Markdown.

Buy Energy

Create resource order

Create an energy rental order

post
Authorizations
CF-ACCESS-KEYstringRequired
CF-ACCESS-SIGNstringRequired
CF-ACCESS-TIMESTAMPstringRequired
Query parameters
quantityinteger · int32Required

Amount of energy to rent. Must be at least 65,000.

receiverstringRequired

TRON address that will receive the energy.

durationstringRequired

Rental duration. Currently, only 1h (one hour) is supported.

client_order_idstringOptional

Your own order ID, up to 64 characters. Reusing an ID for the same account returns the existing order without creating a new one.

activatebooleanOptional

Whether to allow activation of the receiving address. Defaults to true. If false, the request fails when the address has not been activated.

Default: true
Header parameters
CF-ACCESS-KEYstringRequired

Your API key for authentication.

Example: your api key
CF-ACCESS-SIGNstringRequired

Request signature generated with HMAC-SHA256 and encoded in Base64. See the request signing guide for details.

Example: signature
CF-ACCESS-TIMESTAMPstringRequired

Request timestamp in UTC, for example 2008-08-08T08:08:08.888Z.

Responses
200

API response. Check code and msg for the result of the request.

application/json
codeinteger · int32Optional

Result code. 0 indicates a successful API request; any other value indicates an error.

msgstringOptional

Result message, with error details if the request fails.

sub_codestringOptional
sub_msgstringOptional
post/v1/order
POST /v1/order?quantity=1&receiver=text&duration=text HTTP/1.1
Host: api.catfee.io
CF-ACCESS-KEY: text
CF-ACCESS-SIGN: text
CF-ACCESS-TIMESTAMP: text
Accept: */*
200

API response. Check code and msg for the result of the request.

{
  "code": 1,
  "msg": "text",
  "sub_code": "text",
  "sub_msg": "text",
  "data": {
    "id": "text",
    "client_order_id": "text",
    "resource_type": "ENERGY",
    "source_type": "TRANSFER",
    "pay_timestamp": 1,
    "receiver": "text",
    "delegate_hash": "text",
    "delegate_timestamp": 1,
    "reclaim_hash": "text",
    "reclaim_timestamp": 1,
    "pay_amount_sun": 1,
    "activate_amount_sun": 1,
    "quantity": 1,
    "staked_sun": 1,
    "duration": 1,
    "expired_timestamp": 1,
    "status": "PAYMENT_SUCCESS",
    "activate_status": "DEACTIVATE",
    "confirm_status": "UNCONFIRMED",
    "balance": 1
  }
}

See API Error Codes and Handling for error meanings, common causes, and retry guidance.

Key API: Create Order (POST /v1/order)

When creating an order via CatFee.IO’s API, please pay special attention to the following return values:

id (Payment Hash / Order ID):

  • A unique identifier for each order.

  • You can retrieve the order details using the GET /v1/order/{id} endpoint.

status (Order Status):

  • Reflects the execution progress of the order.

  • Normal values are PAYMENT_SUCCESS and DELEGATE_SUCCESS; treat all other statuses as failure.

  • If status is DELEGATE_SUCCESS, the energy delegation has been successfully submitted to the TRON blockchain.

Submission is not on-chain confirmation. Check confirm_status before treating the delegation as delivered.

confirm_status (On-Chain Confirmation Status):

  • Confirms whether energy has been successfully delivered to the target address.

  • Normal values are UNCONFIRMED and DELEGATION_CONFIRMED; treat all other values as failure.

  • If confirm_status is DELEGATION_CONFIRMED, the energy has been successfully sent and confirmed on-chain.

client_order_id (Client-defined Order ID):

balance (Current User Balance):

  • An integer in SUN (1 TRX = 1,000,000 SUN).

  • Included in order creation (including idempotent responses), order details, and early reclaim responses. It represents the user's current balance, not the order amount or a historical balance snapshot.

For time-based rentals, status remains DELEGATE_SUCCESS during and after reclamation, and reclamation confirmation states are returned as confirm_status=DELEGATION_CONFIRMED. These values record successful delegation, not current energy availability. See Order Details for the full status values and mapping rules.


❓How to Ensure Energy Has Been Successfully Sent?

You can confirm energy delivery through two methods:

1. Query the energy balance of the target address via TRON API:

Use the official TRON API or wallet tools (e.g., TronLink) to check the energy balance of the target address.

Sample API Request (TRON Official Endpoint):

Check fields such as energy_limit and energy_used in the response.

2. Check the confirm_status of the order:

Use GET /v1/order/{id} to retrieve order details.

If confirm_status is DELEGATION_CONFIRMED, the energy has been successfully confirmed on-chain.


Example Workflow

1. Create Order

Request:

Response:

2. Query Order Status

Request:

Response:

3. Confirm Successful Energy Transfer

If confirm_status is DELEGATION_CONFIRMED, energy has been successfully sent.

You may also use the TRON API to verify the target address’s energy balance.


FAQs

Q: Order status is DELEGATE_SUCCESS but energy hasn’t arrived?

  • Reason: DELEGATE_SUCCESS means the transaction was submitted, not necessarily confirmed. Time-based rental orders also retain this value after expiry or reclamation.

  • Solution: Check confirm_status. If delegation is confirmed but no energy is available, also check the expiry time, reclamation details, and on-chain resource balance.

Q: Energy arrival is delayed?

  • Reason: Potential TRON network congestion.

  • Solution: Ensure confirm_status is DELEGATION_CONFIRMED. This confirms energy delivery.


By tracking the id and confirm_status values and using on-chain validation, you can ensure energy transfers are reliable. If you still have questions, please contact CatFee customer support: @CatFee_James

Last updated