ServiceKeel.Developers
All 9 chapters · Code and API details

CHAPTER 06 OF 8

Plan recurring service with the caller

Use existing membership and equipment context to arrange ongoing maintenance without implying that future dates are already booked.

1. Check memberships and equipment

Before offering maintenance, retrieve the customer’s memberships and the equipment at the confirmed service location. Explain the benefits actually attached to the membership. Do not assume a discount, coverage, or renewal is available just because a membership record exists.

The integration seeds one synthetic membership and one heat pump through the business owner’s session. The receptionist reads those records with its OAuth token.

GET/field_service/memberships

List memberships

Parameters from the API specification
NameLocationType / schema
searchquerystring
statusquerystring
customer_idquerystring
property_idquerystring
job_idquerystring
limitqueryinteger
offsetqueryinteger
created_afterquerystring
created_beforequerystring

Documented responses: 200 401 403

Open full API reference
GET/field_service/equipment

List tenant service-location equipment

Parameters from the API specification
NameLocationType / schema
customer_idquerystring
property_idquerystring
location_idquerystring
addressquerystring
postal_codequerystring
limitqueryinteger
equipment_typequerystring
cursorquerystring

Documented responses: 200 400 401 403 409 500

Open full API reference
GET/field_service/recurring_services

List tenant recurring services

Parameters from the API specification
NameLocationType / schema
customer_idquerystring
property_idquerystring
location_idquerystring
searchquerystring
statusquerystring
activequeryboolean
assigned_user_idquerystring
service_idquerystring
starts_afterquerystring
ends_beforequerystring
created_afterquerystring
created_beforequerystring
limitqueryinteger
offsetqueryinteger

Documented responses: 200 400 401 403 500

Open full API reference
Load context for a maintenance conversation
const memberships = await api('GET', '/memberships?customer_id=' + customer.id);
const equipment = await api('GET', '/equipment?' + new URLSearchParams({
  customer_id: customer.id, property_id: location.id,
}));
const plans = await api('GET', '/recurring_services?customer_id=' + customer.id);
// Check existing plans before proposing a new series.
JavaScript · server side

2. Confirm the cadence and create the series

Confirm the scope, start date, cadence, number of occurrences, and authorized price. This example creates three monthly maintenance dates at $75 per visit. Use values approved for the business rather than carrying this example’s price into production.

A planned service date is not a booked appointment.

Recurring service returns planned dates. Use availability and the visit-booking flow to reserve staff and times for individual appointments. Tell the caller which parts are planned and which are confirmed.

POST/field_service/recurring_services

Create a tenant recurring service

Parameters from the API specification
NameLocationType / schema
recordrequiredbodymodels.FieldServiceRecord

Documented responses: 201 400 401 403 409 500

Open full API reference
Create a caller-approved maintenance series
const recurring = await api('POST', '/recurring_services', {
  title: 'Monthly heat-pump maintenance',
  customer_id: customer.id, property_id: location.id,
  starts_at: callerConfirmedStart,
  recurrence: {
    frequency: 'monthly', interval: 1, count: 3, billing_mode: 'per_visit',
  },
  line_items: [{ name: 'Maintenance', quantity: 1, unit_price_cents: 7500 }],
});
// Inspect recurring.upcoming_service_dates, then book visits separately.
JavaScript · server side
The receptionist reports existing memberships and equipment, then explains that three monthly dates are planned.
FROM THE WORKING EXAMPLE

The wording distinguishes planned recurrence from reserved appointments.

Select the image to view it at full size.