List invoices
curl --request GET \
--url https://console.perfgrid.com/api/v1/invoices \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.perfgrid.com/api/v1/invoices"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://console.perfgrid.com/api/v1/invoices', 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://console.perfgrid.com/api/v1/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://console.perfgrid.com/api/v1/invoices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://console.perfgrid.com/api/v1/invoices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.perfgrid.com/api/v1/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"type": "invoice",
"status": "unpaid",
"is_overdue": true,
"reference": "<string>",
"number": "<string>",
"proforma_number": "<string>",
"currency": "<string>",
"net": "<string>",
"credit": "<string>",
"subtotal": "<string>",
"tax": "<string>",
"total": "<string>",
"paid": "<string>",
"amount_due": "<string>",
"payment_in_progress": true,
"issue_date": "<string>",
"due_date": "<string>",
"tax_point_date": "<string>",
"paid_at": "<string>",
"canceled_at": "<string>",
"eur": {
"rate": "<string>",
"rate_date": "<string>",
"subtotal": "<string>",
"tax": "<string>",
"total": "<string>"
},
"notes": "<string>",
"links": {
"pdf": "<string>"
},
"lines": [
{
"description": "<string>",
"details": "<string>",
"period_start": "<string>",
"period_end": "<string>",
"quantity": "<string>",
"unit_price": "<string>",
"discount": "<string>",
"net": "<string>",
"tax_scheme": "domestic",
"tax_country": "<string>",
"tax_rate": "<string>"
}
],
"tax_totals": [
{
"tax_scheme": "domestic",
"tax_country": "<string>",
"tax_rate": "<string>",
"taxable": "<string>",
"tax": "<string>"
}
],
"payments": [
{
"id": "<string>",
"method": "bank_transfer",
"amount": "<string>",
"paid_at": "<string>"
}
],
"credit_notes": [
{
"id": "<string>",
"number": "<string>",
"total": "<string>",
"issue_date": "<string>"
}
]
}
],
"links": {
"first": "<string>",
"last": "<string>",
"prev": "<string>",
"next": "<string>"
},
"meta": {
"path": "<string>",
"per_page": 1,
"next_cursor": "<string>",
"prev_cursor": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Invoices
List invoices
The billing account’s proformas and invoices, newest first. Needs
billing.view.
GET
/
invoices
List invoices
curl --request GET \
--url https://console.perfgrid.com/api/v1/invoices \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.perfgrid.com/api/v1/invoices"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://console.perfgrid.com/api/v1/invoices', 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://console.perfgrid.com/api/v1/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://console.perfgrid.com/api/v1/invoices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://console.perfgrid.com/api/v1/invoices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.perfgrid.com/api/v1/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"type": "invoice",
"status": "unpaid",
"is_overdue": true,
"reference": "<string>",
"number": "<string>",
"proforma_number": "<string>",
"currency": "<string>",
"net": "<string>",
"credit": "<string>",
"subtotal": "<string>",
"tax": "<string>",
"total": "<string>",
"paid": "<string>",
"amount_due": "<string>",
"payment_in_progress": true,
"issue_date": "<string>",
"due_date": "<string>",
"tax_point_date": "<string>",
"paid_at": "<string>",
"canceled_at": "<string>",
"eur": {
"rate": "<string>",
"rate_date": "<string>",
"subtotal": "<string>",
"tax": "<string>",
"total": "<string>"
},
"notes": "<string>",
"links": {
"pdf": "<string>"
},
"lines": [
{
"description": "<string>",
"details": "<string>",
"period_start": "<string>",
"period_end": "<string>",
"quantity": "<string>",
"unit_price": "<string>",
"discount": "<string>",
"net": "<string>",
"tax_scheme": "domestic",
"tax_country": "<string>",
"tax_rate": "<string>"
}
],
"tax_totals": [
{
"tax_scheme": "domestic",
"tax_country": "<string>",
"tax_rate": "<string>",
"taxable": "<string>",
"tax": "<string>"
}
],
"payments": [
{
"id": "<string>",
"method": "bank_transfer",
"amount": "<string>",
"paid_at": "<string>"
}
],
"credit_notes": [
{
"id": "<string>",
"number": "<string>",
"total": "<string>",
"issue_date": "<string>"
}
]
}
],
"links": {
"first": "<string>",
"last": "<string>",
"prev": "<string>",
"next": "<string>"
},
"meta": {
"path": "<string>",
"per_page": 1,
"next_cursor": "<string>",
"prev_cursor": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
An API token from API tokens in the console, sent as Authorization: Bearer pgapi_.... It works for one billing account, and its permissions decide which endpoints it may call.
Query Parameters
Only invoices with this status.
Where an invoice is in its life. unpaid and canceled invoices are proformas, without an invoice number; a paid one is a numbered VAT invoice. A held one is a proforma paid in full whose reverse-charge VAT invoice waits for the EU's VIES service to confirm the VAT number again: settled, but not issued yet. A paid invoice stays paid when it is credited: its credit notes say how much.
Available options:
unpaid, paid, canceled, held proforma (no invoice number yet) or invoice.
Available options:
proforma, invoice, null