Switching Apple id for Purchase

hello, I have a question, I’m testing a purchase through the sandbox, deleting the application, changing the apple id, and reinstalling the game, restoring purchases and they will be restored
but the old account remains sandboxed in the window
I want to make it so that when I change my Apple ID, it is checked for purchases in this particular account, how can I do this?
Thank you

Hello,

When testing on Sandbox, it uses the Sandbox account and not the Apple account, so you would have to change that account for testing.

On a live application, it will behave the way you described.