Lease charges

Create a recurring charge

Sets up a charge that repeats on the lease. Set createPastCharges to true to raise the charges that would already have fallen due between startFrom and today.

POST
https://api.portal.magicdoor.com/company-app/leases/{leaseId}/charges/recurring-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 add the recurring charge to. A Snowflake id, sent as a decimal string.

example: 1830472847398404096

Body

application/json

amountnumberrequired

Amount to raise each period, as a decimal of at least 1.

chargeFrequencyenum<string>required

How often to raise it.

monthlyweeklydailymonthly2XSplitquarterlyyearly
chartOfAccountIdstringrequired

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

createPastChargesbooleanrequired

Whether to raise the charges that fell due between startFrom and today.

startFromstring · date

First date to raise a charge.

endstring · date

Last date to raise a charge. Must be later than startFrom.

descriptionstring

What the charge is for. 1 to 1000 characters.

companyChargeboolean

Whether the company keeps these charges.

default: false

Response

200 · The recurring charge that was created.

idstring

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

amountnumber

Amount raised each period, as a decimal.

chargeFrequencyenum<string>

How often it is raised.

monthlyweeklydailymonthly2XSplitquarterlyyearly
chartOfAccountIdstring

Account each charge is booked to. A Snowflake id, sent as a decimal string.

descriptionstring

What the charge is for.

companyChargeboolean

Whether the company keeps these charges rather than passing them to the owner.

lastChargestring · date

When it last raised a charge.

nextChargestring · date

When it next raises one.

startFromstring · date

First date it raises a charge.

endstring · date

Last date it raises a charge. Absent when it runs indefinitely.

statusenum<string>

Whether it is still running, has finished, or is about to raise a charge.

activeendeddueSoon
chartOfAccountobject

The account each charge is booked to.

400 · The request failed validation. `errors` maps each field name to what was wrong with it.

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

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