Reporting API

3 PracBill API endpoints for reporting. Base URL https://billing.pracbill.com.au/api.

Helpdesk response-time statistics since last Monday 07:00 for a fixed support-user list (users 115 and 275, default department 123 unless `department` is given). Intended for dashboard use. With debug=yes HTML debug output is echoed ahead of the JSON. An invalid or unknown API key returns HTTP 200 with the `ErrorResponse` envelope `{"success": false, "description": "invalid key"}`; the handler's other failures use the same envelope with a different `description`.

GET /{api_key}/getHelpdeskStats

Parameters

NameInTypeDescription
departmentqueryintegerDepartment id to report on (replaces the default department 123)
debugquerystringPass `yes` to enable debug output

Responses

  • 200 — Statistics retrieved successfully (failures: HTTP 200 with the ErrorResponse envelope)

Run a specific report. Report name and options vary by report type. Common reports: agedReceivables, invoiceListing, revenueSummary, customerBillingSummary, etc. May be long-running (no PHP time limit). An unknown report name redirects (HTTP 302) to /reports/index.php. An invalid or unknown API key returns HTTP 200 with the `ErrorResponse` envelope `{"success": false, "description": "invalid key"}`; the handler's other failures use the same envelope with a different `description`.

POST /{api_key}/report

Request body

FieldTypeDescription
report requiredstringReport class name (file in modules/reports/reports/), e.g. agedReceivables, invoiceListing, revenueSummary, customerBillingSummary, billedMinutes, newCustomerDetails, endedCustomerDetails
report_optionsobjectReport-specific options passed to the report's getData() (varies by report)

Responses

  • 200 — Report generated successfully (or invalid key / encoding error)
  • 302 — Unknown report name: redirected to the reports index

Total invoiced in a date range, excluding void invoices and invoices of type `phone`. An invalid or unknown API key returns HTTP 200 with the `ErrorResponse` envelope `{"success": false, "description": "invalid key"}`; the handler's other failures use the same envelope with a different `description`.

GET /{api_key}/sales_summary/{date_from}/{date_to}

Responses

  • 200 — Sales total (failures: HTTP 200 with the ErrorResponse envelope)

← All API groups