Pedidos
Obter pedido
Verifique o status de um pedido de energia ou largura de banda por ID
GET
/
api
/
v1
/
orders
/
{order_id}
Obter pedido
curl --request GET \
--url https://api.example.com/api/v1/orders/{order_id}import requests
url = "https://api.example.com/api/v1/orders/{order_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/orders/{order_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/orders/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/orders/{order_id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/orders/{order_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/orders/{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyObter pedido
Retorna o status atual e os detalhes completos de um pedido de energia ou largura de banda.Parâmetros de caminho
number
obrigatório
ID do pedido — o
id retornado por Buy Energy ou Buy Bandwidth.Resposta
Retorna o objeto completo do pedido, incluindostatus, type, volume, price_trx, delegate_txid e carimbos de data/hora.
Status do pedido
| Status | Descrição |
|---|---|
pending | Pedido recebido, delegação em andamento |
filled | Energia ou largura de banda delegada com sucesso |
failed | A delegação falhou |
reclaimed | Largura de banda devolvida após o período de aluguel (apenas pedidos de largura de banda) |
Exemplo
curl https://api.tronrental.com/v1/orders/12345 \
-H "X-API-Key: your_api_key"
Response
{
"id": 12345,
"type": "energy",
"target_address": "TRecipientAddress...",
"volume": 65000,
"duration": "1h",
"price_trx": "1.79",
"status": "filled",
"delegate_txid": "a1b2c3d4e5f6...",
"undelegate_txid": null,
"reclaim_at": null,
"source": "api",
"created_at": "2026-06-10T04:30:00Z"
}
⌘I
Obter pedido
curl --request GET \
--url https://api.example.com/api/v1/orders/{order_id}import requests
url = "https://api.example.com/api/v1/orders/{order_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/orders/{order_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/orders/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/orders/{order_id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/orders/{order_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/orders/{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body