Orders API

7 PracBill API endpoints for orders. Base URL https://billing.pracbill.com.au/api.

Create an order (always created open, status 0). The workflow step is resolved from `status` or the first step of the order type; workflow notifications and the step's workflow action then run. No validation envelope: a missing/invalid `order_type` surfaces as a PHP error.

POST /{api_key}/orders/add

Request body

FieldTypeDescription
cidintegerCustomer ID
uidintegerAssigned user ID
namestring
vidintegerVendor ID
order_typeintegerOrder type ID (order_types.id). Effectively required on create (workflow steps are resolved from it); defaults to the existing order's type on update.
service_typeinteger
date_orderedstringConverted with AppDate::toDBDate()
date_expectedstringConverted with AppDate::toDBDate()
notesstring
vendor_order_idstring
statusobjectWorkflow step: a step NAME (case-insensitive, matched against the active steps of the order type) or an integer step id. Resolved to `workflow_id`; `status` itself is never stored. When omitted, `workflow_id` is set to the FIRST active step of the order type, overriding any supplied `workflow_id`.
workflow_idintegerWorkflow step id. Overridden by `status` or, when `status` is omitted, by the first active step.
order_dataobjectWorkflow action data keyed by action name; each value is an object merged into the stored action data (`order_workflow_actions`).

Responses

  • 200 — Order created

Paginated list (20 per page) of open orders (`status = 0`, not deleted), newest `date_ordered` first. Rows are the autotable list view, not full orders. Page 1 is returned.

GET /{api_key}/orders/get

Responses

  • 200 — Orders retrieved successfully

Paginated list (20 per page) of open orders (`status = 0`, not deleted), newest `date_ordered` first. Rows are the autotable list view, not full orders. Page 1 is returned.

GET /{api_key}/orders/get/page

Responses

  • 200 — Orders retrieved successfully

Paginated list (20 per page) of open orders (`status = 0`, not deleted), newest `date_ordered` first. Rows are the autotable list view, not full orders.

GET /{api_key}/orders/get/page/{page_number}

Responses

  • 200 — Orders retrieved successfully

Get a specific order with workflow action data. Not found: `{success:false, order:false, description:'Unable to find order'}`.

GET /{api_key}/orders/get/{id}

Responses

  • 200 — Order retrieved (or not-found envelope)

Update an order and return it. A changed workflow step runs that step's workflow action. If `status` is omitted the order is moved to the first active step of its order type.

POST /{api_key}/orders/update/{id}

Request body

FieldTypeDescription
cidintegerCustomer ID
uidintegerAssigned user ID
namestring
vidintegerVendor ID
order_typeintegerOrder type ID (order_types.id). Effectively required on create (workflow steps are resolved from it); defaults to the existing order's type on update.
service_typeinteger
date_orderedstringConverted with AppDate::toDBDate()
date_expectedstringConverted with AppDate::toDBDate()
notesstring
vendor_order_idstring
statusobjectWorkflow step: a step NAME (case-insensitive, matched against the active steps of the order type) or an integer step id. Resolved to `workflow_id`; `status` itself is never stored. When omitted, `workflow_id` is set to the FIRST active step of the order type, overriding any supplied `workflow_id`.
workflow_idintegerWorkflow step id. Overridden by `status` or, when `status` is omitted, by the first active step.
order_dataobjectWorkflow action data keyed by action name; each value is an object merged into the stored action data (`order_workflow_actions`).

Responses

  • 200 — Order updated

Update (merge per action) the workflow action data of an order and return the order.

POST /{api_key}/orders/updateData/{id}

Request body

Workflow action data keyed directly by action name (NOT wrapped in `order_data`); each value is an object merged into that action's stored data (the action row is created if missing). Body parsing: the raw body is cut at the first '=' and URL-decoded before JSON decoding, so send JSON without a literal '=' (or URL-encode it).

Responses

  • 200 — Order data updated

← All API groups