If I create a ModifierList with the Upsert Catalog Object call and then subsequently update the ModifierList with another Upsert Catalog Object call that has some of the Modifiers that were present in the original ModifierList no longer present, are those Modifier objects that are no longer present automatically removed from the Square database? Playing around with the API Explorer it appears that’s the case, because if I do the above and then try to retrieve one of the Modifiers that should be gone, the Retrieve call returns object not found. I just wanted to verify that’s the case and that an explicit delete call isn’t also necessary for those Modifiers to keep orphaned objects from hanging around in the database. Thanks.
Yes, you are correct. You will need to pass in the entire list of objects for what you are updating or anything that is missing will no longer be associated to the list.
Sounds good, thanks Bryan. Just to clarify - it makes sense that they will no longer be associated with the list, but will they also no longer exist as objects at all? That’s my hope and what seems to be the case with what I’ve played around with in API Explorer.
I’m working on a web app that will be regularly updating the contents of a modifier list (adding and removing modifier elements) and just wanted to be certain that a simple Upsert call for the modifier list would effectively fully delete previously-existing modifier elements that aren’t in the subsequent Upsert call. That will certainly be easier for my use case than having to make an explicit Delete call for the modifier element objects that I would be removing, to ensure there are no orphaned modifier objects hanging around that are disassociated from any modifier list.
When you update the modifier list and remove a modifier from the list it’s no longer exist as an object.
Awesome, thanks for the clarification! That’s what I was hoping.