How to store REST api payload for user from frontend?

I would like to store the payload of REST API calls made by a user in frontend and be able to make the calls to recreate what the user did (like a replay button)

I have the following scenario:

User opens website.

User picks a product and configures it.

How can I store the REST API calls payload from frontend: Is there a framework that does that? Which database should I use?