Resource
Rentals
A booking of a vehicle by a customer. Use to push rentals from your own intake or to sync them out to a calendar.
The rental object
idstring (uuid) | Unique identifier. |
objectstring | Always `"rental"`. |
booking_idstring | External booking reference. |
customer_idstring (uuid) | Renting customer. |
vehicle_idstring (uuid) | Reserved vehicle. |
start_datestring (date) | Pickup date. |
end_datestring (date) | Return date. |
rental_daysinteger | Number of nights. |
pickup_typestring | `pickup` or `delivery`. |
delivery_locationstring | Delivery address if applicable. |
final_pricenumber | Locked-in total price. |
statusstring | `NEW`, `APPROVED`, `ACTIVE`, `COMPLETED`, `CANCELLED`. |
created_atstring (iso8601) | Creation time. |
Webhook events
Subscribe to receive notifications when rental resources change:
rental.createdrental.updatedrental.completedrental.cancelledEndpoints
GET
/v1/rentalsscope: readList rentals
Query parameters
statusstring | Filter by status. |
customerstring (uuid) | Filter by customer. |
limitinteger | Default 20. Max 100. |
starting_afterstring | Cursor. |
Request
curl -X GET 'https://userenvo.com/api/v1/rentals' \
-H 'Authorization: Bearer rv_live_…'Response
{
"object": "list",
"has_more": false,
"next_cursor": null,
"data": [
{
"object": "rental",
"id": "re_…",
"customer_id": "cu_…",
"vehicle_id": "a4…",
"status": "NEW"
}
]
}GET
/v1/rentals/{id}scope: readRetrieve a rental
Path parameters
idrequiredstring | Rental id. |
Request
curl -X GET 'https://userenvo.com/api/v1/rentals/a4d2e1c0-9b…' \
-H 'Authorization: Bearer rv_live_…'Response
{
"object": "rental",
"id": "re_…",
"status": "APPROVED"
}POST
/v1/rentalsscope: read_writeCreate a rental
Body parameters
customer_idrequiredstring | Renting customer. |
vehicle_idrequiredstring | Reserved vehicle. |
start_datestring (date) | Pickup date (YYYY-MM-DD). |
end_datestring (date) | Return date. |
final_pricenumber | Locked total price. |
statusstring | Defaults to `NEW`. |
Request
curl -X POST 'https://userenvo.com/api/v1/rentals' \
-H 'Authorization: Bearer rv_live_…' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "<customer_id>",
"vehicle_id": "<vehicle_id>",
"start_date": "<start_date>"
}'Response
{
"object": "rental",
"id": "re_…",
"status": "NEW"
}PATCH
/v1/rentals/{id}scope: read_writeUpdate a rental
Setting `status` to `COMPLETED` or `CANCELLED` triggers the corresponding webhook event.
Path parameters
idrequiredstring | Rental id. |
Body parameters
statusstring | New status. |
damage_at_returnboolean | Mark damage on return. |
Request
curl -X PATCH 'https://userenvo.com/api/v1/rentals/a4d2e1c0-9b…' \
-H 'Authorization: Bearer rv_live_…' \
-H 'Content-Type: application/json' \
-d '{
"status": "<status>",
"damage_at_return": true
}'Response
{
"object": "rental",
"id": "re_…",
"status": "COMPLETED"
}