Work orders

Add a draft bill to a work order

Records what the job is going to cost. A draft bill lives on the work order until you convert it, which is when it becomes a real vendor bill in the accounting ledger. Requires the work_orders:write permission.

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

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

Body

application/json

dueDatestring · daterequired

When the bill is due.

lineItemsobject[]required

What is being charged. At least one line.

billDatestring · date

The bill's date. Leave it out and today's date is used.

vendorIdstring

The vendor to be paid. Leave it out and the bill cannot be converted until you set one with Update a draft bill.

Response

200 · The draft bill that was added.

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, or it belongs to another company.