Dashboard – Car rental ledger & contracts (v1)
Base path
/api/v1/workspace/:workspaceId/carrental
All endpoints require workspace JWT and staff permission carrental.manage.
Ledger
| Method | Path | Description |
|---|---|---|
| GET | /:workspaceId/carrental/reservations/:id/ledger | List ledger entries for a reservation. |
| POST | /:workspaceId/carrental/reservations/:id/ledger | Create ledger entry (body: kind RENTAL | DEPOSIT | EXTRA | REFUND, title, amount, currency, status, method, meta). |
Ledger kinds: RENTAL (base rental), DEPOSIT, EXTRA (fees), REFUND. Default currency ILS.
Contracts
| Method | Path | Description |
|---|---|---|
| POST | /:workspaceId/carrental/reservations/:id/contract/generate | Generate contract from template (returns contract with termsHtml, optional pdfUrl). |
| GET | /:workspaceId/carrental/contracts/:id | Get contract by ID. |
Common errors
- 400: Validation failed.
- 401: Unauthorized.
- 403: Forbidden.
- 404: Reservation, contract, or workspace not found.
- 500: Server error.