Lease charges

Create a recurring credit

Sets up a credit that repeats on the lease. Set createPastCredits to true to issue the credits that would already have fallen due between start and today.

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

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

example: 1830472847398404096

Body

application/json

amountnumberrequired

Credit to issue each period, as a decimal of at least 1.

creditFrequencyenum<string>required

How often to issue it.

monthlyweeklydailymonthly2XSplitquarterlyyearly
createPastCreditsbooleanrequired

Whether to issue the credits that fell due between start and today.

startstring · date

First date to issue a credit.

endstring · date

Last date to issue a credit. Must be later than start.

descriptionstring

What the credit is for. 1 to 1000 characters.

Response

200 · The recurring credit that was created.

idstring

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

amountnumber

Credit issued each period, as a decimal.

creditFrequencyenum<string>

How often it is issued.

monthlyweeklydailymonthly2XSplitquarterlyyearly
descriptionstring

What the credit is for.

lastCreditstring · date

When it last issued a credit.

nextCreditstring · date

When it next issues one.

startstring · date

First date it issues a credit.

endstring · date

Last date it issues a credit. Absent when it runs indefinitely.

statusenum<string>

Whether it is still running, has finished, or is about to issue a credit.

activeendeddueSoon

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.