GuidesAPI EndpointsChangelog
Log In
Guides

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:

MethodDescriptionTry It!
POSTCreate a new Menu Item linked to the CategoryPOST Menu Item
PATCHUpdate a Category link on the Menu ItemPATCH Menu Item
PUTUpsert a new Menu Item linked to the CategoryPUT Menu Item

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

MethodDescriptionTry It!
GETRetrieve all CategoriesRetrieve Categories
GETRetrieve all Categories as a Taxonomy TreeRetrieve Category Tree

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



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.

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

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

🚧

Common Error

A Menu Item can only have one Root Category link.

This occurs when the category_ids or category_namesprovided 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 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_ids 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:

// 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:

"category_ids": [1, 2, 3]

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

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

What’s Next

Learn how to Link a Brand