Record a loan
Record a possession lent to a contact of its vault, or borrowed from one.
Name an existing contact with contact_id, or write a new one down with new_contact: the contact and the loan are then saved together, or neither is. A contact of another vault answers 404. The change is written to the account log.
A planned or active loan of a possession that is sold, given away, thrown away, lost or stolen answers 422 on status ("This possession is no longer in your hands, so only a returned loan can be recorded for it."). A second active loan answers 422 on status ("Another loan of this possession is active. Mark it as returned first."). A due day before the start answers 422 on due_on, and a returned loan without its return day answers 422 on returned_on ("Say when it came back.").
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.
lent or borrowed.
planned, active or returned.
The id of a contact of the vault. Required without new_contact.
A contact to write down with the loan, as first_name (required) and last_name. Required without contact_id, and refused with it.
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 new loan object.
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.