Skip to content
TriedDocs
Account

Get invoice HTML

Download a printable HTML version of an invoice.

GEThttps://api.tried.com.au/billing/invoices/{id}/html

Returns an invoice as a printable HTML page. Open it in a browser and print or save it as PDF. Any role can call it.

Request#

Field Type Required Description
id string Yes The invoice_id, prefix inv_.

Example request#

curl https://api.tried.com.au/billing/invoices/inv_3d5f7a9c1e3b5d7f9a1c3e5b/html \
  -H "Authorization: Bearer $TRIED_API_KEY"
const res = await fetch("https://api.tried.com.au/billing/invoices/inv_3d5f7a9c1e3b5d7f9a1c3e5b/html", {
  headers: { Authorization: `Bearer ${process.env.TRIED_API_KEY}` },
});
const html = await res.text();
import os, requests

res = requests.get(
    "https://api.tried.com.au/billing/invoices/inv_3d5f7a9c1e3b5d7f9a1c3e5b/html",
    headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
)
html = res.text

Response#

200 OK with Content-Type: text/html and Content-Disposition: inline; filename="<number>.html".

The page shows the invoice number, date, status, workspace name and ID, the billing period for usage invoices, each line item, the total, and the payment provider with its reference.

Errors#

Status When
401 Missing or invalid API key.
403 The key's IP allowlist or scopes reject the request. This route needs the agents scope (the path contains invoices, which matches the voice scope rule), or a key with admin.
404 Invoice not found.
429 Rate limit exceeded. See Rate limits.

See Errors for the body format.