# Set section items

> 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/sections/section-id/items/llms.txt.
> For full documentation content, see https://apidocs.cata.sg/pos-integration-service-api/api/v-1/menus/menu-id/sections/section-id/items/llms-full.txt.

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

Replace all items in a section with the provided list of product items

Reference: https://apidocs.cata.sg/pos-integration-service-api/api/v-1/menus/menu-id/sections/section-id/items/set-section-items

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/menus/{menuId}/sections/{sectionId}/items:
    put:
      operationId: set-section-items
      summary: Set section items
      description: Replace all items in a section with the provided list of product items
      tags:
        - >-
          subpackage_api.subpackage_api/v1.subpackage_api/v1/menus.subpackage_api/v1/menus/menuId.subpackage_api/v1/menus/menuId/sections.subpackage_api/v1/menus/menuId/sections/sectionId.subpackage_api/v1/menus/menuId/sections/sectionId/items
      parameters:
        - name: menuId
          in: path
          description: Menu UUID
          required: true
          schema:
            type: string
        - name: sectionId
          in: path
          description: Section 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}_sections_{sectionId}_items_Set
                  section items_Response_200
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PutApiV1MenusMenuidSectionsSectionidItemsRequestNotFoundError
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/ApiV1MenusMenuIdSectionsSectionIdItemsPutRequestBodyContentApplicationJsonSchemaItemsItems
              required:
                - items
servers:
  - url: http://localhost:8080
components:
  schemas:
    ApiV1MenusMenuIdSectionsSectionIdItemsPutRequestBodyContentApplicationJsonSchemaItemsItems:
      type: object
      properties:
        itemCode:
          type: string
        sortNum:
          type: integer
        visible:
          type: boolean
        basePrice:
          type: number
          format: double
        specialPrice:
          type: number
          format: double
      required:
        - itemCode
        - sortNum
        - visible
        - basePrice
        - specialPrice
      title: >-
        ApiV1MenusMenuIdSectionsSectionIdItemsPutRequestBodyContentApplicationJsonSchemaItemsItems
    api_v1_menus_{menuId}_sections_{sectionId}_items_Set section items_Response_200:
      type: object
      properties:
        code:
          type: integer
        isSuccess:
          type: boolean
        message:
          type: string
      required:
        - code
        - isSuccess
        - message
      title: >-
        api_v1_menus_{menuId}_sections_{sectionId}_items_Set section
        items_Response_200
    ApiV1MenusMenuIdSectionsSectionIdItemsPutResponsesContentApplicationJsonSchemaError:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        details:
          type: string
        field:
          type: string
      required:
        - code
        - message
        - details
        - field
      title: >-
        ApiV1MenusMenuIdSectionsSectionIdItemsPutResponsesContentApplicationJsonSchemaError
    PutApiV1MenusMenuidSectionsSectionidItemsRequestNotFoundError:
      type: object
      properties:
        error:
          $ref: >-
            #/components/schemas/ApiV1MenusMenuIdSectionsSectionIdItemsPutResponsesContentApplicationJsonSchemaError
      required:
        - error
      title: PutApiV1MenusMenuidSectionsSectionidItemsRequestNotFoundError
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

```

## SDK Code Examples

```python api_v1_menus_{menuId}_sections_{sectionId}_items_Set section items_example
import requests

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

payload = { "items": [
        {
            "itemCode": "string",
            "sortNum": 3476,
            "visible": False,
            "basePrice": 8670.837872716693,
            "specialPrice": 2655.112870483667
        },
        {
            "itemCode": "string",
            "sortNum": 7484,
            "visible": False,
            "basePrice": 6357.956704791199,
            "specialPrice": 8173.486583001472
        }
    ] }
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}_sections_{sectionId}_items_Set section items_example
const url = 'http://localhost:8080/api/v1/menus/string/sections/string/items';
const options = {
  method: 'PUT',
  headers: {
    'X-Tenant-ID': 'string',
    'X-Api-Key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"items":[{"itemCode":"string","sortNum":3476,"visible":false,"basePrice":8670.837872716693,"specialPrice":2655.112870483667},{"itemCode":"string","sortNum":7484,"visible":false,"basePrice":6357.956704791199,"specialPrice":8173.486583001472}]}'
};

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}_sections_{sectionId}_items_Set section items_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"items\": [\n    {\n      \"itemCode\": \"string\",\n      \"sortNum\": 3476,\n      \"visible\": false,\n      \"basePrice\": 8670.837872716693,\n      \"specialPrice\": 2655.112870483667\n    },\n    {\n      \"itemCode\": \"string\",\n      \"sortNum\": 7484,\n      \"visible\": false,\n      \"basePrice\": 6357.956704791199,\n      \"specialPrice\": 8173.486583001472\n    }\n  ]\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}_sections_{sectionId}_items_Set section items_example
require 'uri'
require 'net/http'

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

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  \"items\": [\n    {\n      \"itemCode\": \"string\",\n      \"sortNum\": 3476,\n      \"visible\": false,\n      \"basePrice\": 8670.837872716693,\n      \"specialPrice\": 2655.112870483667\n    },\n    {\n      \"itemCode\": \"string\",\n      \"sortNum\": 7484,\n      \"visible\": false,\n      \"basePrice\": 6357.956704791199,\n      \"specialPrice\": 8173.486583001472\n    }\n  ]\n}"

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

```java api_v1_menus_{menuId}_sections_{sectionId}_items_Set section items_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/sections/string/items")
  .header("X-Tenant-ID", "string")
  .header("X-Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"items\": [\n    {\n      \"itemCode\": \"string\",\n      \"sortNum\": 3476,\n      \"visible\": false,\n      \"basePrice\": 8670.837872716693,\n      \"specialPrice\": 2655.112870483667\n    },\n    {\n      \"itemCode\": \"string\",\n      \"sortNum\": 7484,\n      \"visible\": false,\n      \"basePrice\": 6357.956704791199,\n      \"specialPrice\": 8173.486583001472\n    }\n  ]\n}")
  .asString();
```

```php api_v1_menus_{menuId}_sections_{sectionId}_items_Set section items_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'http://localhost:8080/api/v1/menus/string/sections/string/items', [
  'body' => '{
  "items": [
    {
      "itemCode": "string",
      "sortNum": 3476,
      "visible": false,
      "basePrice": 8670.837872716693,
      "specialPrice": 2655.112870483667
    },
    {
      "itemCode": "string",
      "sortNum": 7484,
      "visible": false,
      "basePrice": 6357.956704791199,
      "specialPrice": 8173.486583001472
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Api-Key' => '<apiKey>',
    'X-Tenant-ID' => 'string',
  ],
]);

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

```csharp api_v1_menus_{menuId}_sections_{sectionId}_items_Set section items_example
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v1/menus/string/sections/string/items");
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  \"items\": [\n    {\n      \"itemCode\": \"string\",\n      \"sortNum\": 3476,\n      \"visible\": false,\n      \"basePrice\": 8670.837872716693,\n      \"specialPrice\": 2655.112870483667\n    },\n    {\n      \"itemCode\": \"string\",\n      \"sortNum\": 7484,\n      \"visible\": false,\n      \"basePrice\": 6357.956704791199,\n      \"specialPrice\": 8173.486583001472\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift api_v1_menus_{menuId}_sections_{sectionId}_items_Set section items_example
import Foundation

let headers = [
  "X-Tenant-ID": "string",
  "X-Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["items": [
    [
      "itemCode": "string",
      "sortNum": 3476,
      "visible": false,
      "basePrice": 8670.837872716693,
      "specialPrice": 2655.112870483667
    ],
    [
      "itemCode": "string",
      "sortNum": 7484,
      "visible": false,
      "basePrice": 6357.956704791199,
      "specialPrice": 8173.486583001472
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v1/menus/string/sections/string/items")! 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()
```