Create Work Order
POST ?action=create_work_order
Creates a work order from an external source such as WooCommerce. Accepts multiple cart items each with their own intent. Does not provision lines — the work order is created for admin review or passed to submit_payment or complete_order.
Request Parameters
customer_email — string — Required. Customer email address.
status — string — Required. Initial work order status: pending, pending_payment, payment_submitted, completed, canceled, or payment_failed.
items — array — Required. One or more cart item objects (see Item Object below).
customer_name — string — Optional. Customer full name.
customer_phone — string — Optional. Customer phone number.
payment_method_id — integer — Optional. Panelr payment method ID.
payment_amount — float — Optional. Amount paid.
wc_order_id — string — Optional. WooCommerce or external order ID, attached to each cart item.
source — string — Optional. Defaults to woocommerce.
adjustment_direction — string — Optional. fee or discount.
adjustment_label — string — Optional. Display label for the adjustment.
adjustment_amount — float — Optional. Adjustment amount.
Item Object
product_id — integer — Required. Panelr product ID.
intent — string — Required. new_activation, renewal, or trial_upgrade.
activation_id — integer — Required for renewal and trial_upgrade. The activation to renew or upgrade.
qty — integer — Optional. Defaults to 1.
Response Fields
work_order_id — integer — Work order ID
reference_code — string — Human-readable reference code e.g. WO-2026-00042
confirmation_token — string — Unique token for use with submit_payment or complete_order
status — string — Work order status as submitted
type — string — Derived from item intents. new_activation takes priority in mixed carts.
item_count — integer — Number of items in the cart
Example
curl -X POST "https://YOUR_DOMAIN/api/api.php?action=create_work_order" \
-H "X-Panelr-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer_email": "[email protected]",
"customer_name": "John Doe",
"payment_method_id": 1,
"payment_amount": 9.99,
"status": "payment_submitted",
"wc_order_id": "wc_order_abc123",
"items": [
{
"intent": "new_activation",
"product_id": 1,
"qty": 1
}
]
}'