Set existing specification to Category

Hi!
I am developing a solution for a vtex store. And I need to asociate an existing specification to a category. But I can’t find an endpoint in the documentation that allows me do this. I find create, update, and get…but not a way to associate a existing specification to a category.

How can I associate an existing specification with a category?

Thanks!

Hi @gasgen, you can use this endpoint: Specification (vtex.com)

There is a field ‘CategoryId’ for this purpose, where you must place the id for that category (e.g. 15).

You may also check existing fields for each category with this method: Category Specification (vtex.com)

Quick update: now I read ‘existing’, so you may use the ‘PUT’ method. Specification (vtex.com)

Making a GET first could make it easier for you: Specification (vtex.com)

Hi Eduardo! Thanks for answering me. But…if I want to use the same specficiation for various categories…this endpoint doesn’t work, because this PUT “move” the spec for another category…I need to set the same specification to many categories…

Good question @gasgen!

Two scenarios:

  1. You can create a field under the root category, and then it goes for the entire taxonomy. This is common, as these fields can be created as optionals.
  2. If you want to be specific, then you will need to create multiple fields at category level. Unfortunately, appart from the scenario 1, you can’t have a single field in multiple categories.
1 Like

Hi @eduardo !

Thanks for the help!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.