> ## Documentation Index
> Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a Menu Item

> Updates a Menu Item



## OpenAPI

````yaml /api-reference/platform.yaml patch /api/v2/platform/menu_items/{id}
openapi: 3.0.3
info:
  title: Platform API
  contact:
    name: Vendo Connect Inc.
    url: https://getvendo.com
    email: sales@getvendo.com
  description: Spree Platform API
  version: v2
servers:
  - url: http://{defaultHost}
    variables:
      defaultHost:
        default: localhost:3000
security: []
tags:
  - name: Addresses
  - name: Adjustments
  - name: Classifications
  - name: Countries
  - name: CMS Pages
  - name: CMS Sections
  - name: Digital Assets
  - name: Digital Links
  - name: Line Items
  - name: Menus
  - name: Menu Items
  - name: Option Types
  - name: Option Values
  - name: Orders
  - name: Payments
  - name: Payment Methods
  - name: Products
  - name: Promotions
  - name: Promotion Actions
  - name: Promotion Categories
  - name: Promotion Rules
  - name: Roles
  - name: Shipments
  - name: Shipping Categories
  - name: Shipping Methods
  - name: States
  - name: Stock Items
  - name: Stock Locations
  - name: Store Credit Categories
  - name: Store Credit Types
  - name: Store Credits
  - name: Tax Categories
  - name: Tax Rates
  - name: Taxons
  - name: Taxonomies
  - name: Users
  - name: Variants
  - name: Vendors
  - name: Webhook Events
  - name: Webhook Subscribers
  - name: Wishlists
  - name: Wished Items
  - name: Zones
paths:
  /api/v2/platform/menu_items/{id}:
    patch:
      tags:
        - Menu Items
      summary: Update a Menu Item
      description: Updates a Menu Item
      operationId: update-menu-item
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: include
          in: query
          description: >-
            Select which associated resources you would like to fetch, see: <a
            href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>
          example: menu,icon,parent,children,linked_resource
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update_menu_item_params'
      responses:
        '200':
          description: Record updated
          content:
            application/vnd.api+json:
              examples:
                Example:
                  value:
                    data:
                      id: '44'
                      type: menu_item
                      attributes:
                        name: Menu Item One
                        subtitle: null
                        destination: null
                        new_window: false
                        item_type: Link
                        linked_resource_type: Spree::Linkable::Uri
                        code: null
                        lft: 8
                        rgt: 9
                        depth: 1
                        created_at: '2022-11-08T19:34:25.609Z'
                        updated_at: '2022-11-08T19:34:25.857Z'
                        link: null
                        is_container: false
                        is_root: false
                        is_child: true
                        is_leaf: true
                      relationships:
                        icon:
                          data:
                            id: '47'
                            type: icon
                        menu:
                          data:
                            id: '8'
                            type: menu
                        parent:
                          data:
                            id: '40'
                            type: menu_item
                        linked_resource:
                          data: null
                        children:
                          data: []
              schema:
                $ref: '#/components/schemas/resource'
        '401':
          description: Authentication Failed
          content:
            application/vnd.api+json:
              examples:
                Example:
                  value:
                    error: The access token is invalid
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Record not found
          content:
            application/vnd.api+json:
              examples:
                Example:
                  value:
                    error: The resource you were looking for could not be found.
              schema:
                $ref: '#/components/schemas/error'
        '422':
          description: Invalid request
          content:
            application/vnd.api+json:
              examples:
                Example:
                  value:
                    error: Name can't be blank
                    errors:
                      name:
                        - can't be blank
              schema:
                $ref: '#/components/schemas/validation_errors'
      security:
        - bearer_auth: []
components:
  schemas:
    update_menu_item_params:
      type: object
      properties:
        menu_item:
          type: object
          properties:
            name:
              type: string
              example: T-Shirts
              description: Update the name of this Menu Item
            code:
              type: string
              nullable: true
              example: MEN-TS
              description: >-
                The Menu Item a code to identifies this Menu Item from others.
                This is especially useful when using Container type Menu Items
                to group items.
            subtitle:
              type: string
              nullable: true
              example: Shop men's T-Shirts
              description: >-
                Set an optional subtitle for the Menu Item, this is useful if
                your menu has promotional links that require more than just a
                link name.
            destination:
              type: string
              nullable: true
              example: https://getvendo.com
              description: 'Used when the linked_resource_type is set to: URL'
            menu_id:
              type: integer
              example: 1
              description: Specify the ID of the Menu this item belongs to.
            new_window:
              type: boolean
              description: >-
                When set to `true` the link will be opened in a new tab or
                window.
            item_type:
              type: string
              enum:
                - Link
                - Container
              description: >-
                Links are standard links, where as Containers are used to group
                links.
            linked_resource_type:
              type: string
              enum:
                - URL
                - Spree::Taxon
                - Spree::Product
                - Spree::CmsPage
              description: >-
                Change the type of resource you want to link to, or set to: URL
                to use the destination field for an external link.
            linked_resource_id:
              type: integer
              example: 1
              nullable: true
              description: The ID of the resource you are linking to.
      required:
        - menu_item
      title: Update a Menu Item
      x-internal: false
    resource:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/resource_properties'
      required:
        - data
      x-internal: false
    error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
      x-internal: false
    validation_errors:
      type: object
      properties:
        error:
          type: string
        errors:
          type: object
      required:
        - error
        - errors
      x-internal: false
    resource_properties:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
        relationships:
          type: object
      required:
        - id
        - type
        - attributes
      x-internal: false
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````