Admin
Batch cancel rentals
Changed on Cancel multiple rentals in one request. Accepts a flat list of rentals
(which may span several orders); the backend groups them by order.
TRANSACTION BEHAVIOR:
- Each rental is cancelled in its own transaction, so one rental failing
does not roll back the others (and never rolls back other orders).
- Cancel is only valid for pre-on-rent rentals (Needs Approval, Draft,
Pending, Scheduled). A rental past that point is reported "failed" with
the invariant message, not aborted for the whole batch.
- An already-cancelled rental is reported "skipped".
RESPONSE:
- Returns a per-rental result ([{rental_id, status, message}]) so the
caller can retry only the rentals that failed.
EMAIL:
- Sends the existing per-rental cancellation email to the order's TAMs
(skipping mobile-tool-trailer rentals), preserving current behaviour.
Consolidating to one email per order is handled separately (sc-551452),
which this endpoint enables by grouping cancelled rentals per order.
post/admin/rentals/batch-cancel
Request
- Base URLhttps://api.equipmentshare.com (the document declares no server; this is the origin it was published from)
- AuthHTTP bearer
Request body
Batch Cancel[] required
cancel_reason_note, string
cancel_reason_type, string
rental_id, integer required
Response
Admin Rentals Batch Cancel Response required
results, Batch Cancel Result[] required
Per-rental outcome, one entry for every rental in the request.
Changes
- info
added the media type
application/jsonfor the response with the status
- info
- breaking
removed the media type
application/jsonfor the response with the status
- breaking