新增服務

商家可以在商家檔案中新增提供的服務,這可能包括店內提供的服務,或是消費者在店內提供的服務。

資格與格式

並非所有商家都能在商家檔案資訊中加入服務,如要檢查適用資格,請在「中繼資料」中查看 canModifyServiceList 的狀態。

服務會以 ServiceItem 表示,支援下列兩種格式:

按照類別名稱列出預先定義的服務

如要按照類別名稱,在某個類別下搜尋預先定義的服務,請使用 categories.list。針對在新加坡境內所有包含 salon 名稱的類別,系統會在以下「要求」部分顯示要求。

要求

CategoryView 必須設為 FULL

HTTP
GET https://mybusinessbusinessinformation.googleapis.com/v1/categories?regionCode=SG&languageCode=EN&filter=displayname=salon&view=FULL

回應

以下部分回應會傳回所有支援的 ServiceTypes

{
    "categories": [
        {
            "name": "gcid:hair_salon",
            "displayName": "Hairdresser",
            "serviceTypes": [
                {
                    "serviceTypeId": "job_type_id:body_waxing",
                    "displayName": "Body Waxing"
                },
                {
                    "serviceTypeId": "job_type_id:hair_coloring",
                    "displayName": "Hair coloring"
                },
                {
                    "serviceTypeId": "job_type_id:hair_extensions",
                    "displayName": "Hair extensions"
                },
                {
                    "serviceTypeId": "job_type_id:hair_styling",
                    "displayName": "Hair styling"
                },
                {
                    "serviceTypeId": "job_type_id:manicures",
                    "displayName": "Manicures"
                },
                {
                    "serviceTypeId": "job_type_id:pedicures",
                    "displayName": "Pedicures"
                }
            ]
        }
}

依類別 ID 列出預先定義的服務

如要按照特定類別 ID 搜尋預先定義的服務,請使用 categories.batchGet。美國類別 ID gcid:electrician 下方的詳細資料要求會顯示在下列「要求」部分中。

要求

CategoryView 必須設為 FULL

HTTP
GET https://mybusinessbusinessinformation.googleapis.com/v1/categories:batchGet?regionCode=US&languageCode=en&names=gcid:electrician&view=FULL

回應

回應包含 gcid:electrician 支援的所有 ServiceTypes

{
    "categories": [
        {
            "name": "gcid:electrician",
            "displayName": "Electrician",
            "serviceTypes": [
                {
                    "serviceTypeId": "job_type_id:construction",
                    "displayName": "Construction"
                },
                {
                    "serviceTypeId": "job_type_id:electric_car_charger",
                    "displayName": "Install electric car charger"
                },
                {
                    "serviceTypeId": "job_type_id:electrician_remodeling",
                    "displayName": "Remodeling"
                },
                {
                    "serviceTypeId": "job_type_id:general_repairs",
                    "displayName": "General repairs"
                },
                {
                    "serviceTypeId": "job_type_id:install_fan",
                    "displayName": "Install fan"
                },
                {
                    "serviceTypeId": "job_type_id:install_ground_wire",
                    "displayName": "Install ground wire"
                },
                {
                    "serviceTypeId": "job_type_id:install_light_fixtures",
                    "displayName": "Install light fixtures"
                },
                {
                    "serviceTypeId": "job_type_id:install_outdoor_lighting",
                    "displayName": "Install outdoor lighting"
                },
                {
                    "serviceTypeId": "job_type_id:install_outlets_switches",
                    "displayName": "Install outlets or switches"
                },
                {
                    "serviceTypeId": "job_type_id:install_security_system",
                    "displayName": "Install security system"
                },
                {
                    "serviceTypeId": "job_type_id:installation",
                    "displayName": "Installation"
                },
                {
                    "serviceTypeId": "job_type_id:relocate_outlets_switches",
                    "displayName": "Relocate outlets or switches"
                },
                {
                    "serviceTypeId": "job_type_id:repair_fan",
                    "displayName": "Repair fan"
                },
                {
                    "serviceTypeId": "job_type_id:repair_light_fixtures",
                    "displayName": "Repair light fixtures"
                },
                {
                    "serviceTypeId": "job_type_id:repair_outlets_switches",
                    "displayName": "Repair outlets or switches"
                },
                {
                    "serviceTypeId": "job_type_id:repair_panel",
                    "displayName": "Repair panel"
                },
                {
                    "serviceTypeId": "job_type_id:replace_upgrade_panel",
                    "displayName": "Replace or upgrade panel"
                },
                {
                    "serviceTypeId": "job_type_id:restore_power",
                    "displayName": "Restore power"
                }
            ]
        }
    ]
}

在商家資訊中列出現有服務

如要取得目前的服務清單,請使用 locations.get 並設定 readMask=serviceItems

要求

HTTP
GET https://mybusinessbusinessinformation.googleapis.com/v1/locations/{locationId}?readMask=serviceItems

回應

以下是回應範例

{
    "serviceItems": [
        {
            "structuredServiceItem": {
                "serviceTypeId": "job_type_id:hair_coloring"
            }
        },
        {
            "isOffered": true,
            "structuredServiceItem": {
                "serviceTypeId": "job_type_id:hair_styling"
            }
        },
        {
            "isOffered": true,
            "freeFormServiceItem": {
                "categoryId": "gcid:barber_shop",
                "label": {
                    "displayName": "Student Cuts"
                }
            }
        }
    ]
}

為商家資訊設定服務

如要更新服務,請使用 locations.patchupdateMask=serviceItems。系統不支援更新個別服務。

如要透過 StructuredServiceItemFreeFormServiceItem 設定服務,請參閱以下範例:

HTTP
PATCH
https://mybusinessbusinessinformation.googleapis.com/v1/locations/{locationId}?updateMask=serviceItems
{
   "serviceItems":[
      {
         "isOffered":false,
         "structuredServiceItem":{
            "serviceTypeId":"job_type_id:hair_coloring"
         }
      },
      {
         "isOffered":true,
         "structuredServiceItem":{
            "serviceTypeId":"job_type_id:hair_styling"
         }
      },
      {
         "isOffered":true,
         "freeFormServiceItem":{
            "categoryId":"gcid:hair_salon",
            "label":{
               "displayName":"Student Cuts"
            }
         }
      }
   ]
}