Lease charges

Add a charge to a lease

Raises a one-off charge against the lease, such as a repair the tenant is liable for. For rent and other charges that repeat, create a recurring charge instead.

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

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 to charge. A Snowflake id, sent as a decimal string.

example: 1830472847398404096

Body

application/json

dueDatestring · daterequired

The date the tenant has to pay by.

billDatestring · date

The date the charge is booked into the ledger. Defaults to dueDate, and may not be later than it.

amountnumberrequired

How much to charge, as a decimal amount of at least 1.

chartOfAccountIdstringrequired

Account to book the charge to. A Snowflake id, sent as a decimal string.

descriptionstring

What the charge is for. Up to 1000 characters.

companyChargeboolean

Whether the company keeps this charge rather than passing it to the owner.

default: false

Response

200 · The charge that was raised.

idstring

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

createdstring · date-time

When the charge was created, in the company's timezone.

updatedstring · date-time

When the charge last changed.

companyChargeboolean

Whether the company keeps this charge rather than passing it through to the owner.

billDatestring · date

The date the charge is booked into the ledger.

dueDatestring · date

The date the tenant has to pay by.

totalAmountnumber

What the charge is for in total, as a decimal amount.

allocatedAmountnumber

How much of it has been covered by payments or credits.

dueAmountnumber

What is still owing on it.

memostring

Free-text note on the charge.

referencestring

External reference carried on the charge.

portfolioIdstring

Portfolio the charge rolls up to. A Snowflake id, sent as a decimal string.

propertyIdstring

Property the charge is on. A Snowflake id, sent as a decimal string.

unitIdstring

Unit the charge is on. A Snowflake id, sent as a decimal string.

leaseIdstring

Lease the charge is on. A Snowflake id, sent as a decimal string.

recurringChargeIdstring

The recurring charge that raised this one. Absent on a one-off charge. A Snowflake id, sent as a decimal string.

leaseSubsidyIdstring

The lease subsidy that raised this one. A Snowflake id, sent as a decimal string.

lineItemsLeaseChargeLineItem[]

What the charge is made up of.

filesLeaseChargeFile[]

Files attached to the charge, by id.

metadataobject

Free-form key/value data carried on the charge.

creatorobject

Who created the record.

portfolioobject

The portfolio the lease rolls up to.

propertyobject

The property the lease's unit sits in.

unitobject

The unit the lease is for.

leaseobject

The lease the charge is on.

transactionsTransaction[]

The transactions referenced by the allocations above.

bankAccountsBankAccount[]

Bank accounts referenced above.

chartOfAccountsChartOfAccount[]

Chart-of-account records referenced above.

hydratedFilesFile[]

The files listed in files, resolved to full file records.

creatorInfoobject

The full record of whoever created this, under whichever one key matches the creator's type.

400 · The body failed validation — for example the due date is earlier than the bill date.

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

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

Bill date and due date

billDate is the date the charge is booked into the ledger; dueDate is the date the tenant has to pay by. They are usually the same day, and MagicDoor copies the due date into the bill date when you leave billDate out. A due date earlier than the bill date is rejected.