Machine to Machine

POST off-rent a rental (M2M)

Changed on

Ends a rental whose scheduled off-rent time (off_rent_date_requested) has passed, with off_rent_date as its end date: EndPartRental for parts rentals, EndRental for every other type, plus completing the return delivery of a rapid rent. The rental is re-read under a row lock first, and nothing changes unless it is still on_rent with an off_rent_date_requested that has passed and still equals off_rent_date, so a stale or repeated call returns skipped. The off-rent-now email is sent after commit; a failure to send it is logged and does not fail the request. Callers must send X-M2M-USER-ID: commands are attributed to that user (the rentals-off-renter lambda sends the invoicing job user, 9204).

post/machine-to-machine/rentals/{rental_id}/off-rent

Request

  • Base URL
    https://api.equipmentshare.com (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Path parameters

rental_id, integer required

Request body

M2MRentalOffRentRequest required
off_rent_date, string date-time required

When the rental went off rent: ISO-8601 with a UTC offset, not in the future. Becomes the rental's end date.

Response

{"result": "off_rented", "rental_id", "rental_status_id"} when the rental was off-rented (rental_status_id is as stored, so completed for a rapid rent whose return delivery completion closed it), or {"result": "skipped", "rental_id", "rental_status_id", "reason"} when nothing changed because it was not on_rent (not_on_rent), its off_rent_date_requested is unset or in the future (not_due), or its off_rent_date_requested no longer equals off_rent_date (off_rent_date_changed).

Changes