Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Ishaq74/concordia/llms.txt

Use this file to discover all available pages before exploring further.

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:
curl "https://your-domain.com/api/admin/services/services?status=active&page=1" \
  -H "Authorization: Bearer <token>"

Query Parameters

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

Create Service

From /src/pages/api/admin/services/services.ts:136-206:
curl -X POST "https://your-domain.com/api/admin/services/services" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d @service.json

Request Body

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

Update Service

From /src/pages/api/admin/services/services.ts:208-286:
{
  "action": "update",
  "id": "svc_999",
  "slug": "professional-web-dev",
  "status": "active",
  "basePrice": "175.00",
  "isFeatured": true,
  "translations": [...],
  "media": [...]
}
Updates replace translations and media (full replacement strategy).

Other Service Actions

From /src/pages/api/admin/services/services.ts:288-371:
{
  "action": "delete",
  "id": "svc_999"
}
Duplicating creates a copy with status: "draft" and unique slug.

Service Categories

List Categories

From /src/pages/api/admin/services/categories.ts:19-99:
GET /api/admin/services/categories?all=true

Query Parameters

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

Create Category

From /src/pages/api/admin/services/categories.ts:124-155:
{
  "action": "create",
  "slug": "development",
  "name": { "fr": "Développement", "en": "Development" },
  "description": { "fr": "Services de développement" },
  "icon": "code",
  "parentId": null,
  "sortOrder": 0,
  "displayInHome": true,
  "displayInMenu": true,
  "isActive": true,
  "isFeatured": false
}

Update/Delete Category

From /src/pages/api/admin/services/categories.ts:157-216:
{
  "action": "update",
  "id": "cat_001",
  "name": { "fr": "Nouveau nom" },
  "sortOrder": 10
}
Deleting a category unlinks all services (sets categoryId to null).

Availability

List Availability Slots

From /src/pages/api/admin/services/availability.ts:13-30:
GET /api/admin/services/availability?serviceId=svc_123

Response

{
  "slots": [
    {
      "id": "slot_001",
      "serviceId": "svc_123",
      "dayOfWeek": 1,
      "startTime": "09:00",
      "endTime": "17:00",
      "isAvailable": true
    },
    {
      "dayOfWeek": 2,
      "startTime": "09:00",
      "endTime": "17:00",
      "isAvailable": true
    }
  ]
}
Day of Week: 0 = Sunday, 1 = Monday, …, 6 = Saturday

Manage Availability

From /src/pages/api/admin/services/availability.ts:36-127:
{
  "action": "create",
  "serviceId": "svc_123",
  "dayOfWeek": 1,
  "startTime": "09:00",
  "endTime": "17:00",
  "isAvailable": true
}

Bookings

List Bookings

From /src/pages/api/admin/services/bookings.ts:14-96:
GET /api/admin/services/bookings?status=confirmed&page=1

Query Parameters

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

Response

{
  "bookings": [
    {
      "id": "book_001",
      "serviceId": "svc_123",
      "customerId": "usr_456",
      "status": "confirmed",
      "bookingDate": "2024-03-15",
      "bookingTime": "14:00",
      "customerMessage": "Looking forward to it!",
      "providerResponse": "Confirmed. See you then!",
      "serviceSlug": "web-development",
      "serviceTitle": "Développement Web",
      "customerName": "Jane Smith",
      "customerEmail": "jane@example.com",
      "customerImage": "https://example.com/avatar.jpg"
    }
  ],
  "total": 25,
  "page": 1,
  "perPage": 20,
  "totalPages": 2
}

Update Booking Status

From /src/pages/api/admin/services/bookings.ts:102-154:
{
  "id": "book_001",
  "action": "confirm"
}
Method: PATCH /api/admin/services/bookings

Service Media

List Service Media

From /src/pages/api/admin/services/media.ts:20-51:
GET /api/admin/services/media?type=image&page=1

Upload Service Media

From /src/pages/api/admin/services/media.ts:57-208:
curl -X POST "https://your-domain.com/api/admin/services/media" \
  -H "Authorization: Bearer <token>" \
  -F "file=@service-image.jpg" \
  -F "alt=Service image" \
  -F "customName=web-dev-service"

Configuration

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

Update/Delete Service Media

{
  "action": "update",
  "id": "media_333",
  "caption": { "fr": "Image du service" },
  "alt": { "fr": "Photo de service web" }
}

Common Response Codes

CodeDescription
200Success
201Created
400Invalid request
403Not admin (forbidden)
404Resource not found
500Server error

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

Build docs developers (and LLMs) love