Invoices
Get Invoice
Get invoice details by ID
GET
/
api
/
v1
/
invoices
/
{invoice_id}
Get Invoice
curl --request GET \
--url https://api.example.com/api/v1/invoices/{invoice_id}import requests
url = "https://api.example.com/api/v1/invoices/{invoice_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/invoices/{invoice_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/invoices/{invoice_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/invoices/{invoice_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/invoices/{invoice_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/invoices/{invoice_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_bodyGet Invoice
Returns details and current status of an invoice.Path parameters
Invoice ID
Response
Returns the full invoice object includingstatus, payment_address, price_trx, price_usdt, tx_hash, and timestamps.
Invoice statuses
| Status | Description |
|---|---|
pending | Waiting for payment |
paid | Payment received, delegation in progress |
delegated | Energy successfully delegated |
expired | No payment received before expiration |
failed | Delegation failed (payment refunded) |
Example
curl https://api.tronrental.com/v1/invoices/12345 \
-H "X-API-Key: your_api_key"
Response
{
"invoice_id": 12345,
"payment_address": "TPaymentAddress...",
"address": "TRecipientAddress...",
"energy_amount": 65000,
"duration_hours": 1,
"price_trx": "2.75",
"price_usdt": "0.64",
"status": "delegated",
"tx_hash": "a1b2c3d4e5f6...",
"paid_at": "2026-03-05T12:05:00Z",
"delegated_at": "2026-03-05T12:05:30Z",
"expires_at": "2026-03-05T12:30:00Z",
"created_at": "2026-03-05T12:00:00Z"
}
⌘I
Get Invoice
curl --request GET \
--url https://api.example.com/api/v1/invoices/{invoice_id}import requests
url = "https://api.example.com/api/v1/invoices/{invoice_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/invoices/{invoice_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/invoices/{invoice_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/invoices/{invoice_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/invoices/{invoice_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/invoices/{invoice_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