CatalogCategory isn't using the ID set in UpsertCatalogObject

Hello,

In Node.js, I’m using UpsertCatalogObject to create a Catalog Category Object. The first time I tried it, it worked perfectly. To test something else, I had to delete the Category in the Square Dashboard. Now when I try to run the function again, it successfully creates the Category, but with a randomized ID instead of the one I set within the function. If a Category is deleted, am I not allowed to reuse it’s ID?

This is the expected behavior. If an object is deleted you can’t reuse the ID. This is because deleted objects are archived and still returned by the API when you have include_deleted_objects set to true for SearchCatalog and BatchRetrieveCatalogObjects. :slightly_smiling_face:

Thank you. Is there a way to remove a Category from the deleted list then? If a user were to delete the Category by mistake, it would completely ruin my application at this point.

No, there isn’t a way to remove a Category from a deleted list. How would it break the application? :slightly_smiling_face:

The application creates a Category that the user can add Catalog Items to. It needs to be able to retrieve the Items within this Category, so a specific ID is passed to it upon creation. Without the correct ID, the application would be unable to retrieve the Items.

Okay, if a category is deleted by accident the seller would have to create a new category which can have the same name and items associated to it. It will have a different ID and your application will need to update accordingly. :slightly_smiling_face:

Thank you for enriching us with your amazing insights. Kohls Credit Card It’s greatly appreciated