Invoicing API: Why you need one and how to choose it
Christian Barra
What is an invoicing API?
If you need to create a single invoice you might start with a simple spreadsheet, or a Google Doc.
But what if you have to create lots of invoices, you have more complex workflows or you need custom reports?
That's where an invoicing API might be handy.
An invoicing API helps you create and track invoices at scale.
Things to consider when integrating with an Invoicing API
Correctness
This is often overlooked, but are the numbers displayed and stored correctly? Do they use decimals or floats?
How is the rounding done, how many digits are supported?
Though these might sound like technical details, the last thing that you want is to use an API where the invoice totals are wrong.
Flexible
The Invoicing API should fit your business operations, not the other way around.
Some good examples are discounts, tax support and a flexible line items system.
Compliance
The Invoicing API should generate locally compliant invoices. If you operate in Germany that could mean displaying the service period, or have the invoice translated in a specific language.
Taxes
Is the invoicing API tax aware?
That's an essential requirement as you will have to track taxes and pay them in case.
Different countries might have different requirements on how to display taxes. Some of them might require a separate entry for each of them.
Export and integrations
The whole idea behind using an API is to automate some of your workflows. But there must be easy way to export your invoices to PDF or CSV for auditing or control.
Even better? A direct integration with your account software or ERP.
UI for finance and operations
While developers work on low-level integration, Ops and finance people need an easy way to access data.
That's where an out-of-the-box UI will come in handy.
How Tresorbase can help
Tresorbase invoicing API ticks all the boxes. It's flexible, easy to integrate, tax aware and globally compliant.
This is how you can use our invoicing API to create an invoice:
import requests
api_url = "https://api.tresorbase.com/v0/receivables/invoices"
invoice = {
"customer": "01833248ddc8ca7dca42ba7c213a4c39",
"number": "JJG-2022-53",
"line_items": [
{
"description": "Parsley - 20grams",
"quantity": "2000",
"unit_of_measure": "unit",
"unit_price": "0.99",
"discount": {"value": "0", "type": "PERCENTAGE"},
"tax": {"rate": "19", "type": "VAT"},
},
],
"issued_on": "2022-09-01T10:42Z",
"due_on": "2022-09-30T10:42Z",
"currency": "EUR",
}
headers = {
"Authorization": "Bearer jBz5YiYwdiA1qZOQZguI4npwcoqEosiNm9OlsHXY8Jc",
"Tresorbase-Organization-Id": "0650aeefcb7c4a479a06c98bcb5051a2",
}
requests.post(
api_url,
data=invoice,
headers=headers
)
Want to learn more? Check the invoicing API product page.