curl --request GET \
--url https://app.synthetic.ai/api/v1/invoices \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.synthetic.ai/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://app.synthetic.ai/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://app.synthetic.ai/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://app.synthetic.ai/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://app.synthetic.ai/api/v1/invoices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.synthetic.ai/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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerName": "<string>",
"contractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"status": "DRAFT",
"notes": "<string>",
"approvedByUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approvedByUser": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"role": "ADMIN"
},
"approvedByApiKeyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approvedAt": "<string>",
"issuedAt": "<string>",
"dueAt": "<string>",
"paymentTermsDays": 0,
"lastPaidAt": "2023-11-07T05:31:56Z",
"paidAt": "2023-11-07T05:31:56Z",
"voidedAt": "<string>",
"periodStartAt": "2023-11-07T05:31:56Z",
"periodEndAt": "2023-11-07T05:31:56Z",
"lastSentAt": "<string>",
"deliveryMethod": "EMAIL",
"totalAmount": {
"value": 0,
"currencyCode": "USD"
},
"appliedAmount": {
"value": 0,
"currencyCode": "USD"
},
"pendingPaymentAmount": {
"value": 0,
"currencyCode": "USD"
},
"remainingAmount": {
"value": 0,
"currencyCode": "USD"
},
"lines": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoiceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contractBillableId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"billingStartAt": "2023-11-07T05:31:56Z",
"billingEndAt": "2023-11-07T05:31:56Z",
"amount": {
"value": 0,
"currencyCode": "USD"
},
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"hasMore": true,
"nextCursor": "<string>",
"prevCursor": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Input validation failed",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred.",
"issues": []
}List invoices
Lists invoices, oldest first unless orderBy asks for another order. Page with limit and the cursors from the previous page; hasMore says whether more rows lie in the direction being read. Keep the same filters and the same orderBy for the whole run. Needs a key holding invoices:read.
curl --request GET \
--url https://app.synthetic.ai/api/v1/invoices \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.synthetic.ai/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://app.synthetic.ai/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://app.synthetic.ai/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://app.synthetic.ai/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://app.synthetic.ai/api/v1/invoices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.synthetic.ai/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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerName": "<string>",
"contractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"status": "DRAFT",
"notes": "<string>",
"approvedByUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approvedByUser": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"role": "ADMIN"
},
"approvedByApiKeyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approvedAt": "<string>",
"issuedAt": "<string>",
"dueAt": "<string>",
"paymentTermsDays": 0,
"lastPaidAt": "2023-11-07T05:31:56Z",
"paidAt": "2023-11-07T05:31:56Z",
"voidedAt": "<string>",
"periodStartAt": "2023-11-07T05:31:56Z",
"periodEndAt": "2023-11-07T05:31:56Z",
"lastSentAt": "<string>",
"deliveryMethod": "EMAIL",
"totalAmount": {
"value": 0,
"currencyCode": "USD"
},
"appliedAmount": {
"value": 0,
"currencyCode": "USD"
},
"pendingPaymentAmount": {
"value": 0,
"currencyCode": "USD"
},
"remainingAmount": {
"value": 0,
"currencyCode": "USD"
},
"lines": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoiceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contractBillableId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"billingStartAt": "2023-11-07T05:31:56Z",
"billingEndAt": "2023-11-07T05:31:56Z",
"amount": {
"value": 0,
"currencyCode": "USD"
},
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"hasMore": true,
"nextCursor": "<string>",
"prevCursor": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Input validation failed",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred.",
"issues": []
}Authorizations
An API key created in Settings, sent as Authorization: Bearer <key>.
Query Parameters
Only this customer's invoices.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Only the invoices of these customers, separated by commas. With customerId as well, an invoice must match both.
Only this contract's invoices.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Only invoices whose status is one of these, separated by commas — for example DRAFT,APPROVED. The statuses are DRAFT, APPROVED, ISSUING, ISSUED, VOIDED. Leave it out for every status but VOIDED.
true for only the drafts waiting for a person to approve them. A new draft can take a day or more to be listed. false, or leaving it out, applies no filter.
Only invoices whose issuedAt, or periodStartAt while issuedAt is null, is at or after this time.
Only invoices whose issuedAt, or periodStartAt while issuedAt is null, is at or before this time.
Only issued invoices whose dueAt is at or after this time.
Only issued invoices whose dueAt is at or before this time.
Only invoices whose periodStartAt is at or after this time.
Only invoices whose periodStartAt is before this time.
Only issued invoices, whichever value is sent: true for those whose appliedAmount is less than totalAmount, false for the rest.
Only issued invoices, whichever value is sent: true for those whose appliedAmount is above 0, false for the rest.
Only issued invoices, whichever value is sent: true for those whose remainingAmount is above 0, false for the rest.
issuedAt:ASC or issuedAt:DESC. An invoice whose issuedAt is null is ordered by its periodStartAt. Omit it for the order Synthetic created the invoices in, oldest first.
The nextCursor of the previous page, to read the page after it.
1 - 1024^[A-Za-z0-9._-]+$The prevCursor of the previous page, to read the page before it.
1 - 1024^[A-Za-z0-9._-]+$Rows per page, 1 to 100.
1 <= x <= 100