API REFERENCE

Invoices API

Invoices come out of AlgaPSA billing runs, or you write them by hand. Use this API to read invoices, generate them from recurring templates, record payments and credits, and move each one through approve, finalize, and send.

The lifecycle

An invoice goes from draft to approved to finalized, then out to the client. Each step is its own call: POST /api/v1/invoices/{id}/approve, then /finalize, then /send. Gate any of them behind your own checks. Once an invoice is finalized, record money against it with /payment and /credit.

Recurring and manual

Most invoices come from recurring templates. Manage those under /api/v1/invoices/recurring, check the next run with POST /api/v1/invoices/preview, then commit it with POST /api/v1/invoices/generate. For a one-off, POST /api/v1/invoices/manual writes a single invoice directly.

Read and export

GET /api/v1/invoices lists and filters; /api/v1/invoices/search runs a text query; /api/v1/invoices/analytics and /api/v1/invoices/export feed reporting. Line items and ledger entries sit under {id}/items and {id}/transactions.

Deleting draft invoices

DELETE /api/v1/invoices/{id} permanently removes a draft invoice and releases any underlying service periods, time entries, or usage records back to un-invoiced state. The endpoint enforces these rules:

  • 204 No Content — the invoice was a draft with no recorded payments and has been deleted.
  • 409 Conflict — the invoice cannot be deleted. The response body carries a human-readable reason: “Only draft invoices can be deleted; void the invoice instead.” when the invoice is finalized or in any non-draft status, or “Invoices with recorded payments cannot be deleted.” when at least one payment row exists against it.
  • 404 Not Found — no invoice with that ID exists for the tenant.

Recurring drafts that are deleted also release their associated service period back to billable state, so the period can be re-invoiced on the next billing run. A finalized invoice cannot be deleted through the API; void it from the billing UI instead.

PDF download

GET /api/v1/invoices/{id}/pdf and POST /api/v1/invoices/{id}/pdf both stream the rendered invoice as an application/pdf binary with a Content-Disposition: attachment header. Both methods return the same binary response. The caller must hold the invoice:read permission.

Endpoints

Every endpoint links through to its full parameters, request and response schemas, and code samples.

GET/api/v1/invoicesAlgaPSAList invoicesPOST/api/v1/invoicesAlgaPSACreate invoiceGET/api/v1/invoices/{id}AlgaPSAGet invoice by idPUT/api/v1/invoices/{id}AlgaPSAUpdate invoiceDELETE/api/v1/invoices/{id}AlgaPSADelete invoicePOST/api/v1/invoices/{id}/approveAlgaPSAApprove invoicePOST/api/v1/invoices/{id}/creditAlgaPSAApply credit to invoicePOST/api/v1/invoices/{id}/duplicateAlgaPSADuplicate invoicePOST/api/v1/invoices/{id}/finalizeAlgaPSAFinalize invoiceGET/api/v1/invoices/{id}/historyAlgaPSAGet invoice lifecycle historyGET/api/v1/invoices/{id}/itemsAlgaPSAList invoice itemsPOST/api/v1/invoices/{id}/paymentAlgaPSARecord invoice paymentGET/api/v1/invoices/{id}/pdfAlgaPSADownload invoice PDFPOST/api/v1/invoices/{id}/pdfAlgaPSAGenerate and download invoice PDFPOST/api/v1/invoices/{id}/rejectAlgaPSAReject invoicePOST/api/v1/invoices/{id}/sendAlgaPSASend invoicePOST/api/v1/invoices/{id}/taxAlgaPSACalculate invoice taxGET/api/v1/invoices/{id}/transactionsAlgaPSAList invoice transactionsGET/api/v1/invoices/analyticsAlgaPSAGet invoice analyticsPOST/api/v1/invoices/bulkAlgaPSABulk update invoice statusPOST/api/v1/invoices/bulk/creditAlgaPSABulk apply invoice creditsPOST/api/v1/invoices/bulk/deleteAlgaPSABulk delete invoicesPOST/api/v1/invoices/bulk/sendAlgaPSABulk send invoicesGET/api/v1/invoices/exportAlgaPSAExport invoicesPOST/api/v1/invoices/generateAlgaPSAGenerate recurring invoicePOST/api/v1/invoices/manualAlgaPSACreate manual invoicePOST/api/v1/invoices/previewAlgaPSAPreview recurring invoiceGET/api/v1/invoices/recurringAlgaPSAList recurring invoice templatesPOST/api/v1/invoices/recurringAlgaPSACreate recurring invoice templatePUT/api/v1/invoices/recurring/{id}AlgaPSAUpdate recurring invoice templateDELETE/api/v1/invoices/recurring/{id}AlgaPSADelete recurring invoice templateGET/api/v1/invoices/searchAlgaPSASearch invoices