---
title: "POST off-rent a rental (M2M)"
method: POST
path: "/machine-to-machine/rentals/{rental_id}/off-rent"
tags: ["Machine to Machine"]
---

# POST off-rent a rental (M2M)

`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)
- URL: `https://api.equipmentshare.com/machine-to-machine/rentals/{rental_id}/off-rent`
- Auth: HTTP bearer

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).

## Path parameters

- `rental_id` integer, required

## Request body

- M2MRentalOffRentRequest
  - `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 `200`

`{"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`).

## Other responses

- `400`: X-M2M-USER-ID header missing, or invalid body: off_rent_date missing, unparseable, without a UTC offset or in the future, or an unknown field.
- `401`: Unauthorized - valid machine Bearer token required, and X-M2M-USER-ID must name an existing user.
- `404`: Rental not found. Body: {"type": "EntityNotFound", "message": ...}.
- `409`: Domain rule violated, e.g. off_rent_date would drop a scheduled equipment swap or the parts rental has open deliveries. Body: {"type": "InvariantViolated", "message": ...}. Nothing was changed.

## Changes

- **2026-10-14** `1a087ab36a2c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/equipmentshare/apis/es-api/changes/machine-to-machine/rentals/:rental_id/off-rent/post.md)

---

[API](https://skmtc.dev/equipmentshare/apis/es-api.md) - [All operations](https://skmtc.dev/equipmentshare/apis/es-api/llms.txt) - [OpenAPI document](https://skmtc.dev/equipmentshare/apis/es-api/revisions/40651e1558ac?raw)
