Admin API REST API: V0 Billing Invoices | Quicknode
v0/billing/invoices REST API Endpoint
Returns a list of invoices
Parameters
This method does not accept any parameters
Returns
data
object
The data object which contains the following fields:
- invoices
- array
- An array of invoices
- id
- string
- The unique identifier for the invoice
- string
- status
- string
- The current state of the invoice
- string
- billing_reason
- string
- The reason for generating the invoice
- string
- amount_due
- integer
- The total amount that is due on the invoice
- integer
- amount_paid
- integer
- The total amount that has been paid for the invoice
- integer
- subtotal
- integer
- The total cost of the invoice
- integer
- lines
- array
- An array of lines which contains the following fields:
- description
- string
- A detailed description of each line item billed
- string
- amount
- integer
- The cost associated with each line item
- integer
- period_end
- integer
- The end timestamp of the billing period for the invoice in second
- integer
- period_start
- integer
- The start timestamp of the billing period for the invoice in second
- integer
- created
- integer
- The timestamp when the invoice was created in second
- integer
- error
- string
- An error message if any issue occurs
- string
- description
- An array of lines which contains the following fields:
- array
- array
Request
Curl Example
curl -X 'GET' \
'https://api.quicknode.com/v0/billing/invoices' \
-H 'accept: application/json' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript Example
const myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("x-api-key", "YOUR_API_KEY");
const requestOptions = {
method: "GET",
headers: myHeaders,
redirect: "follow"
};
fetch("https://api.quicknode.com/v0/billing/invoices", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
Python Example
import requests
url = "https://api.quicknode.com/v0/billing/invoices"
payload = {}
headers = {
'accept': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Ruby Example
require "uri"
require "net/http"
url = URI("https://api.quicknode.com/v0/billing/invoices")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["x-api-key"] = "YOUR_API_KEY"
response = https.request(request)
puts response.read_body
Rust Example
use quicknode_sdk::{QuicknodeSdk, SdkFullConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let qn = QuicknodeSdk::new(&SdkFullConfig::builder().api_key("YOUR_API_KEY").build())?;
let response = qn.admin.list_invoices().await?;
println!("{:?}", response);
Ok(())
}