'AWS Personalize: How to capture "returning" or "unselecting" items?

I am building an application where I want to update the recommendations "live", ie every time a user adds an item to their cart. I can do this by calling the personalize-events.put-event api. However, what if they remove the item from their cart. There is no delete-event api. Another similar use case I can think of is if the user returns the item.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source