Tron API En
Chinese API
  • Basic information
  • Tron API
    • Get related configuration
    • Pre-order
    • create trx engerg order
    • create usdt engerg order
    • create bandwidth order
    • upload purchase order hash
    • create a sell order
    • Earn energy by stake
    • recovered energy
    • cancel order
    • query purchase order
    • query recent finished order
    • query purchase order records by user address
    • query sell order records by user address
  • Seller Tron API
    • Get seller configuration
    • Seller authorization
    • Update seller configuration
    • Get seller panel
  • Buyer Tron API
    • Get buyer configuration
    • Buyer charge
    • Buyer withdraw
    • Buyer leas energy
    • Buyer leas energy records
    • Buyer asset records
  • FAQ
    • Error Code
Powered by GitBook
On this page
  • code example
  • Postman example
  1. Buyer Tron API

Buyer leas energy

The same as "create purchase order"

POST https://open.tronify.io/api/tronRent/addTronRentRecord

Headers

Name
Type
Description

api-key*

String

Access the buyer management platform of tronify.io to obtain it. tradeType must be provided when it is userTrade.

Request Body

Name
Type
Description

fromAddress*

String

user address(wallet address for buyer)

sourceFlag*

String

Source channel (Both sides need to agree on a name to represent the channel of the third parties)

pledgeNum*

String

amount of energy

orderType*

String

ENERGY

pledgeHour*

String

an integer value should be passed to indicate the number of hours for which the energy is frozen. Currently, only 0, 1, and 3 are supported.

pledgeDay*

String

an integer value should be passed to indicate the number of days for which the energy is frozen (e.g. 0, 1, 2, 3).

tradeType*

String

userTrade

pledgeAddress*

String

energy/bandwidth receiving address. multiple addresses can be submitted for bulk leas energy by separating them with commas.

pledgeMinute*

String

only 0, 10 are supported.

{
    "resCode": 100,
    "resMsg": "Success",
    "data": {
        "orderId": "16zi4ynw_sdvn_qv8h_ujfc_crfsgyi07zat",
        "fromAddress": "TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k",//wallet address
        "pledgeAddress": "TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k",//energy recieving address
        "pledgeDay": 3,
        "source": "tronLink",
        "orderType": "ENERGY",
        "orderPrice": 110,
        "pledgeNum": 500,
        "pledgeTrxNum": 0.165
    }
}

code example

// example
const params = {
    fromAddress: 'TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k',
    pledgeAddress: 'TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k',
    pledgeDay: 3,
    pledgeHour: 0,
    pledgeMinute: 0,
    orderType: 'ENERGY',
    pledgeNum: 500,
    sourceFlag: 'tronLink',
    tradeType: 'userTrade'
}
const headers = {
  'api-key': 'your-api-key'
};
 const res = await axios.post('https://open.tronify.io/api/tronRent/addTronRentRecord',params, { headers })
 console.log(res)
 if(res.resCode === '100'){
   //...  
 }

Postman example

PreviousBuyer withdrawNextBuyer leas energy records

Last updated 1 year ago