List invoices
curl --request GET \
--url https://api.togai.com/invoices \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.togai.com/invoices"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.togai.com/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://api.togai.com/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://api.togai.com/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://api.togai.com/invoices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/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": "inv.hkgkgyh.ghg",
"customerId": "7VcRw9xZDIqsC5E",
"ownerId": "ACC001",
"invoiceClass": "INVOICE",
"invoiceType": "AD_HOC",
"status": "DUE",
"finalizingStatus": "FINALIZED",
"totalAmount": 100,
"paidAmount": 0,
"startDate": "2020-07-04T12:00:00.000Z",
"endDate": "2020-07-04T12:00:00.000Z",
"invoiceDate": "2020-07-04T12:00:00.000Z",
"generatedAt": "2020-07-04T12:00:00.000Z",
"updatedAt": "2020-07-04T12:00:00.000Z"
}
],
"nextToken": "eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ=="
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<Reason message>"
}Invoices
List invoices
List invoices
GET
/
invoices
List invoices
curl --request GET \
--url https://api.togai.com/invoices \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.togai.com/invoices"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.togai.com/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://api.togai.com/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://api.togai.com/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://api.togai.com/invoices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/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": "inv.hkgkgyh.ghg",
"customerId": "7VcRw9xZDIqsC5E",
"ownerId": "ACC001",
"invoiceClass": "INVOICE",
"invoiceType": "AD_HOC",
"status": "DUE",
"finalizingStatus": "FINALIZED",
"totalAmount": 100,
"paidAmount": 0,
"startDate": "2020-07-04T12:00:00.000Z",
"endDate": "2020-07-04T12:00:00.000Z",
"invoiceDate": "2020-07-04T12:00:00.000Z",
"generatedAt": "2020-07-04T12:00:00.000Z",
"updatedAt": "2020-07-04T12:00:00.000Z"
}
],
"nextToken": "eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ=="
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<Reason message>"
}Query Parameters
Query Parameters
enum
Status of the invoice (`DRAFT`, `DUE`, `PAID`, `VOID`, `UN_COLLECTIBLE`, `INITIATE_REFUND`, `REFUND_COMPLETED`, `MERGED`)
enum
Class to which the invoice is categorized (`INVOICE`, `ORDER`, `BILLABLE`)
string
Unique identifier of the owner associated with the invoice
string
Date of the invoice
string
Unique identifier of the customer associated with the invoice
string
Unique identifier of the price plan associated with the invoice
string
Start date of the invoice
string
End date of the invoice
Filterable Fields
Filterable Fields
string
string
string
string
string
string
string
string
Allowed filter combinations
statusclassclass,owner_idstatus,owner_idstatus,classstatus,class,owner_idstatus,invoice_dateclass,invoice_datestatus,invoice_date,customer_idclass,invoice_date,customer_idstatus,invoice_date,customer_id,owner_idclass,invoice_date,customer_id,owner_idowner_idowner_id,price_plan_idowner_id,price_plan_id,start_dateowner_id,price_plan_id,start_date,end_date
Searchable Fields
Searchable Fields
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Pagination token used as a marker to get records from next page.
Example:
"eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ=="
Filter option to filter by status.
Filter option to filter based on owner id.
Example:
"ACC001"
Filter option to filter based on customer id.
Example:
"1234"
Maximum page size expected by client to return the record list.
NOTE: Max page size cannot be more than 50. Also 50 is the default page size if no value is provided.
Example:
10
Start time filter in epoch milli seconds
Example:
1650110402000
End time filter in epoch milli seconds
Example:
1650110402000
