Get one order details

To use this feature you must have the API key. Read here to view how to get our API key

Get one order details by API key

GET https://api.tronsave.io/v0/orders/:id

{
    id: string, // id of order
    requester: string, // the address represent for order owner
    target: string, // the address that is received resource 
    resource_amount: number, // the amount of resource
    resource_type: string, // the amount type is "ENERGY"
    remain_amount: number, // the remain amount can matching by system
    price: number, // price unit is equal to sun
    duration: number, // rent duration, duration unit is equal to second
    allow_partial_fill: boolean, //Allow the order to be filled partially or not
    payout_amount: number, // Total payout of this order
    fulfilled_percent: number, //The percent that show filling processing. 0-100
    matched_delegates:{ //All matched delegate for this order
       delegator:string // The address that delegate resource for target address
       amount: number //The amount of resource was delegated
       txid: number // The transaction id in onchain 
     }[]
}

Example

Example Code

const GetOneOrderDetails = async (api_key, order_id) => {
    const url = `https://api.tronsave.io/v0/orders/${order_id}`
    const data = await fetch(url, {
        headers: {
            'apikey': api_key
        }
    })
    const response = await data.json()
    /**
     * Example response 
     * @link https://docs.tronsave.io/buy-energy-on-telegram/using-api-key-to/get-internal-account-order-history
        {
            "id": "651d2306e55c073f6ca0992e",
            "requester": "TKVSaJQDWeKFSEXmA44pjxduGTxy999999",
            "target": "TKVSaJQDWeKFSEXmA44pjxduGTxy999999",
            "resource_amount": 100000,
            "resource_type": "ENERGY",
            "remain_amount": 0,
            "price": 67.5,
            "duration": 3600,
            "allow_partial_fill": true,
            "payout_amount": 6750000,
            "fulfilled_percent": 100,
            "matched_delegates": [
                        {
                            "delegator": "TKVSaJQDWeKFSEXmA44pjxduGTxy888888",
                            "amount": 100000,
                            "txid": "transaction_id_1"
                        }
                    ]
        }
     */
    return response
}

Last updated