# Update menu

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.cata.sg/pos-integration-service-api/api/v-1/menus/menu-id/llms.txt.
> For full documentation content, see https://apidocs.cata.sg/pos-integration-service-api/api/v-1/menus/menu-id/llms-full.txt.

PUT http://localhost:8080/api/v1/menus/{menuId}
Content-Type: application/json

Update draft menu properties. Only provided fields are updated.

Reference: https://apidocs.cata.sg/pos-integration-service-api/api/v-1/menus/menu-id/update-menu

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/menus/{menuId}:
    put:
      operationId: update-menu
      summary: Update menu
      description: Update draft menu properties. Only provided fields are updated.
      tags:
        - >-
          subpackage_api.subpackage_api/v1.subpackage_api/v1/menus.subpackage_api/v1/menus/menuId
      parameters:
        - name: menuId
          in: path
          description: Menu UUID
          required: true
          schema:
            type: string
        - name: X-Api-Key
          in: header
          required: true
          schema:
            type: string
        - name: X-Tenant-ID
          in: header
          description: Tenant identifier
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/api_v1_menus_{menuId}_Update
                  menu_Response_200
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PutApiV1MenusMenuidRequestNotFoundError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                internalName:
                  type: string
                priority:
                  type: integer
                channelType:
                  type: string
                startDate:
                  type: string
                endDate:
                  type: string
              required:
                - name
                - internalName
                - priority
                - channelType
                - startDate
                - endDate
servers:
  - url: http://localhost:8080
components:
  schemas:
    ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuStoresItems:
      type: object
      properties:
        uuid:
          type: string
        name:
          type: string
      required:
        - uuid
        - name
      title: ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuStoresItems
    ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuOperatingHoursItems:
      type: object
      properties:
        weekday:
          type: integer
        startTime:
          type: string
        endTime:
          type: string
      required:
        - weekday
        - startTime
        - endTime
      title: >-
        ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuOperatingHoursItems
    ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuStoreOperatingHoursKey0Items:
      type: object
      properties:
        weekday:
          type: integer
        startTime:
          type: string
        endTime:
          type: string
      required:
        - weekday
        - startTime
        - endTime
      title: >-
        ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuStoreOperatingHoursKey0Items
    ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuStoreOperatingHoursKey1Items:
      type: object
      properties:
        weekday:
          type: integer
        startTime:
          type: string
        endTime:
          type: string
      required:
        - weekday
        - startTime
        - endTime
      title: >-
        ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuStoreOperatingHoursKey1Items
    ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuStoreOperatingHours:
      type: object
      properties:
        key_0:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuStoreOperatingHoursKey0Items
        key_1:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuStoreOperatingHoursKey1Items
      required:
        - key_0
        - key_1
      title: >-
        ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuStoreOperatingHours
    ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuGroupsItems:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        sortNum:
          type: integer
      required:
        - id
        - name
        - sortNum
      title: ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuGroupsItems
    ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuSectionsItemsItemsItems:
      type: object
      properties:
        id:
          type: integer
        itemId:
          type: integer
        itemCode:
          type: string
        name:
          type: string
        provider:
          type: string
        sortNum:
          type: integer
        visible:
          type: boolean
        basePrice:
          type: number
          format: double
        specialPrice:
          type: number
          format: double
        deletedAt:
          type: string
          format: date-time
      required:
        - id
        - itemId
        - itemCode
        - name
        - provider
        - sortNum
        - visible
        - basePrice
        - specialPrice
        - deletedAt
      title: >-
        ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuSectionsItemsItemsItems
    ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuSectionsItems:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        displayType:
          type: string
        sortNum:
          type: integer
        visible:
          type: boolean
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuSectionsItemsItemsItems
        createdAt:
          type: string
        updatedAt:
          type: string
      required:
        - id
        - name
        - description
        - displayType
        - sortNum
        - visible
        - items
        - createdAt
        - updatedAt
      title: >-
        ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuSectionsItems
    ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenu:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        internalName:
          type: string
        channelType:
          type: string
        priority:
          type: integer
        isPublishable:
          type: boolean
        warnings:
          type: array
          items:
            type: string
        storeCount:
          type: integer
        stores:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuStoresItems
        startDate:
          type: string
        endDate:
          type: string
        operatingHours:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuOperatingHoursItems
        storeOperatingHours:
          $ref: >-
            #/components/schemas/ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuStoreOperatingHours
        groups:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuGroupsItems
        sections:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenuSectionsItems
        createdAt:
          type: string
        updatedAt:
          type: string
        deletedAt:
          type: string
      required:
        - id
        - name
        - internalName
        - channelType
        - priority
        - isPublishable
        - warnings
        - storeCount
        - stores
        - startDate
        - endDate
        - operatingHours
        - storeOperatingHours
        - groups
        - sections
        - createdAt
        - updatedAt
        - deletedAt
      title: ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenu
    api_v1_menus_{menuId}_Update menu_Response_200:
      type: object
      properties:
        code:
          type: integer
        isSuccess:
          type: boolean
        message:
          type: string
        menu:
          $ref: >-
            #/components/schemas/ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaMenu
      required:
        - code
        - isSuccess
        - message
        - menu
      title: api_v1_menus_{menuId}_Update menu_Response_200
    ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaError:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        details:
          type: string
        field:
          type: string
      required:
        - code
        - message
        - details
        - field
      title: ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaError
    PutApiV1MenusMenuidRequestNotFoundError:
      type: object
      properties:
        error:
          $ref: >-
            #/components/schemas/ApiV1MenusMenuIdPutResponsesContentApplicationJsonSchemaError
      required:
        - error
      title: PutApiV1MenusMenuidRequestNotFoundError
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

```

## SDK Code Examples

```python api_v1_menus_{menuId}_Update menu_example
import requests

url = "http://localhost:8080/api/v1/menus/string"

payload = {
    "name": "string",
    "internalName": "string",
    "priority": 7070,
    "channelType": "delivery",
    "startDate": "string",
    "endDate": "string"
}
headers = {
    "X-Tenant-ID": "string",
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript api_v1_menus_{menuId}_Update menu_example
const url = 'http://localhost:8080/api/v1/menus/string';
const options = {
  method: 'PUT',
  headers: {
    'X-Tenant-ID': 'string',
    'X-Api-Key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"name":"string","internalName":"string","priority":7070,"channelType":"delivery","startDate":"string","endDate":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go api_v1_menus_{menuId}_Update menu_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8080/api/v1/menus/string"

	payload := strings.NewReader("{\n  \"name\": \"string\",\n  \"internalName\": \"string\",\n  \"priority\": 7070,\n  \"channelType\": \"delivery\",\n  \"startDate\": \"string\",\n  \"endDate\": \"string\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("X-Tenant-ID", "string")
	req.Header.Add("X-Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby api_v1_menus_{menuId}_Update menu_example
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/api/v1/menus/string")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Put.new(url)
request["X-Tenant-ID"] = 'string'
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"string\",\n  \"internalName\": \"string\",\n  \"priority\": 7070,\n  \"channelType\": \"delivery\",\n  \"startDate\": \"string\",\n  \"endDate\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java api_v1_menus_{menuId}_Update menu_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("http://localhost:8080/api/v1/menus/string")
  .header("X-Tenant-ID", "string")
  .header("X-Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"string\",\n  \"internalName\": \"string\",\n  \"priority\": 7070,\n  \"channelType\": \"delivery\",\n  \"startDate\": \"string\",\n  \"endDate\": \"string\"\n}")
  .asString();
```

```php api_v1_menus_{menuId}_Update menu_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'http://localhost:8080/api/v1/menus/string', [
  'body' => '{
  "name": "string",
  "internalName": "string",
  "priority": 7070,
  "channelType": "delivery",
  "startDate": "string",
  "endDate": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Api-Key' => '<apiKey>',
    'X-Tenant-ID' => 'string',
  ],
]);

echo $response->getBody();
```

```csharp api_v1_menus_{menuId}_Update menu_example
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v1/menus/string");
var request = new RestRequest(Method.PUT);
request.AddHeader("X-Tenant-ID", "string");
request.AddHeader("X-Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"string\",\n  \"internalName\": \"string\",\n  \"priority\": 7070,\n  \"channelType\": \"delivery\",\n  \"startDate\": \"string\",\n  \"endDate\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift api_v1_menus_{menuId}_Update menu_example
import Foundation

let headers = [
  "X-Tenant-ID": "string",
  "X-Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "string",
  "internalName": "string",
  "priority": 7070,
  "channelType": "delivery",
  "startDate": "string",
  "endDate": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v1/menus/string")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```