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

Last updated