Przejdź do nawigacji

Create Service

Create a new service

Nagłówki

xi-api-keystringOpcjonalny
xi-workspace-idstring or nullOpcjonalny
The customer workspace a reseller's API key acts on.

Żądanie

This endpoint expects an object.
namestringWymagany
pricing_modeenumOpcjonalnyDomyślnie fixed

‘fixed’ (default): the item has a known price the agent can quote, and customers can book or order it directly. ‘quote’: the price depends on the job (renovation, catering, custom work), so no price or slot is offered; the agent collects the intake_questions and files a quote request instead. Takes effect only while quotes are enabled for the business. Group services cannot use ‘quote’.

Dozwolone wartości:
intake_questionslist of objectsOpcjonalny

Questions the agent asks before booking or ordering this item. Required for a useful pricing_mode='quote' item — without them a quote request arrives with nothing to price — but also valid on fixed-price items that need extra detail (current hair color before a dye job, allergies before a treatment).

groupslist of objectsOpcjonalny

Group memberships for this item. Each entry carries the group label and the item’s 0-based rank within that group.

ungrouped_rankinteger or nullOpcjonalny>=0

Display position among items with no group; null sorts last. Change it with the reorder endpoint.

descriptionstringOpcjonalny
variantslist of objectsOpcjonalny

Bookable options for this service. Always non-empty; variants[0] is the default option shown when callers don’t pick a specific variant. Each entry has its own duration and (optional) price, and uniqueness is keyed by duration.

kindenumOpcjonalnyDomyślnie classic

Classic = staff-delivered; rental = asset-based; group = multi-participant session.

Dozwolone wartości:
buffer_minutesintegerOpcjonalny0-1440Domyślnie 0

Turnover/cleanup time reserved after each booking. Applies to every service kind; default 0 means no buffer.

service_locationenumOpcjonalnyDomyślnie business

Where the service is delivered. business = client visits the business location (default); customer = staff travels to the client. Only meaningful for kind='classic'.

Dozwolone wartości:
add_onslist of objectsOpcjonalny
Optional extras that can be added to a booking of this service.
max_participantsinteger or nullOpcjonalny2-200

Capacity for kind='group': how many seats a single session can sell across all registrations. Must be null for classic and rental services (those are always exclusive to one client per booking).

capacityinteger or nullOpcjonalny
is_activebooleanOpcjonalnyDomyślnie true
any_staff_memberbooleanOpcjonalnyDomyślnie true
staff_idslist of stringsOpcjonalny

Staff assigned to this service; must be empty for kind=‘rental’.

asset_idslist of stringsOpcjonalny
advance_booking_minutesintegerOpcjonalny0-525600Domyślnie 1440

How far into the future customer-facing channels (public booking page, voice agent) may book this service. Applies to every kind.

location_idslist of stringsOpcjonalny

Locations where this service is offered; empty list means all locations.

display_on_booking_pagebooleanOpcjonalnyDomyślnie true
travel_minutesintegerOpcjonalny0-480Domyślnie 0

Travel time in minutes added before/after appointments for customer-location services. Blocks the staff member’s calendar but is not visible to the customer. Ignored when service_location='business'.

travel_beforebooleanOpcjonalnyDomyślnie true

Add travel time before the appointment (outbound trip).

travel_afterbooleanOpcjonalnyDomyślnie true

Add travel time after the appointment (return trip).

promotionslist of objectsOpcjonalny

Time-bound discounts applicable to this service or specific variants.

Odpowiedź

Pomyślna odpowiedź

namestring
variantslist of objects
_idstring
duration_minutesintegerTylko do odczytu
Duration of the first variant.
pricedouble or nullTylko do odczytu
Price of the first variant.
pricing_modeenumOpcjonalnyDomyślnie fixed

‘fixed’ (default): the item has a known price the agent can quote, and customers can book or order it directly. ‘quote’: the price depends on the job (renovation, catering, custom work), so no price or slot is offered; the agent collects the intake_questions and files a quote request instead. Takes effect only while quotes are enabled for the business. Group services cannot use ‘quote’.

Dozwolone wartości:
intake_questionslist of objectsOpcjonalny

Questions the agent asks before booking or ordering this item. Required for a useful pricing_mode='quote' item — without them a quote request arrives with nothing to price — but also valid on fixed-price items that need extra detail (current hair color before a dye job, allergies before a treatment).

groupslist of objectsOpcjonalny

Group memberships for this item. Each entry carries the group label and the item’s 0-based rank within that group.

ungrouped_rankinteger or nullOpcjonalny>=0

Display position among items with no group; null sorts last. Change it with the reorder endpoint.

descriptionstringOpcjonalny
kindenumOpcjonalnyDomyślnie classic

Classic = staff-delivered; rental = asset-based; group = multi-participant session.

Dozwolone wartości:
buffer_minutesintegerOpcjonalny0-1440Domyślnie 0

Turnover/cleanup time reserved after each booking. Applies to every service kind; default 0 means no buffer.

service_locationenumOpcjonalnyDomyślnie business

Where the service is delivered. business = client visits the business location (default); customer = staff travels to the client. Only meaningful for kind='classic'.

Dozwolone wartości:
add_onslist of objectsOpcjonalny
Optional extras that can be added to a booking of this service.
max_participantsinteger or nullOpcjonalny2-200

Capacity for kind='group': how many seats a single session can sell across all registrations. Must be null for classic and rental services (those are always exclusive to one client per booking).

capacityinteger or nullOpcjonalny
is_activebooleanOpcjonalnyDomyślnie true
any_staff_memberbooleanOpcjonalnyDomyślnie true
staff_idslist of stringsOpcjonalny

Staff assigned to this service; must be empty for kind=‘rental’.

asset_idslist of stringsOpcjonalny
advance_booking_minutesintegerOpcjonalny0-525600Domyślnie 1440

How far into the future customer-facing channels (public booking page, voice agent) may book this service. Applies to every kind.

location_idslist of stringsOpcjonalny

Locations where this service is offered; empty list means all locations.

display_on_booking_pagebooleanOpcjonalnyDomyślnie true
travel_minutesintegerOpcjonalny0-480Domyślnie 0

Travel time in minutes added before/after appointments for customer-location services. Blocks the staff member’s calendar but is not visible to the customer. Ignored when service_location='business'.

travel_beforebooleanOpcjonalnyDomyślnie true

Add travel time before the appointment (outbound trip).

travel_afterbooleanOpcjonalnyDomyślnie true

Add travel time after the appointment (return trip).

promotionslist of objectsOpcjonalny

Time-bound discounts applicable to this service or specific variants.

created_at_unixintegerOpcjonalny

Unix timestamp (seconds since epoch)

updated_at_unixintegerOpcjonalny

Unix timestamp (seconds since epoch)

Błędy

422
Unprocessable Entity Error