เพิ่มบริการ

ธุรกิจเพิ่มบริการที่มีให้กับข้อมูลใน Business Profile ได้ ซึ่งอาจรวมถึงบริการที่มีให้ภายในร้านค้า หรือบริการที่ให้บริการตามสถานที่ของลูกค้า

การมีสิทธิ์และรูปแบบ

มีเพียงบางธุรกิจเท่านั้นที่เพิ่มบริการลงในข้อมูล Business Profile ได้ หากต้องการตรวจสอบสิทธิ์ ให้ตรวจสอบสถานะของ canModifyServiceList ในข้อมูลเมตา

บริการจะแสดงเป็น ServiceItem ซึ่งรองรับ 2 รูปแบบต่อไปนี้

  • StructuredServiceItem: บริการที่กำหนดไว้ล่วงหน้าของ Google จะแสดงเป็น StructuredServiceItem ซึ่งมี serviceTypeId
  • FreeFormServiceItem: หากต้องการให้บริการที่กำหนดเอง ให้ใช้ FreeFormServiceItem ที่มีป้ายกำกับ

แสดงรายการบริการที่กำหนดไว้ล่วงหน้าตามชื่อหมวดหมู่

หากต้องการค้นหาบริการที่กำหนดไว้ล่วงหน้าในหมวดหมู่ตามชื่อหมวดหมู่ ให้ใช้ 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"
                }
            ]
        }
}

แสดงรายการบริการที่กำหนดไว้ล่วงหน้าตามรหัสหมวดหมู่

หากต้องการค้นหาบริการที่กำหนดไว้ล่วงหน้าตามรหัสหมวดหมู่ที่ต้องการ ให้ใช้ categories.batchGet คำขอดูรายละเอียดภายใต้รหัสหมวดหมู่ gcid:electrician ในสหรัฐอเมริกาจะแสดงในส่วนคำขอต่อไปนี้

ส่งคำขอ

ต้องตั้งค่า CategoryView เป็น FULL

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

คำตอบ

การตอบกลับมี ServiceTypes ที่รองรับทั้งหมดสำหรับ gcid:electrician

{
    "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.patch และ updateMask=serviceItems ไม่รองรับการอัปเดตแต่ละบริการ

หากต้องการตั้งค่าบริการด้วย StructuredServiceItem และ FreeFormServiceItem ให้ดูตัวอย่างต่อไปนี้

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"
            }
         }
      }
   ]
}