Change a service plan
const url = 'https://example.com/service-plans/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f';const options = { method: 'PATCH', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"name":"example","intervalMonths":1,"nextFrom":"last_service","dueRule":"day","startFrom":"installed","startField":"example","itemTypeIds":["019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Request Bodyrequired
Section titled “Request Bodyrequired”object
Last_service: the next date counts from the day the service was done. anniversary: the dates stay fixed from the first one.
Day: due on the date. month: due within the month; the date held is the 1st of the month.
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.
Responses
Section titled “Responses”Changed
object
UUID v7
Last_service: the next date counts from the day the service was done. anniversary: the dates stay fixed from the first one.
Day: due on the date. month: due within the month; the date held is the 1st of the month.
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.
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
object
Example
{ "error": "not_found", "message": "Customer not found"}Not an owner or admin, missing scope, or the plan does not open Equipment servicing
object
Example
{ "error": "not_found", "message": "Customer not found"}Not found, or Equipment servicing is not available to this business
object
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
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}