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
  • Endpoint usage
  • code example
  • Postman example
  1. Tron API

create a sell order

create a energy/bandwidth sell order

Endpoint usage

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

The fields with * are required, and the fields without * are optional

Request Body

Name
Type
Description

relateOrderId*

String

purchase order Id

saleAddress*

String

user address(wallet address for seller)

sourceFlag*

String

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

buyPledgeNum*

String

amount of eneger/bandwidth

payTrxAddress*

String

trx recieving address

{
    "resCode": 100,
    "resMsg": "Success",
    "data": {
        "orderId": "82gaugby_r7oh_ki1y_f2ma_ltelk84hivte",
        "relateOrderId": "3j354cx4_a4to_hbck_3amx_zrc0zh51dfkg",
        "transaction": {
            "visible": false,
            "txID": "14fc0e21c3be5889bb413c2406b184df724ce0cefa239adf1e3ed8368e39d741",
            "raw_data": {
                "contract": [
                    {
                        "parameter": {
                            "value": {
                                "balance": 301000000,
                                "resource": "ENERGY",
                                "receiver_address": "41242e5341ccd7d16af9e3a3b1c5cb07794f596609",
                                "lock": true,
                                "owner_address": "41dcf5a07cfac1534c2410714d6ba6576f49c4a6d7"
                            },
                            "type_url": "type.googleapis.com/protocol.DelegateResourceContract"
                        },
                        "type": "DelegateResourceContract"
                    }
                ],
                "ref_block_bytes": "141a",
                "ref_block_hash": "b29ae11706ac4963",
                "expiration": 1682213709000,
                "timestamp": 1682213651693
            },
            "raw_data_hex": "0a02141a2208b29ae11706ac496340c8c980defa305a75083912710a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e44656c65676174655265736f75726365436f6e747261637412380a1541dcf5a07cfac1534c2410714d6ba6576f49c4a6d7100118c0cac38f01221541242e5341ccd7d16af9e3a3b1c5cb07794f596609280170ed89fdddfa30"
        }
    }
}
{
    // Response
}

code example

// example
const params = {
    relateOrderId: 'mt1wxcl1_dplo_r0qp_5bho_w5an5hev6d70',
    saleAddress: 'TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k',
    payTrxAddress: 'TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k',
    buyPledgeNum: 600,
    sourceFlag: 'tronLink'
}
 const res = await axios.post('https://open.tronify.io/api/tronRent/addTronSale',params)
 console.log(res)
 if(res.resCode === '100'){
    const signedTx = await tronWeb.trx.sign(res.data.transaction)
    const broastTx = await tronWeb.trx.sendRawTransaction(signedTx)
    return broastTx.txid 
 }

Postman example

Previousupload purchase order hashNextEarn energy by stake

Last updated 1 year ago