Updating Categories on ITEM

Hello!

I’m using the Square PHP SDK v33.1.0.20231213

I have an existing ITEM that has 1 CATEGORY.
I set a different CATEGORY to the one above in the following code:

$catalogObject->getItemData()->setCategories([$catalogObjectCategory])

I expect the result to replace what I have provided in the ->setCategories() method, however when I log in to the Square Dashboard, the ITEM has both the old and new CATEGORY.

Am I missing something or misunderstanding the documentation? How do I remove the existing categories and add new and different categories to the item?

Is this in production or Sandbox? Also whats your application ID and the item_id your trying to update? :slightly_smiling_face:

This was in production.

I had a quick look again today and it appears to have quietly fixed itself. I can’t seem to reproduce it.

Thanks! :laughing: