API
SDKs
Ready-made libraries for calling the API from TypeScript / JavaScript, Python, Go, PHP, Ruby and Rust. Each one covers the whole API, retries failed requests for you, and checks webhook signatures. They all behave the same way: the same methods, errors and retries.
Which key?
TypeScript / JavaScript
@invoist/sdk on npm. Node 22 or newer, Bun, Deno, or any runtime with fetch. Source and full README on GitHub.
npm install @invoist/sdkimport { Invoist } from "@invoist/sdk";
const invoist = new Invoist({ apiKey: process.env.INVOIST_API_KEY! });
const { extraction } = await invoist.extractAndWait("invoice.pdf");
console.log(extraction.vendor_name, extraction.total_cents, extraction.currency);const unpaid = await invoist.bills.list({ paid: false });
for (const bill of unpaid) console.log(bill.vendor_name, bill.total_cents, bill.due_date);Python
invoist on PyPI. Python 3.11 or newer; sync and async clients. Source and full README on GitHub.
pip install invoistimport os
from pathlib import Path
from invoist import Invoist
invoist = Invoist(os.environ["INVOIST_API_KEY"])
result = invoist.extract_and_wait(Path("invoice.pdf"))
print(result.extraction.vendor_name, result.extraction.total_cents)for bill in invoist.bills.list(paid=False):
print(bill.vendor_name, bill.total_cents, bill.due_date)Go
github.com/invoisthq/invoist-go on Go modules. Go 1.26 or newer; no dependencies. Source and full README on GitHub.
go get github.com/invoisthq/invoist-goclient, err := invoist.New(os.Getenv("INVOIST_API_KEY"))
if err != nil {
log.Fatal(err)
}
file, _ := invoist.FileFromPath("invoice.pdf")
result, err := client.ExtractAndWait(ctx, file, nil)bills, err := client.Bills.List(ctx, &invoist.ListBillsParams{Paid: new(false)})PHP
invoist/invoist on Packagist. PHP 8.3 or newer with curl, or any PSR-18 client. Source and full README on GitHub.
composer require invoist/invoistuse Invoist\Invoist;
use Invoist\Upload;
$invoist = new Invoist(getenv('INVOIST_API_KEY'));
$result = $invoist->extractAndWait(Upload::fromPath('invoice.pdf'));
echo $result->extraction->vendor_name;foreach ($invoist->bills->list(paid: false) as $bill) {
echo "$bill->vendor_name: $bill->total_cents, due $bill->due_date\n";
}Ruby
invoist on RubyGems. Ruby 3.3 or newer; no dependencies. Source and full README on GitHub, and every class and method on RubyDoc.
bundle add invoistrequire "invoist"
client = Invoist::Client.new(api_key: ENV.fetch("INVOIST_API_KEY"))
result = client.extract_and_wait("invoice.pdf")
puts result.extraction.vendor_nameclient.bills.list(paid: false).each do |bill|
puts "#{bill.vendor_name}: #{bill.total_cents}, due #{bill.due_date}"
endRust
invoist on crates.io. Rust 1.88 or newer; async, with an optional blocking client. Source and full README on GitHub, and every class and method on docs.rs.
cargo add invoistlet client = invoist::Client::new(std::env::var("INVOIST_API_KEY").unwrap_or_default())?;
let file = invoist::UploadFile::from_path("invoice.pdf").expect("readable file");
let done = client.extract_and_wait(file, invoist::WaitOptions::default()).await?;
println!("{:?}", done.extraction.vendor_name);let unpaid = client
.bills()
.list(invoist::ListBillsParams { paid: Some(false), ..Default::default() })
.await?;Coming soon
Libraries for Java / Kotlin and C# / .NET are written and tested, and will be on Maven Central and NuGet shortly. Until then, call the API over HTTP: the API introduction shows how.
Another language
The whole API is described in one OpenAPI file, kept in step with the API at github.com/invoisthq/invoist-openapi. Tools such as OpenAPI Generator turn it into a client for most languages. To import it into Postman or another tool that takes a URL, use the file's own address:
https://raw.githubusercontent.com/invoisthq/invoist-openapi/main/openapi.yamlThe same everywhere
- Amounts are whole cents, never floating-point numbers.
- A failed request raises one error type with the HTTP status, a stable code and the request id. Codes are listed in Errors and limits.
- Connection failures, rate limits and server errors are retried twice, with a growing wait, or as long as the API asks (up to a minute).
- Webhooks are checked with one call, from the raw request body. See Webhooks.