Material orders, and scope links on invoices and bills
New: material orders
Create, read, update and delete material orders (the purchase orders you place with a vendor for a project’s materials).
GET /material-ordersandGET /projects/{project_id}/material-orders: list withpage,page_size,order_by,updated_afterandupdated_before. Archived material orders are left out unless you passinclude_archived=true.GET /material-orders/{material_order_id}POST /material-orders: sendrecordId(a project),vendorIdandlineItemsand/orsections.titledefaults to “Material Order”.PATCH /material-orders/{material_order_id}: partial update.lineItemsandsectionsreplace all lines, so send a line’sidto keep it. SetisActivetofalseto archive it, ortrueto unarchive it.DELETE /material-orders/{material_order_id}: archives the material order, then deletes it.
Material orders return materialOrderNumber, title, description, internalMemo, status, vendor ({ id, name }), record, issueDate, dueDate, amount, subtotal, isArchived, the delivery fields, pointOfContactUser, deliveryContactUser, createdAt, updatedAt and lineItems. Amounts are in dollars.
- Optional fields:
description,internalMemoanddueDate. - Delivery details (
deliveryMethod,deliveryWindow,pickupTime,deliveryRequestedFor,deliveryInstructions,supplierBranchNumber,supplierJobAccountNumber,pointOfContactUseranddeliveryContactUser) are read-only. They are set in the app when the vendor is a connected supplier (SRS Distribution or ABC Supply), and are returned when you read a material order. statuscan be set toDRAFT,SENT,SCHEDULED,PARTIALLY_FULFILLED,FULFILLEDorCANCELED, following the allowed transitions.PENDING_SUPPLIERmeans a connected supplier has queued the order and is waiting for its order number. It is returned as-is and can’t be set.vendorIdcan only change while the material order is aDRAFT.- Accepted by a supplier: once a connected supplier has accepted a material order, it is locked.
PATCHandDELETEreturn400with the reason. - Lines take
catalogItemId,quantity,unitCost(0 or more),unitPriceanddescription. AcatalogItemIdcan appear at most once per request. - Material orders are priced by cost. The total is
unitCost×quantityacross all lines.unitPriceis the selling price: it doesn’t change the material order’s total, and is copied to the project scope when a line that isn’t linked to scope is added there. Removing that line from the material order later doesn’t remove it from the scope. - Material orders can only be created on projects, and can’t be sent to a supplier through the API.
New: link scope line items on invoices, bills and material orders
Lines on invoices, bills and material orders can now link a project’s scope line items (the lines from GET /projects/{project_id}/line-items), so billing tracks against the project’s scope.
scopeLineItemIdis theidof a scope line. It works onlineItemsand onsections[].lineItems, on create and update, forPOSTandPATCHon/invoices,/billsand/material-orders.- On invoices and bills,
billingModeisQUANTITY(the default),PERCENTAGEorAMOUNT.PERCENTAGEandAMOUNTbill part of the scope line and need abillingValueabove 0.billingValueisn’t accepted withQUANTITY. - Material orders always order by quantity, so their lines don’t take
billingModeorbillingValue. - Lines now return
scopeLineItemId(nullwhen unlinked). Invoice and bill lines also returnbillingModeandbillingValue. - A scope line can be linked at most once per document. A request that repeats a
scopeLineItemIdreturns400. - A linked
QUANTITYline must keep the scope line’sunitCostandunitPrice. - Change orders: when a linked
QUANTITYline is for more than what is left on the scope line, Coperniq creates and approves a change order that increases the scope, instead of returning an error. New lines that aren’t linked are added to the scope. - Invoices on milestone-billed projects can’t link scope lines.
PUT /projects/{project_id}/line-itemsreplaces scope lines, so their ids can change. Read them again before you link.- On update, a line you keep by sending its
idkeeps its scope link, even if you leavescopeLineItemIdout. - Quotes can’t link scope lines.
