Leases

Create the invoice for a bill

Generates an invoice for one of the lease's bills and returns it. Use the send endpoint afterwards to email it to the tenants, and the file endpoint to download the PDF.

POST
https://api.portal.magicdoor.com/company-app/leases/{leaseId}/bills/{billId}/invoice

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

leaseIdstringrequired

The lease the bill is on. A Snowflake id, sent as a decimal string.

example: 1830472847398404096
billIdstringrequired

The bill to invoice. A Snowflake id, sent as a decimal string.

example: 1849019384756201984

Response

200 · The invoice that was generated.

idstring

Id of the invoice. A Snowflake id, sent as a decimal string.

leaseIdstring

The lease the invoice is for. A Snowflake id, sent as a decimal string.

issueDatestring · date-time

When the invoice was issued, in the company's timezone.

dueDatestring · date

The date the invoiced amount is due.

invoiceNumberstring

Human-readable invoice number.

totalAmountnumber

Total invoiced, as a decimal amount.

lastSentstring · date-time

When the invoice was last emailed out. Absent until it has been sent.

401 · The access token is missing, expired, or not for this company.

404 · No lease or bill matched the id, or it belongs to another company.