API REFERENCE

Financial API

The financial endpoints cover the ledger: transactions, credits, invoice items, payment methods, reconciliation, and reports. Most calls operate on money already owed or paid, so run them after a client and its contracts exist.

Calculate before you charge

POST /api/v1/financial/billing/calculate returns what a client owes for a period without writing anything. Use it to preview a run, then commit through invoice and transaction endpoints. POST /api/v1/financial/tax/calculate does the same for tax, and GET /api/v1/financial/tax/rates lists the rates in effect.

Transactions and credits

Every money movement is a transaction. Post one with POST /api/v1/financial/transactions, read it back from GET /api/v1/financial/transactions/{id}, and amend it with PUT /api/v1/financial/transactions/{id}. Credits have their own flow: list balances with GET /api/v1/financial/credits, check headroom with POST /api/v1/financial/credits/validate, then apply, transfer between clients, or issue a prepayment invoice through /api/v1/financial/credits/apply, /api/v1/financial/credits/transfer, and /api/v1/financial/credits/prepayment.

curl
curl https://algapsa.com/api/v1/financial/credits/apply \
  -H "X-API-Key: $ALGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "cl_3f9a2c",
    "invoice_id": "inv_8821",
    "amount": 15000
  }'

Invoices, reconciliation, reports

Add a line with POST /api/v1/financial/invoices/{id}/items and lock the invoice with POST /api/v1/financial/invoices/{id}/finalize. Reconcile a period through POST /api/v1/financial/reconciliation/run and clear flagged items with POST /api/v1/financial/reconciliation/{id}/resolve. For read-only views, hit GET /api/v1/financial/reports/aging, /reports/balance, and /reports/analytics. The /api/v1/financial/bulk/* endpoints batch invoices, transactions, and credits when you need to move many records at once.

POST /api/v1/financial/bulk/invoices takes 1 to 50 invoice_ids and an operation of finalize or cancel. It runs each invoice through the same checks as the single-invoice endpoints. Finalizing requires the invoice finalize permission. Cancelling voids the invoice, and with a connected accounting integration it also requires permission to change records in that integration. Each invoice succeeds or fails on its own, and every result reports an outcome of finalized or voided. There is no bulk send or apply_credit. Send invoices one at a time, and apply credit with POST /api/v1/invoices/{id}/credit.

List invoices and payment methods

GET /api/v1/financial/invoices returns a paginated invoice list for the tenant. Narrow it with status (draft, sent, paid, overdue, and more), client_id, billing_cycle_id, a due-date or amount range, or has_credit_applied, and sort by fields like invoice_date or total_amount. GET /api/v1/financial/payment-methods lists the methods on file: filter by type (credit_card or bank_account), client_id, or is_default. Soft-deleted methods are left out unless you set exclude_deleted=false.

Endpoints

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

GET/api/v1/financialAlgaPSAFinancial API namespace rootPOST/api/v1/financial/billing/calculateAlgaPSACalculate client billing chargesGET/api/v1/financial/billing/payment-termsAlgaPSAList billing payment termsPOST/api/v1/financial/bulk/creditsAlgaPSARun bulk credit operationPOST/api/v1/financial/bulk/invoicesAlgaPSARun bulk invoice operationPOST/api/v1/financial/bulk/transactionsAlgaPSARun bulk transaction operationGET/api/v1/financial/creditsAlgaPSAList credit balances and recordsPOST/api/v1/financial/credits/applyAlgaPSAApply credit to invoicePOST/api/v1/financial/credits/prepaymentAlgaPSACreate prepayment invoicePOST/api/v1/financial/credits/transferAlgaPSATransfer credit between clientsPOST/api/v1/financial/credits/validateAlgaPSAValidate client credit balanceGET/api/v1/financial/invoicesAlgaPSAList invoicesPOST/api/v1/financial/invoices/{id}/finalizeAlgaPSAFinalize financial invoice (maps to generic update)POST/api/v1/financial/invoices/{id}/itemsAlgaPSAAdd financial invoice item (maps to generic create)GET/api/v1/financial/payment-methodsAlgaPSAList payment methodsPOST/api/v1/financial/payment-methodsAlgaPSACreate payment methodGET/api/v1/financial/payment-methods/{id}AlgaPSAGet payment method by id (transaction get wiring)PUT/api/v1/financial/payment-methods/{id}AlgaPSAUpdate payment method by id (transaction update wiring)DELETE/api/v1/financial/payment-methods/{id}AlgaPSADelete payment method by id (transaction delete wiring)GET/api/v1/financial/reports/agingAlgaPSAGet aging reportGET/api/v1/financial/reports/analyticsAlgaPSAGet financial analyticsGET/api/v1/financial/reports/balanceAlgaPSAGet account balance reportPOST/api/v1/financial/tax/calculateAlgaPSACalculate financial taxGET/api/v1/financial/tax/ratesAlgaPSAList tax ratesGET/api/v1/financial/transactionsAlgaPSAList financial transactionsPOST/api/v1/financial/transactionsAlgaPSACreate financial transactionGET/api/v1/financial/transactions/{id}AlgaPSAGet financial transaction by idPUT/api/v1/financial/transactions/{id}AlgaPSAUpdate financial transaction