Change a loan
Change one loan of a possession, including marking it as returned.
What you leave out keeps its value, and what you send as null is cleared. A loan that is not returned loses its return day and the condition it came back in, and its provenance events follow what it now says. The change is written to the account log.
The same refusals apply as when recording a loan.
Parameters
Sent as JSON. Anything not listed here is ignored.
The vault the possession is kept in, named either by the readable name it reports as slug or by its id. A vault of another account answers 404.
The id of the possession. A possession of another vault or of another account answers 404.
The id of the loan. A loan of another possession answers 404.
lent or borrowed.
planned, active or returned.
The id of a contact of the vault.
The day the loan started, as YYYY-MM-DD.
The day it is due back, as YYYY-MM-DD. Not before started_on.
The day it came back, as YYYY-MM-DD. Required for a returned loan, not before started_on, and ignored otherwise.
The id of a possession condition of the account, the one it left in.
The id of a possession condition of the account, the one it came back in. Kept only for a returned loan.
A deposit left against the loan, from 0 to 9,999,999,999.99.
The currency of the deposit, as a lowercase ISO code. Required with a deposit.
Why it was lent or borrowed, up to 5,000 characters. Markup is stripped.
Whether the loan records a change of custody in the provenance when it starts and another when it ends. False when left out.
Returns
The loan object, as it now stands. A loan of another possession or of another account answers 404.
The possession loan.
Always possession_loan. It names the kind of record, so a caller holding several kinds can tell them apart without looking at where they came from.
The id of this record, as a string even when it reads as a number. It is what every endpoint naming this record takes.
Everything the record holds.
lent when the possession left your hands, borrowed when it came into them.
planned, active or returned. A possession has at most one active loan.
Whether the loan is active and its due day has passed, in the time zone of the person asking. It is worked out, never stored.
The id of the contact who has it or lent it, or null once that contact is deleted.
The name of that contact, or null once that contact is deleted.
The day the loan started, as YYYY-MM-DD.
The day it is due back, as YYYY-MM-DD, or null when no day was agreed.
The day it came back, as YYYY-MM-DD, or null unless the loan is returned.
The id of the possession condition it left in, or null.
The id of the possession condition it came back in, or null.
A deposit left against the loan, as a decimal with two places, or null.
The currency of the deposit, as a lowercase ISO code, or null without a deposit.
Why it was lent or borrowed, or null.
Whether the loan records a change of custody in the provenance when it starts and another when it ends.
When the loan was recorded, as a count of seconds since 1970.
Where to find this record.
The absolute address this record is read from.
The Loans section of the possession in the application, which opens for somebody signed in rather than for a key. It is the link to give a person.
Rate limit
Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in X-RateLimit-Remaining.
Keys act as you, with exactly the access you have. Make one per integration so you can revoke it alone.