Billruns API

8 PracBill API endpoints for billruns. Base URL https://billing.pracbill.com.au/api.

List bill runs. Only non-deleted bill runs belonging to the API token's department are returned. Results are ordered by start date, newest first.

GET /{api_key}/billruns

Responses

  • 200 — A page of bill runs

Create a bill run. Only the whitelisted fields are accepted; `deptid` is taken from the API token and `approved` cannot be set here — use `POST /{api_key}/billruns/{id}/approve`. `start_date` defaults to now.

POST /{api_key}/billruns

Request body

FieldTypeDescription
billrun_template_idintegerBill run template ID — must belong to the token's department. Required on create.
start_datestringStart of the billing period. Defaults to now on create.
end_datestringEnd of the billing period
completeintegerCompleted flag (0 or 1)
update_invoice_date_on_approvalintegerShift invoice date/due date forward on approval (0 or 1)
auto_approve_draft_invoice_datestringAuto-approve draft invoices after this date/time. Send an empty string to clear.

Responses

  • 200 — The created bill run

Fetch a single bill run. Fails when the bill run does not exist, is deleted, or belongs to another department.

GET /{api_key}/billruns/{id}

Responses

  • 200 — The bill run

Update a bill run. Only the whitelisted fields are accepted; supplying `approved` is rejected — use `POST /{api_key}/billruns/{id}/approve`.

POST /{api_key}/billruns/{id}

Request body

FieldTypeDescription
billrun_template_idintegerBill run template ID — must belong to the token's department. Required on create.
start_datestringStart of the billing period. Defaults to now on create.
end_datestringEnd of the billing period
completeintegerCompleted flag (0 or 1)
update_invoice_date_on_approvalintegerShift invoice date/due date forward on approval (0 or 1)
auto_approve_draft_invoice_datestringAuto-approve draft invoices after this date/time. Send an empty string to clear.

Responses

  • 200 — The updated bill run

Identical to the POST form of this endpoint.

PUT /{api_key}/billruns/{id}

Request body

FieldTypeDescription
billrun_template_idintegerBill run template ID — must belong to the token's department. Required on create.
start_datestringStart of the billing period. Defaults to now on create.
end_datestringEnd of the billing period
completeintegerCompleted flag (0 or 1)
update_invoice_date_on_approvalintegerShift invoice date/due date forward on approval (0 or 1)
auto_approve_draft_invoice_datestringAuto-approve draft invoices after this date/time. Send an empty string to clear.

Responses

  • 200 — The updated bill run

Approve a bill run. Marks the run approved, authorises its pending invoices (applying the run's `update_invoice_date_on_approval` date shift), dispatches the invoice emails, runs the un-emailed invoice audit and the approval postflight — identical behaviour to the `cli_approve_billrun.php` CLI. A bill run that is already approved is rejected (`already_approved: true`) so nothing is authorised or emailed twice; pass `{"resend": true}` to re-email an approved run without re-authorising it or shifting invoice dates.

POST /{api_key}/billruns/{id}/approve

Request body

FieldTypeDescription
resendbooleanRe-email an already approved bill run without re-authorising its invoices or shifting invoice dates

Responses

  • 200 — Approval summary

Identical to the POST form of this endpoint.

DELETE /{api_key}/billruns/{id}/delete

Responses

  • 200 — Deletion result

Soft-delete a bill run (sets `deleted = 1`). The row is never physically removed and the bill run disappears from the list and get endpoints.

POST /{api_key}/billruns/{id}/delete

Responses

  • 200 — Deletion result

← All API groups