Car Rental by Domain (v1)
Method & Path
POST /api/v1/public/carrental/by-domain
Actual path: /v1/public/carrental/by-domain
Description
Resolve car rental workspace by custom domain. Used when the booking site is served on a custom domain (e.g. rent.example.com). Returns publicSlug and workspaceId so the client can call public car rental endpoints with the slug.
Authentication
None. Public endpoint.
Headers
| Header | Required | Description |
|---|---|---|
| Content-Type | Yes | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| domain | string | No | Domain to resolve (e.g. rent.example.com). If omitted, the server uses the request Host header. |
Example:
{
"domain": "rent.example.com"
}
Response 200 OK
{
"publicSlug": "demo-rentals",
"workspaceId": "507f1f77bcf86cd799439011"
}
Common Errors
| Code | Description |
|---|---|
| 400 Bad Request | Domain or Host header missing. |
| 404 Not Found | No car rental found for this domain (domain not registered or not verified/active). |