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
| Name | Location | Type / schema |
|---|---|---|
search | query | string |
status | query | string |
customer_id | query | string |
property_id | query | string |
job_id | query | string |
limit | query | integer |
offset | query | integer |
created_after | query | string |
created_before | query | string |
Documented responses: 200 401 403
GET/field_service/equipment
List tenant service-location equipment
| Name | Location | Type / schema |
|---|---|---|
customer_id | query | string |
property_id | query | string |
location_id | query | string |
address | query | string |
postal_code | query | string |
limit | query | integer |
equipment_type | query | string |
cursor | query | string |
Documented responses: 200 400 401 403 409 500
GET/field_service/recurring_services
List tenant recurring services
| Name | Location | Type / schema |
|---|---|---|
customer_id | query | string |
property_id | query | string |
location_id | query | string |
search | query | string |
status | query | string |
active | query | boolean |
assigned_user_id | query | string |
service_id | query | string |
starts_after | query | string |
ends_before | query | string |
created_after | query | string |
created_before | query | string |
limit | query | integer |
offset | query | integer |
Documented responses: 200 400 401 403 500
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 side2. 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.
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
| Name | Location | Type / schema |
|---|---|---|
recordrequired | body | models.FieldServiceRecord |
Documented responses: 201 400 401 403 409 500
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 wording distinguishes planned recurrence from reserved appointments.
Select the image to view it at full size.