Skip to main content

Overview

The Services API allows you to manage service listings, bookings, availability schedules, categories, and media. All Services API endpoints require admin authentication.

Service Listings

List Services

From /src/pages/api/admin/services/services.ts:20-112:

Query Parameters

integer
default:"1"
Page number
integer
default:"20"
Items per page (max: 100)
string
Search by slug
string
Filter by status: draft, active, suspended, archived
Filter featured services
boolean
Filter services displayed on homepage
string
Filter by category ID
string
Filter by organization ID
string
Fetch single service with full details (translations, media)

Create Service

From /src/pages/api/admin/services/services.ts:136-206:

Request Body

string
required
Must be "create"
string
required
URL-friendly service slug
string
Category ID (nullable)
string
required
User ID of service provider
string
Organization ID (nullable)
string
default:"draft"
Service status: draft, active, suspended, archived
string
Service price (decimal string, e.g., “150.00”)
string
Pricing model: hourly, fixed, per_session, custom
string
default:"EUR"
ISO currency code (EUR, USD, etc.)
number
Service duration in minutes
boolean
default:"false"
Service available at customer location
number
Maximum participants per booking
number
Minimum hours required before booking
number
Hours before booking when cancellation is allowed
Mark as featured
boolean
default:"false"
Show on homepage
boolean
default:"true"
Enable customer reviews
array
Array of translation objects with inLanguage, title, description, etc.
array
Array of media objects with mediaId, type (cover/gallery), position

Update Service

From /src/pages/api/admin/services/services.ts:208-286:
Updates replace translations and media (full replacement strategy).

Other Service Actions

From /src/pages/api/admin/services/services.ts:288-371:
Duplicating creates a copy with status: "draft" and unique slug.

Service Categories

List Categories

From /src/pages/api/admin/services/categories.ts:19-99:

Query Parameters

string
Fetch single category by ID (includes service count)
boolean
Return all categories for selectors
string
Filter by parent ID (use "root" for top-level)
Filter featured categories
boolean
Filter categories displayed on homepage
boolean
Filter categories shown in menu

Create Category

From /src/pages/api/admin/services/categories.ts:124-155:

Update/Delete Category

From /src/pages/api/admin/services/categories.ts:157-216:
Deleting a category unlinks all services (sets categoryId to null).

Availability

List Availability Slots

From /src/pages/api/admin/services/availability.ts:13-30:

Response

Day of Week: 0 = Sunday, 1 = Monday, …, 6 = Saturday

Manage Availability

From /src/pages/api/admin/services/availability.ts:36-127:

Bookings

List Bookings

From /src/pages/api/admin/services/bookings.ts:14-96:

Query Parameters

string
Filter by status: pending, confirmed, cancelled_by_customer, cancelled_by_provider, completed, no_show
string
Filter by service ID
string
Search in customer messages
string
Filter bookings from date (ISO 8601)
string
Filter bookings to date (ISO 8601)

Response


Update Booking Status

From /src/pages/api/admin/services/bookings.ts:102-154:
Method: PATCH /api/admin/services/bookings

Service Media

List Service Media

From /src/pages/api/admin/services/media.ts:20-51:

Upload Service Media

From /src/pages/api/admin/services/media.ts:57-208:

Configuration

  • Upload directory: public/uploads/services
  • Max file size: 10 MB
  • Allowed types: JPEG, PNG, WebP, AVIF, GIF, SVG

Update/Delete Service Media


Common Response Codes


Audit Logging

All Services API actions are logged:
  • service.create
  • service.update
  • service.delete
  • service.duplicate
  • service_category.create
  • service_category.update
  • service_category.delete
  • services.media.upload
  • services.media.delete

Blog API

Manage blog content

Organizations API

Organization management