I am currently building an e-commerce app with a cart stored in the localStorage.
To improve online payment security, I want to check the prices of my items in the backend before sending these prices to the payment platform.
The values of my items are not unique: some items can have the same value if they are in different categories.
That is the reasom I wanted to store ObjectId inside my cart (localStorage) and send all these objectIds to my backend to easily check the prices.
But I read that exposing database Id to the user is a bad practice.
My questions are: Is it really a bad practice ? Why ? How can do it differently without adding any complexity ?
Thanks for your help