Skip to content

When I try to create multiple categories #904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JesusSGD opened this issue Apr 11, 2025 · 6 comments
Closed

When I try to create multiple categories #904

JesusSGD opened this issue Apr 11, 2025 · 6 comments

Comments

@JesusSGD
Copy link

When I try to create multiple categories, api rest show (1.url': "Url is required and can't be empty",...) for all items, but using postman and sending small chunks works.

[
{
"name":"Paños húmedos",
"parent_id":180
},
{
"name":"Jabones Antisépticos",
"parent_id":180
},
...11 more
]

@bc-traciporter
Copy link
Contributor

Hi @JesusSGD Are you using this endpoint: https://developer.bigcommerce.com/docs/rest-catalog/categories/batch-metafields#create-multiple-metafields
Can you send a screenshot of the error message?

@JesusSGD
Copy link
Author

JesusSGD commented Apr 14, 2025

Hi, thanks for your comment. I'm using the catalog/trees/categories endpoint and sending the data in small chunks to avoid errors. This is just part of a script to initialize the store's categories.

Image

@bc-traciporter
Copy link
Contributor

Hello @JesusSGD I just tried the endpoint. Initially I received a 422 error code as well. I noticed that the name field was duplicated. Once I gave it a unique name and url values it worked. It appears the values you are using are incorrect. Also you need to populate the url object.

@JesusSGD
Copy link
Author

Hi @bc-traciporter my data have similar names but not are the same, and if that were the problem it shouldn't work when I send them separately,
"Jabones Cosmeticos"
"Jabones Antisépticos"
"Jabones antibacteriales"
i did a test removing the space between the words and it didn't work either. I think there's a limit to the number of records.
Thank you for your time

@bc-traciporter
Copy link
Contributor

@JesusSGD I will ask the development team if there is a limit. Thank you

@bc-traciporter
Copy link
Contributor

Hello @JesusSGD Sorry for the delay. I just heard back from the development team. This is a bug. There seems to be a problem as you stated when you have > 10 items. So the best workaround is to do as you stated, to send data in small chunks. They are aware of the issue and working on it. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants