服務實體

Service 實體定義餐廳提供的餐點訂購服務,例如外帶或外送。定義 Service 實體時,請使用 Service 類型。每間餐廳都必須連結至至少一個外帶或外送類型的服務實體,最多兩個服務實體 (一個外帶和一個外送類型)。

服務實體關係圖
圖 1:服務實體顯示與 ServiceArea、ServiceHours、OperationHours 和 Fee 實體的關係。

服務實體會定義服務類型、營業時間和服務地區等屬性。服務實體會隨著每次資料動態饋給上傳而變更及重新整理。

服務實體範例

以下範例定義了每天接受訂單的基本 Service 實體。

{
  "@type":"Service",
  "@id":"takeout_1",
  "serviceType":"TAKEOUT",
  "menuId":"menu_1",
  "restaurantId":"restaraunt_1"
}
{
  "@type":"OperationHours",
  "@id":"takeout_1_op_hours",
  "serviceId":"takeout_1",
  "opens":"00:00",
  "closes":"23:59"
}
{
  "@type":"ServiceHours",
  "@id":"takeout_1_service_hours",
  "orderType":"ASAP",
  "serviceId":"takeout_1",
  "operationHoursId":"takeout_1_op_hours",
  "opens":"11:00",
  "closes":"21:00",
  "dayOfWeek":["MONDAY","TUESDAY","WEDNESDAY","THURSDAY", "FRIDAY", "SATURDAY"],
  "leadTimeMin":"20",
  "leadTimeMax":"20",
  "isSpecialHour":false
}
{
  "@type":"ServiceHours",
  "@id":"takeout_1_service_hours_sun",
  "orderType":"ASAP",
  "serviceId":"takeout_1",
  "operationHoursId":"takeout_1_op_hours",
  "opens":"16:00",
  "closes":"21:00",
  "dayOfWeek":["SUNDAY"],
  "leadTimeMin":"20",
  "leadTimeMax":"20",
  "isSpecialHour":false
}
{
  "@type":"Service",
  "@id":"delivery_1",
  "serviceType":"DELIVERY",
  "menuId":"10824",
  "restaurantId":"10824"
}
{
  "@type":"OperationHours",
  "@id":"delivery_1_op_hours",
  "serviceId":"delivery_1",
  "opens":"00:00",
  "closes":"23:59"
}
{
  "@type":"ServiceHours",
  "@id":"delivery_1_service_hours",
  "orderType":"ASAP",
  "serviceId":"delivery_1",
  "operationHoursId":"delivery_1_op_hours",
  "opens":"11:00",
  "closes":"21:00",
  "dayOfWeek":["MONDAY","TUESDAY","WEDNESDAY","THURSDAY", "FRIDAY", "SATURDAY",
  "SUNDAY"],
  "leadTimeMin":"50",
  "leadTimeMax":"50",
  "isSpecialHour":false
}
{
  "@type":"ServiceArea",
  "@id":"delivery_1_service_area",
  "serviceId":"delivery_1",
  "polygon":["37.4818562 -122.25801303 37.48247836 -122.25801303 37.48434484
  -122.25621319 37.48621133 -122.25424681 37.49181077 -122.24704744 37.49305509
  -122.24541414 37.49429942 -122.2436143 37.49803238 -122.23821477 37.49803238
  -122.21285044 37.49367726 -122.15885517 37.49056645 -122.15722187 37.48621133
  -122.15542202 37.48558917 -122.15525548 37.4818562 -122.15525548 37.43191387
  -122.17865343 37.43191387 -122.23444854"]
}
{
  "@type":"Fee",
  "@id":"delivery_1_fee",
  "serviceId":"delivery_1",
  "feeType":"DELIVERY",
  "priceCurrency":"USD",
  "eligibleRegion":"delivery_1_service_area",
  "eligibleTransactionVolumeMin":20,
  "percentageOfCart": 7
}

ASAP 和提前數小時

使用者可以在餐廳的 ASAP ServiceHours內下達 ASAP 訂單,也可以在餐廳的 OperationHours內提早下單,以便在提前 ServiceHours內完成訂單。如要定義提前服務時間,請建立 ServiceHours 實體,並將 orderType 屬性設為 ADVANCE。如需詳細資訊和範例,請參閱「外送和自取營業時間」。

暫時停用 Service 實體

您可以設定假日和特殊營業時間,針對已知的特定時間段,暫時停用或覆寫ServiceHours。如要因不可預測的原因停用 Service 實體,請傳送即時更新要求,並將 Service 實體 isDisabled 屬性設為 true

詳情請參閱刪除及停用實體一文。