The following scenarios have been discussed: Windows 11/10 License from Microsoft Store Microsoft ... and then decide to buy a product key. The cost is usually $199 for Windows Pro and $139 ...
Go to Settings > Update and Security > Activation, and use the link to purchase a license of the correct Windows 10 version. It will open in Microsoft Store, and give you the option to buy.