> ## Documentation Index
> Fetch the complete documentation index at: https://docs-restapi.wplimit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Services

> Retrieve a list of all services with advanced filtering, pagination, and sorting options.

## Query Parameters

<ParamField query="search" type="string">
  Search services by name, short description, or description
</ParamField>

<ParamField query="name" type="string">
  Filter by exact service name
</ParamField>

<ParamField query="status" type="string">
  Filter by service status (active, disabled)
</ParamField>

<ParamField query="category_id" type="integer">
  Filter by service category ID
</ParamField>

<ParamField query="location_id" type="integer">
  Filter services by location ID (shows only services available at this location)
</ParamField>

<ParamField query="agent_id" type="integer">
  Filter services by agent ID (shows only services provided by this agent)
</ParamField>

<ParamField query="visibility" type="string">
  Filter by visibility (visible, hidden)
</ParamField>

<ParamField query="price_min" type="number">
  Minimum price filter
</ParamField>

<ParamField query="price_max" type="number">
  Maximum price filter
</ParamField>

<ParamField query="duration_min" type="integer">
  Minimum duration in minutes
</ParamField>

<ParamField query="duration_max" type="integer">
  Maximum duration in minutes
</ParamField>

<ParamField query="created_after" type="string">
  Filter services created after this date (YYYY-MM-DD format)
</ParamField>

<ParamField query="created_before" type="string">
  Filter services created before this date (YYYY-MM-DD format)
</ParamField>

<ParamField query="updated_after" type="string">
  Filter services updated after this date (YYYY-MM-DD format)
</ParamField>

<ParamField query="updated_before" type="string">
  Filter services updated before this date (YYYY-MM-DD format)
</ParamField>

<ParamField query="per_page" type="integer" default="10">
  Number of services per page (1-100)
</ParamField>

<ParamField query="page" type="integer" default="1">
  Page number for pagination
</ParamField>

<ParamField query="order_by" type="string" default="id">
  Field to order by (id, name, price, duration, created\_date, updated\_date)
</ParamField>

<ParamField query="order" type="string" default="ASC">
  Sort direction (ASC, DESC)
</ParamField>

<ParamField query="include" type="string">
  Include related data (comma-separated: category, agents, locations)
</ParamField>

## Example Requests

### Basic Request

```bash theme={null}
GET /wp-json/latepoint-api/v1/services
X-API-Key: YOUR_API_KEY
```

### Search Services

```bash theme={null}
GET /wp-json/latepoint-api/v1/services?search=test&per_page=2
X-API-Key: YOUR_API_KEY
```

### Filter with Multiple Parameters

```bash theme={null}
GET /wp-json/latepoint-api/v1/services?status=active&per_page=3&include=category,agents
X-API-Key: YOUR_API_KEY
```

### Price Range Filter

```bash theme={null}
GET /wp-json/latepoint-api/v1/services?price_min=50&price_max=200&order_by=charge_amount&order=ASC
X-API-Key: YOUR_API_KEY
```

### Duration and Date Filters

```bash theme={null}
GET /wp-json/latepoint-api/v1/services?duration_min=30&duration_max=120&created_after=2024-01-01
X-API-Key: YOUR_API_KEY
```

### Filter by Location

```bash theme={null}
GET /wp-json/latepoint-api/v1/services?location_id=2
X-API-Key: YOUR_API_KEY
```

### Filter by Agent

```bash theme={null}
GET /wp-json/latepoint-api/v1/services?agent_id=1
X-API-Key: YOUR_API_KEY
```

### Combined Location and Agent Filter

```bash theme={null}
GET /wp-json/latepoint-api/v1/services?location_id=2&agent_id=1&status=active
X-API-Key: YOUR_API_KEY
```

## Response Example

### Basic Response

```json theme={null}
{
  "success": true,
  "data": [
    {
      "id": "2",
      "name": "General Consultation",
      "short_description": "Standard medical consultation",
      "description": null,
      "duration": "60",
      "price_min": "23.0000",
      "price_max": "23.0000",
      "charge_amount": "23.0000",
      "deposit_amount": "0.0000",
      "capacity_min": "1",
      "capacity_max": "1",
      "order_number": "2",
      "selection_image_id": "0",
      "status": "active",
      "visibility": "visible",
      "category_id": "0",
      "customer_limit": "visible",
      "created_at": "2025-08-18 07:58:53",
      "updated_at": "2025-08-18 07:58:53"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 10,
    "total": 4,
    "total_pages": 1,
    "has_next_page": false,
    "has_previous_page": false
  }
}
```

### With `include=category,agents`

```json theme={null}
{
  "success": true,
  "data": [
    {
      "id": "2",
      "name": "General Consultation",
      "charge_amount": "23.0000",
      "status": "active",
      "category": {
        "id": 1,
        "name": "Category Name",
        "short_description": "Category description"
      },
      "agents": [
        {
          "id": "1",
          "first_name": "Pao",
          "last_name": "Campo",
          "display_name": "Agente Pao"
        }
      ]
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 10,
    "total": 4,
    "total_pages": 1,
    "has_next_page": false,
    "has_previous_page": false
  }
}
```

<Note>
  The `customer_limit` field is always present in the response. Use `include=category` to embed category data and `include=agents` for agent data per service. Use `include=categories` to append all service categories to the root of the response.
</Note>
