Rental
A rental gives a user access to a vehicle. Start and end a rental to begin and complete a ride; at the end, the price is returned so the partner can charge the user. A user can rent only one vehicle at a time, and pre-booking is not possible.
The rental model
Every rental endpoint responds with the rental model below (wrapped in a data array).
{
"data": [
{
"id": "82267e03-f5b1-4b76-86c6-9f07df279372",
"type": "rental",
"attributes": {
"rentalDurationMin": 12,
"rentalDistanceMeters": 142,
"cost": {
"startPrice": 150,
"pricePerMinute": 30,
"subtotal": 429,
"total": { "amount": 510, "currency": "EUR", "vat": 81, "vatPercentage": 0.19 }
},
"state": "ENDED",
"startedAt": "2020-01-13T16:02:05.44409597Z",
"endedAt": "2020-01-13T16:13:20.44314233Z",
"userStartLocation": { "longitude": 18.0757, "latitude": 59.3190 },
"userEndLocation": { "longitude": 18.0757, "latitude": 59.3190 },
"vehicle": { "vehicleId": "7983e884-1111-2222-3333-f50ce017fcc8", "vehicleCode": "xray" },
"vehicleStartLocation": { "longitude": 18.0757, "latitude": 59.3190 },
"vehicleEndLocation": { "longitude": 18.0757, "latitude": 59.3190 },
"receipt": { "url": "https://example.com/receipt.pdf" }
}
}
]
}
| Field | Type | Description |
|---|---|---|
id | string | The rental's unique id (UUID v4). |
type | string | Always rental. |
rentalDurationMin | integer | Duration in full minutes, rounded up. Used to calculate the charge. |
rentalDistanceMeters | integer | Distance travelled in full meters, rounded up. |
cost | object | Cost breakdown — see below. |
state | string | RUNNING (during) · ENDED (normal) · ENDED_WITH_NO_CHARGE (auto-ended, no charge) · ENDED_INTERNALLY (ended by Voi, e.g. user forgot to). |
startedAt / endedAt | string | Start / end time (RFC3339, UTC). endedAt is present once ended. |
vehicle | object | vehicleId (UUID v4) and vehicleCode (4-letter code). |
userStartLocation / userEndLocation | object | longitude/latitude provided by the user (optional). |
vehicleStartLocation / vehicleEndLocation | object | The vehicle's own longitude/latitude. |
receipt | object | { "url": ... } — link to a PDF receipt. Expires after 15 minutes. |
Cost — startPrice (unlock fee), pricePerMinute, and subtotal (excl. VAT) are all in minor units; total holds amount (incl. VAT), currency (ISO 4217), vat and vatPercentage.
Notes
- Amounts are always in minor units. Most currencies use 1/100, e.g.
{ "amount": 1213, "currency": "EUR" }= €12.13. - Receipt links expire after 15 minutes.
- Location: if a start/end location is provided via the API, the phone's location defines the end-ride position; otherwise the vehicle's own location (updated every 15 seconds) is used.
See Payments for fines, short-ride rules, refunds and invoicing.
Start a rental
Makes a vehicle accessible to ride. The `vehicleId` is usually obtained from the user selecting a vehicle on the map ([Get vehicles by zone](/deep-integration/reference/get-vehicles-by-zone)) or scanning the vehicle code ([Get vehicle by code](/deep-integration/reference/get-vehicle-by-code)). The partner decides what limitations, if any, to place on who can start a ride.
End a rental
Locks the vehicle, makes it available to other users, and returns the total cost of the rental. The partner typically starts the payment process when ending the rental.
Fetch rental by ID
Returns the current state of a rental. Useful for polling rental status — recommended frequency is every 10 seconds.
Get rentals by user ID
Returns all rentals for a user.
Get active rental by user ID
Returns the user's currently active rental, if any.