Show billing history
To show the billing history of your customers on your website, you can use the Billing API. This will allow you to display your customer's invoices and credit notes history.
To retrieve invoices from one of your customers, you can use a GET call to the /invoices endpoint, using its filtering capabilities. In this example, we are filtering using the contact ID. Refer to the API docs for more filters.
curl --request GET
--url https://ACCOUNT_NAME.sandbox-quadernoapp.com/api/invoices?contact=572929 \
--header 'Authorization: Basic API_KEY' \
You will receive a response containing a paginated list of invoices. Here is an extract of the most useful fields to display a summary to your customers:
[
{
"id": 153267,
"number": "00001",
"issue_date": "2023-06-01",
"currency": "USD",
"total_cents": "990",
"state": "paid",
"permalink": "https://ACCOUNT_NAME.sandbox-quadernoapp.com/invoice/dd9e8cbb7cc5f4c"
},
{ … }
]
If you want to show the taxes information, you'll find it inside items[].taxes[]
.
To retrieve credit notes, just make a GET call to /credits.
In both cases, the response will be an array that is paginated, returning 25 documents per page by default. To learn how to iterate any remaining documents, please refer to the pagination guide.