Service Types
Define and manage categories of services
Overview
Service Types define the categories of work your organization performs. They provide default pricing, durations, and integrate with QuickBooks for accounting. Types can be organized by category and customized with colors for visual identification.
List Service Types
Retrieve all service types for the organization.
query InfiniteTypes($first: Int!, $after: String, $filter: TypeFilter) {
infiniteTypes(first: $first, after: $after, filter: $filter) {
edges {
node {
id
name
category
defaultPrice
defaultDuration
isActive
sortOrder
color
}
cursor
}
pageInfo {
hasNextPage
endCursor
}
}
}
# Variables
{
"first": 50,
"filter": {
"isActive": true,
"category": "MAINTENANCE"
}
}Response:
{
"data": {
"infiniteTypes": {
"edges": [
{
"node": {
"id": "type_001",
"name": "Weekly Pool Cleaning",
"category": "MAINTENANCE",
"defaultPrice": 75.00,
"defaultDuration": 45,
"isActive": true,
"sortOrder": 1,
"color": "#4F46E5"
},
"cursor": "eyJpZCI6InR5cGVfMDAxIn0="
},
{
"node": {
"id": "type_002",
"name": "Chemical Balance",
"category": "MAINTENANCE",
"defaultPrice": 50.00,
"defaultDuration": 30,
"isActive": true,
"sortOrder": 2,
"color": "#10B981"
},
"cursor": "eyJpZCI6InR5cGVfMDAyIn0="
}
],
"pageInfo": {
"hasNextPage": true,
"endCursor": "eyJpZCI6InR5cGVfMDAyIn0="
}
}
}
}Get Single Service Type
Retrieve a single service type by ID.
query Type($selector: TypeSelector!) {
type(selector: $selector) {
id
name
description
category
defaultPrice
defaultDuration
isActive
sortOrder
color
quickbooksId
createdAt
updatedAt
}
}
# Variables
{
"selector": {
"id": "type_001"
}
}Response:
{
"data": {
"type": {
"id": "type_001",
"name": "Weekly Pool Cleaning",
"description": "Standard weekly pool maintenance including skimming, brushing, and chemical testing",
"category": "MAINTENANCE",
"defaultPrice": 75.00,
"defaultDuration": 45,
"isActive": true,
"sortOrder": 1,
"color": "#4F46E5",
"quickbooksId": "QB-ITEM-001",
"createdAt": "2023-01-15T10:00:00Z",
"updatedAt": "2024-01-10T14:30:00Z"
}
}
}Create Service Type
Create a new service type.
mutation CreateType($input: CreateTypeInput!) {
createType(input: $input) {
id
name
category
defaultPrice
isActive
createdAt
}
}
# Variables
{
"input": {
"name": "Filter Replacement",
"description": "Replace pool filter cartridge or media",
"category": "REPAIR",
"defaultPrice": 150.00,
"defaultDuration": 60,
"color": "#F59E0B"
}
}Response:
{
"data": {
"createType": {
"id": "type_010",
"name": "Filter Replacement",
"category": "REPAIR",
"defaultPrice": 150.00,
"isActive": true,
"createdAt": "2024-01-20T09:00:00Z"
}
}
}Update Service Type
Update an existing service type.
mutation UpdateType($id: ID!, $input: UpdateTypeInput!) {
updateType(id: $id, input: $input) {
id
name
defaultPrice
isActive
updatedAt
}
}
# Variables
{
"id": "type_001",
"input": {
"defaultPrice": 80.00,
"description": "Updated weekly maintenance service"
}
}Response:
{
"data": {
"updateType": {
"id": "type_001",
"name": "Weekly Pool Cleaning",
"defaultPrice": 80.00,
"isActive": true,
"updatedAt": "2024-01-20T10:00:00Z"
}
}
}REST Endpoints
Export and import service types.
GET
/types/export/csvExport service types to CSV format
curl -X GET "https://api.poolservicemanager.com/types/export/csv" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-o service-types.csvPOST
/types/import/excelImport service types from Excel file
curl -X POST "https://api.poolservicemanager.com/types/import/excel" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-F "file=@service-types.xlsx"Field Reference
| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier |
name | String! | Service type name |
description | String(nullable) | Type description |
category | ServiceCategory! | Category (MAINTENANCE, REPAIR, INSTALLATION, OTHER) |
defaultPrice | Float(nullable) | Default price for this type |
defaultDuration | Int(nullable) | Default duration in minutes |
isActive | Boolean! | Whether the type is active |
sortOrder | Int! | Display sort order |
color | String(nullable) | Display color (hex code) |
quickbooksId | String(nullable) | QuickBooks item ID |
createdAt | DateTime! | Creation timestamp |
updatedAt | DateTime! | Last update timestamp |