Car Rental API (v1)
Overview
The Car Rental API supports public booking (no auth) and dashboard management (workspace JWT + staff permission carrental.manage). Workspace is resolved for public routes via carrental-settings publicSlug.
Base paths
- Public (no auth):
/api/v1/public/:workspaceSlug/carrental/... - Dashboard:
/api/v1/workspace/:workspaceId/carrental/...
Actual backend paths use /v1/public/... and /v1/workspace/....
Authentication
| Context | Auth |
|---|---|
| Public | None. Workspace resolved by publicSlug from carrental-settings. |
| Dashboard | Required: workspace JWT. Staff endpoints require carrental.manage. |
Example header for dashboard:
Authorization: Bearer {workspace_token}
Persona access
- Public: Customer (no auth).
- Dashboard: Workspace Owner and Staff with
carrental.manage.
Modules
Public (no auth)
- Resolve by domain – Get
publicSlugandworkspaceIdby custom domain (for standalone carrental-web on custom domain). - List vehicles – List vehicles (filters: status, branch, category).
- Get vehicle – Get one vehicle by ID.
- List branches – List branches for pickup/return.
- Create reservation – Create booking (multipart: customer + optional docs).
Dashboard (JWT + carrental.manage)
- Custom domains: Manage domains – List, create, get DNS instructions, verify, activate, delete (one domain per workspace).
- Vehicles: List, create, get, update, delete, upload photos.
- Reservations: List, get, create; approve, reject, cancel, ready-for-delivery; deliver (checkout handover); return (checkin handover); complete.
- Contracts: Generate from reservation, get contract.
- Ledger: List entries by reservation, create entry (RENTAL, DEPOSIT, EXTRA, REFUND).
Common errors
| Code | Description |
|---|---|
| 400 | Bad Request – Invalid input or invalid status transition. |
| 401 | Unauthorized – Missing or invalid token. |
| 403 | Forbidden – No workspace or insufficient permission. |
| 404 | Not Found – Workspace/slug, vehicle, or reservation not found. |
| 409 | Conflict – e.g. duplicate slug. |
| 422 | Unprocessable Entity – Validation failed. |
| 500 | Internal Server Error. |