跳到导航

创建服务

Create a new service

请求头

xi-api-keystring可选
xi-workspace-idstring必需

经销商 API 密钥操作的客户工作区。

请求

This endpoint expects an object.
namestring必需

向客户和接待员显示的服务名称。

pricing_modeenum可选默认为 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’.

允许的值:
intake_questionslist of objects可选

智能体在预订或订购此项目之前提出的问题。对于实用的 pricing_mode='quote' 项目,此项必填——否则报价请求中没有可供定价的信息——但也适用于需要补充详情的固定价格项目(例如染发前询问当前发色、护理前询问过敏情况)。

groupslist of objects可选

此项目的分组成员关系。每个条目包含分组标签及该项目在组内从 0 开始的排名。

ungrouped_rankinteger or null可选>=0

无分组项目中的显示位置;null 排在最后。可通过重新排序端点更改。

descriptionstring可选

Details about the service for customers and the receptionist; empty string means none.

variantslist of objects可选

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.

kindenum可选默认为 classic

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

允许的值:
buffer_minutesinteger可选0-1440默认为 0

每次预约后预留的周转/清洁时间。适用于所有服务类型;默认值 0 表示无缓冲时间。

service_locationenum可选默认为 business

服务提供地点。business = 客户前往营业地点(默认);customer = 员工前往客户所在地。仅对 kind='classic' 有意义。

允许的值:
add_onslist of objects可选
Optional extras that can be added to a booking of this service.
max_participantsinteger or null可选2-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 null可选

Not used to limit bookings; set max_participants on group services instead.

is_activeboolean可选默认为 true

是否提供该服务;停用的服务无法预约。

any_staff_memberboolean可选默认为 true

是否任意员工均可提供该服务。设为 false 时,只有 staff_ids 中的员工可以提供。租赁服务会忽略此项。

staff_idslist of strings可选

分配给此服务的员工;当 kind=‘rental’ 时必须为空。

asset_idslist of strings可选
Assets, such as rooms or equipment, this service can be booked on.
advance_booking_minutesinteger可选0-525600默认为 1440

面向客户的渠道(公开预订页面、语音智能体)最远可提前多久预订此服务。适用于所有类型。

location_idslist of strings可选

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

display_on_booking_pageboolean可选默认为 true

该服务是否列在公开预约页面上。

travel_minutesinteger可选0-480默认为 0

为客户地点服务在预约前后添加的出行时间(分钟)。会占用员工日历,但客户不可见。service_location='business' 时忽略。

travel_beforeboolean可选默认为 true

Add travel time before the appointment (outbound trip).

travel_afterboolean可选默认为 true

Add travel time after the appointment (return trip).

promotionslist of objects可选

适用于此服务或特定变体的限时折扣。

响应

成功响应

namestring

向客户和接待员显示的服务名称。

variantslist of objects

Bookable options for this service; variants[0] is the default.

idstring

服务 ID。

duration_minutesinteger只读

第一个变体的时长。

pricedouble or null只读

第一个变体的价格。

pricing_modeenum可选默认为 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’.

允许的值:
intake_questionslist of objects可选

智能体在预订或订购此项目之前提出的问题。对于实用的 pricing_mode='quote' 项目,此项必填——否则报价请求中没有可供定价的信息——但也适用于需要补充详情的固定价格项目(例如染发前询问当前发色、护理前询问过敏情况)。

groupslist of objects可选

此项目的分组成员关系。每个条目包含分组标签及该项目在组内从 0 开始的排名。

ungrouped_rankinteger or null可选>=0

无分组项目中的显示位置;null 排在最后。可通过重新排序端点更改。

descriptionstring可选

Details about the service for customers and the receptionist; empty string means none.

kindenum可选默认为 classic

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

允许的值:
buffer_minutesinteger可选0-1440默认为 0

每次预约后预留的周转/清洁时间。适用于所有服务类型;默认值 0 表示无缓冲时间。

service_locationenum可选默认为 business

服务提供地点。business = 客户前往营业地点(默认);customer = 员工前往客户所在地。仅对 kind='classic' 有意义。

允许的值:
add_onslist of objects可选
Optional extras that can be added to a booking of this service.
max_participantsinteger or null可选2-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 null可选

Not used to limit bookings; set max_participants on group services instead.

is_activeboolean可选默认为 true

是否提供该服务;停用的服务无法预约。

any_staff_memberboolean可选默认为 true

是否任意员工均可提供该服务。设为 false 时,只有 staff_ids 中的员工可以提供。租赁服务会忽略此项。

staff_idslist of strings可选

分配给此服务的员工;当 kind=‘rental’ 时必须为空。

asset_idslist of strings可选
Assets, such as rooms or equipment, this service can be booked on.
advance_booking_minutesinteger可选0-525600默认为 1440

面向客户的渠道(公开预订页面、语音智能体)最远可提前多久预订此服务。适用于所有类型。

location_idslist of strings可选

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

display_on_booking_pageboolean可选默认为 true

该服务是否列在公开预约页面上。

travel_minutesinteger可选0-480默认为 0

为客户地点服务在预约前后添加的出行时间(分钟)。会占用员工日历,但客户不可见。service_location='business' 时忽略。

travel_beforeboolean可选默认为 true

Add travel time before the appointment (outbound trip).

travel_afterboolean可选默认为 true

Add travel time after the appointment (return trip).

promotionslist of objects可选

适用于此服务或特定变体的限时折扣。

created_at_unixinteger可选

创建时间,以秒为单位的 Unix 时间戳。

updated_at_unixinteger可选

上次更新时间,以秒为单位的 Unix 时间戳。

错误

422
Unprocessable Entity Error