**Version: 202701**

# Create menu

**POST** `/openapi/2027-01/menus`

Create a custom menu for the store.

## Request

**application/json**

**Body | Example**

**Body (required)**

- `title` string (required)

  Menu title
- `category` int32

  Menu category. This endpoint creates custom menus only (`3`); built-in menus are maintained by the platform. Defaults to `3` when omitted
- `children` object[]

  Menu items tree

  *   Array \[

  - `id` int64

    ID of an existing item in this menu. When updating, passing it updates that item in place and keeps its ID; otherwise a new item is created. Ignored when creating a menu
  - `title` string

    Menu item title
  - `target` string

    Link target, e.g. `_blank` opens in a new window
  - `disabled` int32

    Whether the item is disabled: `1` disabled, `0` enabled
  - `url_obj` object

    Link of the item; omitted means no link

    - `type` string

      Link type, e.g. `home`, `product`, `collection`, `page`, `article`, `blog`, `web`; unrecognized values are saved as no link (`0`)
    - `source_id` string

      ID of the linked resource (product, collection, page, etc.)
    - `url` string

      Link URL
  - `children` undefined[]

    Child items; can be nested to any depth
  *   \]

```json
{
  "title": "string",
  "category": 0,
  "children": [
    {
      "id": 0,
      "title": "string",
      "target": "string",
      "disabled": 0,
      "url_obj": {
        "type": "string",
        "source_id": "string",
        "url": "string"
      },
      "children": [
        null
      ]
    }
  ]
}
```

## Responses

**200**

OK

**application/json**

**Schema | Example**

**Schema**

- `code` string

  error code
- `message` string

  error message
- `data` object

  - `menu` object

    Created menu

    - `id` string

      Menu ID

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "menu": {
      "id": "string"
    }
  }
}
```
