Access Control
Rental information is protected by access control:- Tenants: Can view their own rental details
- Owners: Can view rentals of their products
- Others: Cannot access rental information
Retrieving a Rental
Basic Rental Retrieval
Response Format
Rental Details
Core Information
Field | Type | Description |
---|---|---|
id | integer | Unique rental identifier |
status | string | Rental status (active, completed, cancelled) |
start_date | date | Rental start date |
end_date | date | Rental end date |
total_amount | float | Total rental cost |
created_at | datetime | Rental creation timestamp |
updated_at | datetime | Last update timestamp |
User Information
Field | Type | Description |
---|---|---|
tenant | object | Renter information |
owner | object | Product owner information |
Rental Items
Each rental item includes:Field | Type | Description |
---|---|---|
product_id | integer | Product identifier |
title | string | Product title |
quantity | integer | Number of units rented |
daily_rate | float | Daily rental rate |
total | float | Total cost for this item |
Error Responses
Unauthorized (401)
Forbidden (403)
Not Found (404)
Use Cases
For Tenants
- Track rental history: View all your past and current rentals
- Verify rental details: Confirm dates, items, and costs
- Contact owners: Get owner information for communication
For Owners
- Monitor rentals: Track which of your products are currently rented
- Revenue tracking: View rental income and history
- Customer management: Access tenant information for support
Best Practices
1. Error Handling
Always implement proper error handling for rental requests:2. Data Validation
Validate rental data before processing:- Check rental status before taking actions
- Verify dates are in the expected format
- Confirm amounts match your expectations
3. Security Considerations
- Never expose rental IDs in public URLs
- Validate access permissions before displaying rental data
- Sanitize user input when searching for rentals