Skip to main content

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

ContextAuth
PublicNone. Workspace resolved by publicSlug from carrental-settings.
DashboardRequired: 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)

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

CodeDescription
400Bad Request – Invalid input or invalid status transition.
401Unauthorized – Missing or invalid token.
403Forbidden – No workspace or insufficient permission.
404Not Found – Workspace/slug, vehicle, or reservation not found.
409Conflict – e.g. duplicate slug.
422Unprocessable Entity – Validation failed.
500Internal Server Error.