Menu
Feedback
Start here

Known issues

Known issues
Creating subcategory via category path, with the same name as another subcategory, fails
Catalog
•
ID: 1087069
Backlog
Published on8/26/2024
•
Last updated on8/26/2024
1 min read

Summary

Currently, it is possible to create new categories and/or subcategories by informing their names via the JSON property "CategoryPath" in the insert product API: https://developers.vtex.com/docs/api-reference/catalog-api#post-/api/catalog/pvt/product

However, when the informed subcategory has the same name as another subcategory, the product is created in the former and the latter is not generated.

This doesn't happen for categories.

Simulation

Using the mentioned API, create a product informing, in the category path, a subcategory that has the same name as another subcategory but is not yet created and should be created elsewhere in the category tree.

As an example, check the tree below:

{"base64":"  ","img":{"width":180,"height":121,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":4899,"url":"https://raw.githubusercontent.com/vtexdocs/known-issues/refs/heads/main/docs/en/known-issues/Catalog/creating-subcategory-via-category-path-with-the-same-name-as-another-subcategory-fails_1.png"}}

This would mean informing in the path "Department/Category2/Subcategory1".

The product will be created in the path "Department/Category/Subcategory1" instead and the new subcategory will not be created.

Workaround

Create the subcategory by other means instead, such as the PUT category API: https://developers.vtex.com/docs/api-reference/catalog-api#post-/api/catalog/pvt/category and then insert the product to this category informing its path or ID.

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX Community
Join our community
Request VTEX support
For personalized assistance, contact our experts
Open a support ticket
GitHubDeveloper PortalCommunityFeedback