---
updatedAt: 2026-09-02T08:42:06.000Z
agentTools:
  projectIndex: https://developer.weedmaps.com/llms.txt
---

# Link Categories to a Menu Item

This link can directly improve search relevance, increase consumer engagement, and it elevates the visibility of the Menu Item within the Weedmaps ecosystem.

> 🚧 A Category link is **required**.

You can link a Categories to a Menu Item by using any of the operations below:

| Method    | Description                                   | Try It!                                                                                       |
| :-------- | :-------------------------------------------- | :-------------------------------------------------------------------------------------------- |
| **POST**  | Create a new Menu Item linked to the Category | [POST Menu Item](https://developer.weedmaps.com/v2025.07/reference/post_menu_items)           |
| **PATCH** | Update a Category link on the Menu Item       | [PATCH Menu Item](https://developer.weedmaps.com/v2025.07/reference/patch_menuitem_by_id)     |
| **PUT**   | Upsert a new Menu Item linked to the Category | [PUT Menu Item](https://developer.weedmaps.com/v2025.07/reference/put_menuitem_by_externalid) |

***

Every Menu Item **must** include at least one valid `category_id`, available via the Category operations:

| Method  | Description                                | Try It!                                          |
| :------ | :----------------------------------------- | :----------------------------------------------- |
| **GET** | Retrieve all Categories                    | [Retrieve Categories](https://developer.weedmaps.com/reference/get_categories)        |
| **GET** | Retrieve all Categories as a Taxonomy Tree | [Retrieve Category Tree](https://developer.weedmaps.com/reference/get_categoriestree) |

> You can utilize the many `filters` parameters on these operation for search and discovery.

<br />

***

### Send us the `category_ids`

* The most **reliable method**.
* Retrieves the exact Categories by its unique Weedmaps identifier.

### Send us the `category_names`

If you do not have Weedmaps Category identifiers, this additional property will attempt to match to a Category in the Weedmaps Taxonomy. Providing `category_ids` is the preferred method and will provide the best results for Menu Item and overall Menu quality.

* Weedmaps performs a **likeness search** to match the categories by name.
* Unmatched names are **silently ignored** (no error returned).

## Payload Example

> 🚧 `category_ids` and `category_names` are Mutually Exclusive
>
> If you do not have Weedmaps Category identifiers, this additional property will attempt to match to a Category in the Weedmaps Taxonomy. Providing `category_ids` is the preferred method and will provide the best results for Menu Item and overall Menu quality.

You can pass Category identifiers as the `category_ids` or `category_names` attribute in a Menu Item payload.

```json
{
	"category_ids": ["integer", "integer", "integer"],
	"category_names": "string, string, string"
}
```

<br />

```json
{
	"category_ids": [1, 2],
	"category_names": "Flower, Big Buds"
}
```

<br />

> 🚧 Common Error
>
> A Menu Item can only have one **Root Category** link.
>
> This occurs when the `category_ids` or `category_names`provided contain more than one **Root Category.**

### Sub-Categories

**To associate a sub-category, you must list *all* of its parent `category_ids`.**

Steps to Do This:

1. **Get the full Category Tree**\
   Use the **[GET Category Tree](https://developer.weedmaps.com/v2025.07/reference/get202507partnerscategoriestree)** endpoint.

   This will include:

   * `category_id`
   * `name`
   * `slug`
   * `parent_id`

2. **Locate your sub-category**

   * Find the specific `category_id` of the sub-category you want to assign.

3. **Trace the Parent Hierarchy**

   * Starting from the sub-category, traverse upward using `parent_id` until you reach the root.
   * Collect **all** the `category_id`s from this path\
     `root(L1) → sub-category (L2) → sub-category (L3)`

4. **Associate All Parent IDs**

   * When assigning the sub-category, include **all** these `category_ids`, not just the one for the sub-category itself.

#### Sub-Category Assignment Example

If you're categorizing a menu item as a **Ice Water Hash**. Our Category taxonomy tree looks like:

```json
// these are example category IDs
Concentrates (category_id: 1)
└── Solventless (category_id: 2)
    └── Ice Water Hash (category_id: 3)
```

To successfully associate you should send:

```json
"category_ids": [1, 2, 3]
```

Just the sub-category alone is insufficient and will return a `HTTP 422` Error:

```json
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Failed",
      "detail": "Categories must assign one and only one root category",
      "source": {
        "pointer": "categories"
      }
    }
  ]
}
```