Work orders

Remove a file from a draft bill

Takes one file off a draft bill and returns the bill without it. Requires the work_orders:write permission.

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

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
fileIdstringrequired

The file to remove. This is the id of an entry in the draft bill's files array, not an upload session id.

example: 1841004857392017413

Response

200 · The draft bill, with the file gone from `files`.

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.