Work Orders
Repair and service jobs with status, delivery date, down payments and payments.
Overview
A work order (wo_...) is a job you do for a customer: a repair, an installation, a custom piece. It has a title, a total, a delivery date, an assignee and a status (pending, in_progress, ready, delivered, cancelled). Customers can leave a down payment and pay the rest on delivery. Optionally it carries a product whose stock goes out when the order is delivered.
Requires the Work orders module. An owner or admin turns it on in Settings > Modules. While it is off, every endpoint on this page returns 403 with type permission_error and code module_disabled.
Every {id} in the work order endpoints accepts the id (wo_...) or the order_number (for example WO-000057).
The Work Order Object
pending_amount = total_amount - paid_amount (never below 0). overdue is true for active orders whose delivery_date already passed in the company time zone. payments is included in single-object responses and omitted in lists.
Endpoints
| Method | Path | Permission | Description |
|---|---|---|---|
GET | /v1/work-orders | read | List orders (status, customer_id, assigned_to, query) |
POST | /v1/work-orders | write | Create an order, optionally with a down payment |
GET | /v1/work-orders/{id} | read | Retrieve an order with its payments |
POST | /v1/work-orders/{id} | write | Update fields (not the status) |
DELETE | /v1/work-orders/{id} | admin | Delete an order without payments |
POST | /v1/work-orders/{id}/status | write | Change the status |
POST | /v1/work-orders/{id}/record_payment | write | Record a payment |
POST | /v1/work-orders/{id}/cancel | write | Cancel (optional reason) |
Create a Work Order
Only title is required. contact_name and contact_phone default to the customer, document_date to today and delivery_date to the configured delivery days. A down_payment (up to the total) is recorded as the first payment with is_down_payment: true. Emits work_order.created and, with a down payment, work_order.payment_recorded.
Status and Delivery
statusacceptspending,in_progress,readyordelivered, from any status exceptcancelled. Sending the current status changes nothing- Moving to
deliveredtakes the product out of stock (Inventory); leavingdeliveredreturns it. Without stock and with negative stock disabled it fails with400 - Emits
work_order.status_changed, pluswork_order.deliveredon delivery - To cancel use
POST /v1/work-orders/{id}/cancel: not allowed for delivered orders or orders with payments
Record a Payment
amount can be up to pending_amount. Methods: cash (default), credit_card, debit_card, bank_transfer, wallet, check, other. With the Cash module on, a cash payment goes into the open cash session of the user who created the API key. Returns 201 with the updated order and emits work_order.payment_recorded.