question

Robin Walmsley avatar image
Robin Walmsley asked Robin Walmsley answered

Deleting CategoryItems ?

I want to synchronize the data between our web app and Clover Database.

I'm not sure this is the best way, but I figured if I purge the Items and Categories (we only use these) and also the CatergoryItems I can then POST all our data back again.

The problem is I'm uncertain how to delete CategoryItems. Is it via a POST method supplying the category Id and Item Id, and if found, its deleted, if not found its added .. like a toggle?

But also, if I delete the Category in the first instance, would this not cascade delete the CategoryItem, thus saving me the job of doing it manually?

I'm trying to do this as quickly and efficiently as possible and I'd rather not have to make 1000s of api calls.

This is not a task the Merchant would do very often, if ever. But is necessary as an option in case the two databases become out of sync.

Thanks Robin

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Robin Walmsley avatar image
Robin Walmsley answered

Ok I found the answer in the Docs.

"To remove the association, send a POST with ?delete=true appended to the URL, along with the same payload. To remove all categories from an item, use a payload with the item and no category:"


NOTE: I've abandoned this whole approach as I've now discovered (realized) that deleting the data is a bad idea due to the max number of allowable products.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community