Hi,
Welcome to Microsoft Q&A!
I agree with Darran Rowe, the easiest way to do this is to use the StoreContext class.
If you still couldn't use Microsoft Store IAP, I suggest you could try to call the REST URIs for the Microsoft Store collection API and purchase API.
For more details you could refer to the Doc: Manage product entitlements from a service
Jeanine
Thank you