# Update food menus

Updates a food menus.

```http
PUT https://api.pozy.ai/v1/accounts/{accountId}/gmb-food-menus
```

- Area: Google Business / Google Business Food Menus
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `accountId` (string, required)

## Query parameters

- `locationId` (string)

## Request body

Content type: `application/json`

- `menus`, array of object, required
  - `labels`, array of object, required: At least 1 item
    - `displayName`, string, required
    - `description`, string
    - `languageCode`, string
  - `sections`, array of object
    - `labels`, array of object, required: At least 1 item
      - `displayName`, string, required
      - `description`, string
      - `languageCode`, string
    - `items`, array of object
      - `labels`, array of object, required: At least 1 item
        - `displayName`, string, required
        - `description`, string
        - `languageCode`, string
      - `attributes`, object
        - `price`, object
          - `currencyCode`, string, required
          - `units`, string, required
          - `nanos`, integer
        - `spiciness`, string: One of `SPICINESS_UNSPECIFIED`, `MILD`, `MEDIUM`, `HOT`
        - `allergen`, array of string
        - `dietaryRestriction`, array of string
        - `servesNumPeople`, integer: At least 1
        - `preparationMethods`, array of string
        - `mediaKeys`, array of string
      - `options`, array of object
        - `labels`, array of object, required: At least 1 item
          - `displayName`, string, required
          - `description`, string
          - `languageCode`, string
        - `attributes`, object, required
          - `price`, object
            - `currencyCode`, string, required
            - `units`, string, required
            - `nanos`, integer
          - `spiciness`, string: One of `SPICINESS_UNSPECIFIED`, `MILD`, `MEDIUM`, `HOT`
          - `allergen`, array of string
          - `dietaryRestriction`, array of string
          - `servesNumPeople`, integer: At least 1
          - `preparationMethods`, array of string
          - `mediaKeys`, array of string
  - `cuisines`, array of string
  - `sourceUrl`, string (URL)
- `updateMask`, string

## Example request

```bash
curl -X PUT "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/gmb-food-menus" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "menus": [
    {
      "labels": [
        {
          "displayName": "Acme"
        }
      ]
    }
  ]
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/gmb-food-menus", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    menus: [
      {
        labels: [
          {
            displayName: "Acme"
          }
        ]
      }
    ]
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.put(
    "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/gmb-food-menus",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "menus": [
            {
                "labels": [
                    {
                        "displayName": "Acme",
                    },
                ],
            },
        ],
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `success`, boolean
- `accountId`, string
- `locationId`, string
- `name`, string
- `menus`, array of object
  - `labels`, array of object, required: At least 1 item
    - `displayName`, string, required
    - `description`, string
    - `languageCode`, string
  - `sections`, array of object
    - `labels`, array of object, required: At least 1 item
      - `displayName`, string, required
      - `description`, string
      - `languageCode`, string
    - `items`, array of object
      - `labels`, array of object, required: At least 1 item
        - `displayName`, string, required
        - `description`, string
        - `languageCode`, string
      - `attributes`, object
        - `price`, object
          - `currencyCode`, string, required
          - `units`, string, required
          - `nanos`, integer
        - `spiciness`, string: One of `SPICINESS_UNSPECIFIED`, `MILD`, `MEDIUM`, `HOT`
        - `allergen`, array of string
        - `dietaryRestriction`, array of string
        - `servesNumPeople`, integer: At least 1
        - `preparationMethods`, array of string
        - `mediaKeys`, array of string
      - `options`, array of object
        - `labels`, array of object, required: At least 1 item
          - `displayName`, string, required
          - `description`, string
          - `languageCode`, string
        - `attributes`, object, required
          - `price`, object
            - `currencyCode`, string, required
            - `units`, string, required
            - `nanos`, integer
          - `spiciness`, string: One of `SPICINESS_UNSPECIFIED`, `MILD`, `MEDIUM`, `HOT`
          - `allergen`, array of string
          - `dietaryRestriction`, array of string
          - `servesNumPeople`, integer: At least 1
          - `preparationMethods`, array of string
          - `mediaKeys`, array of string
  - `cuisines`, array of string
  - `sourceUrl`, string (URL)

```json
{
  "success": true,
  "accountId": "696e0b682d0a31188e7a2ba9",
  "locationId": "6e99c3dd69982b334a43b0b2",
  "name": "Acme",
  "menus": [
    {
      "labels": [
        {
          "displayName": "Acme",
          "description": "A short description",
          "languageCode": "string"
        }
      ],
      "sections": [
        {
          "labels": [
            {
              "displayName": "Acme",
              "description": "A short description",
              "languageCode": "string"
            }
          ],
          "items": [
            {
              "labels": [
                {}
              ],
              "attributes": {
                "price": {},
                "spiciness": "SPICINESS_UNSPECIFIED",
                "allergen": [],
                "dietaryRestriction": [],
                "servesNumPeople": 1,
                "preparationMethods": [],
                "mediaKeys": []
              },
              "options": [
                {}
              ]
            }
          ]
        }
      ],
      "cuisines": [
        "string"
      ],
      "sourceUrl": "https://pozy.ai/media/example-1.jpg"
    }
  ]
}
```
