Leases

Get the invoice for a bill

Fetches the invoice that was generated for one of the lease's bills. Returns 404 when no invoice has been generated yet — create one first.

GET
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 whose invoice you want. A Snowflake id, sent as a decimal string.

example: 1849019384756201984

Response

200 · The invoice.

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 invoice has been generated for that bill, or the bill does not belong to this lease.