How to create purchase code

Hello.
I’ve created a WordPress theme and i am on the way to upload, but I wonder how can I create a purchase code validation system for it. can anyone tell me how can do it please

Tutorial Solution from @baileyherbert :

2 Likes