Work orders

Update a draft bill

Changes a draft bill's dates, lines or vendor. Anything you leave out keeps its current value; sending lineItems replaces the whole set. Requires the work_orders:write permission.

PUT
https://services.magicdoor.com/maintenance/company-portal/work-orders/{workOrderId}/draft-bills/{draftBillId}

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

workOrderIdstringrequired

The work order to act on. A Snowflake id, sent as a decimal string.

example: 1841200938471029248
draftBillIdstringrequired

The draft bill on this work order. A Snowflake id, sent as a decimal string.

example: 1841500938471029248

Body

application/json

billDatestring · date

The bill's date.

dueDatestring · date

When the bill is due.

lineItemsobject[]

The complete new set of lines. Sending this replaces every existing line.

approvedboolean

Whether the draft is approved.

vendorIdstring

The vendor to be paid.

billIdstring

The real vendor bill this draft corresponds to, when linking one by hand.

Response

200 · The updated draft bill.

idstringrequired

The draft bill. Once converted, this is the id of the real vendor bill instead.

billDatestring · daterequired

The bill's date, in the company's timezone.

dueDatestring · date

When the bill is due, in the company's timezone. Absent when no date was set.

lineItemsobject[]required

What is being charged.

filesobject[]required

Invoices and receipts attached to the bill. An empty array when there are none.

addedOnstring · date-timerequired

When the draft bill was added, in the company's timezone and without an offset.

addedByVendorbooleanrequired

Whether the vendor added it through their own portal rather than staff adding it here.

approvedbooleanrequired

Whether the draft has been approved. Drafts created through this API are approved from the start.

vendorIdstring

The vendor to be paid. Absent while unset — it is needed before the bill can be converted.

billIdstring

The real vendor bill this draft became. Absent until it is converted.

401 · The request carried no valid access token.

403 · The token is not a property manager token, or it lacks the `work_orders:write` permission.

404 · No such work order, it belongs to another company, or the work order has no draft bill with that id.