how to protect my item by purchase code verification systems Envato api.

because if i added a snippet of code to check the purchase code, if someone traced the code he can find the code and edit it and everything will work fine without purchasing the item again.

You can’t really protect your item trough any means when selling on Envato, as that would require to encrypt your code, which goes against the Envato’s Author Terms: Item Quality FAQ’s – Envato Author Help Center

At best, you can set up a license confirmation gateway (which you said you already did), in hope of more novice users not being able to bypass it.

Good luck.