How to make a limited stocked item dev product?

Hi! So I am making a limited pet dev product where there will be only 250 pets in stock. Every time a player buys one it goes down until it is Out of Stock. How would I do this? I know that I will require data stores but I just need some hints/clues to insight me a little. Thank you

everytime theres a purchase increment a datastore with the key being the product they bought, before purchasing check to see if the amount of sales is higher than the stock, if it isnt then dont let them buy it