What item are you trying to purchase?
You can try a UI reset to start, a corrupted UI can block buying. Follow all the steps in the below article. It will reset all your settings and such in game.
If it doesn’t help, you can revert everything back afterwards if you rename/move the three folders back.
Edit: You do also have the right items in your inventory to purchase the item, right? Most items sold by vendors in DF need crafting reagents, and it has to also be the quality indicated on the tooltip. Can’t use a 3 star Draconium Ore if it calls for a 2 star.