Work orders

Attach files to a draft bill

Attaches invoices or receipts whose bytes you have already uploaded. Each entry names an upload session from Start a file upload for a draft bill — this endpoint does not carry file content itself. Requires the work_orders:write permission.

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

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

filesobject[]required

The uploads to attach.

Response

200 · The draft bill, with the new files in `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.

400 · `files` is missing, or an `uploadSessionId` is not a Snowflake id.

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.