음식 메뉴 업데이트

음식 메뉴를 비즈니스 정보에 추가하면 고객에게 음식점의 메뉴 옵션을 알리고 메뉴 항목에 대한 추가 정보를 제공할 수 있습니다.

비즈니스 정보의 음식 메뉴를 업데이트하려면 먼저 accounts.locations.getFoodMenus 코드를 호출합니다. 다음은 요청의 예입니다.

GET
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations/{locationId}/foodMenus

응답에는 비즈니스 정보의 현재 FoodMenus에 대한 JSON 표현이 포함됩니다. 필요에 따라 FoodMenus 객체를 수정하고 accounts.locations.updateFoodMenus를 호출합니다. 자세한 내용은 음식 메뉴 업로드 또는 교체를 참고하세요.

Google My Business API를 사용하여 다음 필드를 업데이트할 수 있습니다.

필드
이름

필수

음식의 이름입니다(예: Hamburger).

가격

필수

음식의 가격입니다.

가격 통화

필수

음식 가격의 기준 통화입니다(예: U.S. dollar).

항목 설명

선택사항

음식에 관한 간단한 설명입니다.

메뉴 섹션

선택사항

음식의 논리 그룹 (예: Breakfast, Hamburger-Fries combo.)

영양 정보

선택사항(권장)

Total Fat=3g 등의 영양 정보입니다.

인분

선택사항

음식이 몇 인분인지 나타내는 수입니다.

섭취 분량

선택사항

음식의 수량입니다. 예를 들면 다음과 같습니다. 8-piece of nuggets

준비 방법

선택사항

음식이 준비되는 특정 방법입니다.

조리법

선택사항(권장)

음식의 조리법입니다.

매운 정도

선택사항

none, mild, medium, hot 등 음식의 매운 정도입니다.

알레르기 유발 물질

선택사항(권장)

dairy, egg, fish, peanut, shellfish, soy, tree nut, wheat 등 음식의 알레르기 유발 물질입니다.

식이 제한

선택사항(권장)

halal, kosher, organic, vegan, vegetarian, gluten free 등 음식의 식이 제한입니다.

옵션

선택사항

chicken 팟타이, veggie 팟타이 등의 음식 옵션 유형입니다.

음식 사진

선택사항

음식의 사진입니다.

음식 메뉴 업로드 또는 교체

일부 위치는 음식 메뉴를 업로드할 수 없습니다.

음식 메뉴를 업로드할 수 있는 위치인지 알아보려면 locations.get 코드를 호출하여 Metadata 코드를 확인하세요. canHaveFoodMenus 코드가 true로 설정되어 있으면 음식 메뉴를 업로드할 수 있습니다.

음식 메뉴를 업로드할 수 있는 위치의 경우 accounts.locations.updateFoodMenus에 대해 PATCH 호출을 수행합니다.

다음은 모든 선택사항 필드가 포함된 요청의 예입니다.

PATCH
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations/{locationId}/foodMenus

{
   "menus": [
       {
           "cuisines": [
                "AMERICAN"
            ],
           "labels": [
               {
                   "displayName": "Menu",
                   "description": "Main Menu of my Restaurant",
                   "languageCode": "en"
               }
           ],
           "sections": [
               {
                   "labels": {
                       "displayName": "Main Dishes",
                       "languageCode": "en"
                   },
                   "items": [
                       {
                           "labels": {
                               "displayName": "Dish1",
                               "description": "Dish1 - our original dish!",
                               "languageCode": "en"
                           },
                           "attributes": {
                               "price": {
                                   "currencyCode": "USD",
                                   "units": 20
                               },
                               "dietaryRestriction": "ORGANIC",
                               "nutritionFacts": {
                                   "calories": {
                                       "lowerAmount": 400,
                                       "upperAmount": 500,
                                       "unit": "CALORIE"
                                   },
                                   "totalFat": {
                                       "lowerAmount": 95,
                                       "upperAmount": 110,
                                       "unit": "GRAM"
                                   },
                                   "cholesterol": {
                                       "lowerAmount": 100,
                                       "upperAmount": 120,
                                       "unit": "MILLIGRAM"
                                   },
                                   "sodium": {
                                       "lowerAmount": 30,
                                       "upperAmount": 45,
                                       "unit": "MILLIGRAM"
                                   },
                                   "totalCarbohydrate": {
                                       "lowerAmount": 78,
                                       "upperAmount": 92,
                                       "unit": "MILLIGRAM"
                                   },
                                   "protein": {
                                       "lowerAmount": 25,
                                       "upperAmount": 35,
                                       "unit":"MILLIGRAM"
                                   }
                               },
                               "ingredients": [
                                   {
                                       "labels": [
                                           {
                                               "displayName": "Ingredient 1",
                                               "description": "Description for ingredient 1",
                                               "languageCode": "en"
                                           },
                                           {
                                               "displayName": "Ingredient 2",
                                               "languageCode": "en"
                                           }
                                       ]
                                   }
                               ],
                               "servesNumPeople": 1,
                               "preparationMethods": [
                                   "BAKED",
                                   "BOILED",
                                   "FRIED"
                               ],
                               "portionSize": {
                                   "quantity": 2,
                                   "unit": {
                                       "displayName": "Pieces",
                                       "languageCode": "en"
                                   }
                               },
                               "mediaKeys": [
                                   "AF1QipP_VOlJzXs2aOJ31234565cb2KPrvN"
                               ]
                           },
                           "options": [
                               {
                                   "labels":
                                       {
                                           "displayName": "Dish1 - spicy",
                                           "description": "Dish1 - a spicy version of our dish!",
                                           "languageCode": "en"
                                       },
                                   "attributes": {
                                       "price": {
                                           "currencyCode": "USD",
                                           "units": 20
                                       }
                                   }
                               },
                               {
                                   "labels":
                                       {
                                           "displayName": "Dish1 - mild",
                                           "description": "Dish1 - a mild spiciness version of our dish!",
                                           "languageCode": "en"
                                       },
                                   "attributes": {
                                       "price": {
                                           "currencyCode": "USD",
                                           "units": 20
                                       }
                                   }
                               }
                           ]
                       }
                   ]
               },
               {
                   "labels": {
                       "displayName": "Desserts",
                       "languageCode": "en"
                   },
                   "items": [
                       {
                           "labels": {
                               "displayName": "Ice Cream",
                               "description": "2 scoops of delicious ice cream!",
                               "languageCode": "en"
                           },
                           "attributes": {
                               "price": {
                                   "currencyCode": "USD",
                                   "units": 20
                               }
                           }
                       }
                   ]
               }
           ]
       }
   ]
}

음식과 사진 연결

사진을 음식과 연결하려면 먼저 비즈니스 프로필 위치에 사진을 업로드해야 합니다.

사진을 가져오려면 accounts.locations.media.list 코드를 호출합니다. 다음은 요청의 예입니다.

GET
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations/{locationId}/media/

다음 예와 같이 비즈니스 정보의 각 이미지에 대한 MediaKey 코드가 응답에 포함됩니다.

{
 "mediaItems": [
   {
     "name": "accounts/{accountId}/locations/{locationId}/media/{mediaKey}",
     "mediaFormat": "PHOTO",
     "locationAssociation": {
       "category": "FOOD_AND_MENU"
     },
 …
}

사진을 음식과 연결하려면 사진의 mediaKey를 가져와서 FoodMenuItemAttributes 객체에 제공합니다. 여러 mediaKeys를 제공할 수 있습니다. 자세한 내용은 음식 메뉴 업로드 또는 교체를 참고하세요.