Skip to main content
GET
/
rentals
/
{rental_id}
curl -X GET https://api.example.com/rentals/123 \
  -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
}

Authentication

This endpoint requires HTTP Basic Authentication.

Path Parameters

rental_id
integer
required
The unique identifier of the rental

Response

id
integer
Unique identifier for the rental
user
object
User who rented the book
id
integer
User ID
firstname
string
User’s first name
lastname
string
User’s last name
email
string
User’s email address
displayPicture
string
URL to user’s display picture
book
object
Book being rented
isbn
string
Book ISBN
title
string
Book title
stock
integer
Current stock count
coverImage
string
URL to book cover image
author
object
Book author details
id
integer
Author ID
name
string
Author name
age
integer
Author age
loanDate
string
ISO 8601 timestamp when the book was rented
returnDate
string
ISO 8601 timestamp when the book is due (2 weeks from loan date)
returned
boolean
Whether the book has been returned

Error Responses

404
error
Rental with the specified ID not found
curl -X GET https://api.example.com/rentals/123 \
  -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
}

Build docs developers (and LLMs) love