WorkPerformed.Add

Records work performed against a specific photocopy stop. Work-performed rows are stored in CWorkOrderWorkPerformed and are separate from requested / pre-bill work on CWorkOrderPreBill.

Try it in Swagger

Endpoint

Request Schema

Headers

Header Required Notes
X-Api-Key Required when tenant is not resolved by subdomain Resolves the tenant/customer database.
Authorization: Bearer {token} Required for authorized endpoints Get a token from Auth/Token, Session/Create, or Employee/SignIn.

Route Parameters

Field Type Required Notes
workOrder string Yes Photocopy work order.
facilityLineItem int Yes Stop identifier (CWorkOrderFacility.LineItem).

JSON Body

Body type: WorkPerformedCreateRequestDto

Field Type Required Max Length Notes
itemCode int One of itemCode or itemTitle Billing item code from WorkPerformed/Items.
itemTitle string One of itemCode or itemTitle 100 Billing item title from WorkPerformed/Items.
units decimal Yes Number of units completed. Must be zero or greater.
performedBy string Yes 12 Employee code from Employee/GetAll.
performedDate DateTime Yes Date the work was performed (for example 2026-07-24).
note string No 500 Optional comment.

Request Sample

{
  "itemCode": 41,
  "itemTitle": "bookmark",
  "units": 47,
  "performedBy": "NCUR",
  "performedDate": "2026-07-24",
  "note": ""
}

Either itemCode or itemTitle is enough. When both are sent they must refer to the same billing item.

Expected Response Schema

Status Codes

Status Notes
200 OK Returned by the controller for this operation.
400 Bad Request Missing fields, negative units, unknown work item, or unknown employee. Returns a ProblemDetails with errorCode ValidationError.
404 Not Found The work order or stop does not exist. Returns a ProblemDetails with errorCode NotFound.
503 Service Unavailable The tenant database does not have CWorkOrderWorkPerformed, or the API SQL login cannot SELECT/INSERT it. Other API endpoints are unaffected. Returns a ProblemDetails with errorCode WorkPerformedNotEnabled.

Success Body

Response type: WorkPerformedCreatedDto

Field Type Notes
id int Created work-performed identifier (CWorkOrderWorkPerformed.LineItem). Use this for later retrieval or removal.
workOrder string Work order stored on the record.
facilityLineItem int Stop / facility line item.
itemCode int Resolved billing item code, when the catalog has a match.
itemTitle string Work-item title stored on CWorkOrderWorkPerformed.Item.
units decimal Units stored on the record.

Response Sample

{
  "id": 1182,
  "workOrder": "646982",
  "facilityLineItem": 2646058,
  "itemCode": 41,
  "itemTitle": "bookmark",
  "units": 47
}

Error Body

Validation and not-found failures return a standard ProblemDetails with the failure message in detail and a machine-readable errorCode:

{
  "title": "Validation failed.",
  "status": 400,
  "detail": "Invalid request data",
  "errorCode": "ValidationError"
}
{
  "title": "Resource not found.",
  "status": 404,
  "detail": "Work order or stop not found.",
  "errorCode": "NotFound"
}
{
  "title": "Work performed is not available.",
  "status": 503,
  "detail": "Work performed is not enabled for this tenant. The CWorkOrderWorkPerformed table has not been created.",
  "errorCode": "WorkPerformedNotEnabled"
}