Skip to content

Change a service plan

PATCH
/service-plans/{id}
curl --request PATCH \
--url https://example.com/service-plans/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f \
--header 'Content-Type: application/json' \
--cookie __Host-bottle.session_token=<__Host-bottle.session_token> \
--data '{ "name": "example", "intervalMonths": 1, "nextFrom": "last_service", "dueRule": "day", "startFrom": "installed", "startField": "example", "itemTypeIds": [ "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" ] }'

Due dates already set stay as they are. The new rule is used from the next service on.

id
required

UUID v7

string format: uuid

Example

019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f

UUID v7

Media typeapplication/json
object
name
string
>= 1 characters <= 80 characters
intervalMonths
integer
>= 1 <= 600
nextFrom

Last_service: the next date counts from the day the service was done. anniversary: the dates stay fixed from the first one.

string
Allowed values: last_service anniversary
dueRule

Day: due on the date. month: due within the month; the date held is the 1st of the month.

string
Allowed values: day month
startFrom

What the first due date counts from. installed: the item’s installed date. field: the item’s date detail named in startField. entered: a date typed in when the plan is given to the item.

string
Allowed values: installed field entered
startField
string | null
>= 1 characters <= 60 characters
itemTypeIds
Array<string>
<= 100 items

Changed

Media typeapplication/json
object
id
required

UUID v7

string format: uuid
name
required
string
intervalMonths
required
integer
nextFrom
required

Last_service: the next date counts from the day the service was done. anniversary: the dates stay fixed from the first one.

string
Allowed values: last_service anniversary
dueRule
required

Day: due on the date. month: due within the month; the date held is the 1st of the month.

string
Allowed values: day month
startFrom
required

What the first due date counts from. installed: the item’s installed date. field: the item’s date detail named in startField. entered: a date typed in when the plan is given to the item.

string
Allowed values: installed field entered
startField
required
string | null
itemTypeIds
required
Array<string>
itemCount
required
integer

Example

{
"id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f",
"name": "Annual inspection",
"intervalMonths": 12,
"nextFrom": "last_service",
"dueRule": "day",
"startFrom": "installed",
"itemTypeIds": [
"019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f"
]
}

Not signed in

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Not an owner or admin, missing scope, or the plan does not open Equipment servicing

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Not found, or Equipment servicing is not available to this business

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Equipment servicing is switched off, other equipment already has that detail, or the cylinder already has servicing set up

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Validation failed

Media typeapplication/json
object
error
required
string
Allowed values: validation
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string

Example

{
"error": "validation",
"issues": [
{
"path": "email",
"message": "Invalid email"
}
]
}