Create a new book rental for a specific user. This endpoint automatically decrements the book’s stock by 1 and sets a 2-week loan period.
curl -X POST https://api.example.com/books/978-0-12345-678-9/user/42 \ -u "username:password" \ -H "Content-Type: application/json"
{ "id": 123, "user": { "id": 42, "firstname": "John", "lastname": "Doe", "email": "[email protected]", "displayPicture": "https://example.com/photos/john.jpg" }, "book": { "isbn": "978-0-12345-678-9", "title": "The Great Adventure", "stock": 4, "coverImage": "https://example.com/covers/great-adventure.jpg", "author": { "id": 7, "name": "Jane Smith", "age": 45 } }, "loanDate": "2026-03-04T10:30:00Z", "returnDate": "2026-03-18T10:30:00Z", "returned": false }
returnDate
loanDate