Menu
Feedback
Known issues
Collections created by API and Products inserted by API Insert SKU by File not working properly
Catalog
ID: 470966
Backlog
Published on10/16/2025
Last updated on10/16/2025
2 min read

Summary

Today we have some ways to create and add products to a collection. We can use our new Collection Adimn, our legacy collection admin and we can use API to create collections and add products to a collection. But we have a problem when creating collections through API and add products to this collection using the route api/catalog/pvt/collection//stockkeepingunit/importinsert. With this API we are able to add products to the collection using a spreadsheet.

The problem happens every time we create a collection by API and try to use this importinsert API to add products. The products do not become available to the collection created.

Simulation

Workaround

There are two viable workarounds for this issue:

1️⃣ Add products to collections created by API using Admin Spreadsheet Upload or use the Insert SKU to subcollection API to insert SKUs to collections:

To add SKUs to collections using API, we have to follow these steps:

Create collection:

curl --location -g --request POST 'https://catalog.vtexcommercestable.com.br/api/catalog/pvt/collection?an=(https://catalog.vtexcommercestable.com.br/api/catalog/pvt/collection?an=)' --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'x-vtex-api-appKey: vtexappkey-appvtex' --header 'x-vtex-api-appToken: ' --header 'Cookie: janus_sid=7026383e-2070-4b68-a2c2-59cf729ec0da' --data-raw '{ "Name": "testando", "Searchable": false, "Highlight": false, "DateFrom": "2017-09-27T10:47:00", "DateTo": "2027-09-27T10:47:00"}'

Create subcollection:

curl --location -g --request POST 'https://catalog.vtexcommercestable.com.br/api/catalog/pvt/subcollection?an=(https://catalog.vtexcommercestable.com.br/api/catalog/pvt/subcollection?an=)' --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'VtexIdclientAutCookie: ' --header 'Cookie: janus_sid=7026383e-2070-4b68-a2c2-59cf729ec0da' --data-raw '{ "CollectionId": 173, "Name": "Inclusive 1", "Type": "Inclusive", "PreSale": false, "Release": false}'

Insert SKU to subcollection:

curl --location -g --request POST 'https://catalog.vtexcommercestable.com.br/api/catalog/pvt/subcollection//stockkeepingunit?an=(https://catalog.vtexcommercestable.com.br/api/catalog/pvt/subcollection//stockkeepingunit?an=)' --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'VtexIdclientAutCookie: ' --header 'Cookie: janus_sid=7026383e-2070-4b68-a2c2-59cf729ec0da' --data-raw '{ "SkuId": 2000037}'

2️⃣ There is also the possibility to use the api/catalog/pvt/collection//stockkeepingunit/importinsert and then, after the import is complete and all products were added, to go manually, via UI and update the entire collection data, either by changing its name or its begin/end date.

This way, the collection products that were just inserted will be forced into a reindex and the collection related data will be added to them, allowing the correct display of the needed information.

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