How to verify a purchase code using the Envato API

Elite Licenser - Easy to use WordPress plugin that can integrate license verification system using envato api inside your WordPress or PHP product.

Hi, the method doesn’t work no more. There is not "View the user’s items’ sales history” for personal token:

Also if you go to https://build.envato.com/create-token/?sale:history=t and generate the token, the scope is converted to YOUR purchase not the user’s one.

Anyone know another method?

Thank you!

Hey @Schiocco - The wording for permissions is a little different if you edit them. When editing an existing token, you want to select “View your items’ sales history”, which is selected in your screenshot. It will still work as normal.

Basically, “View your items’ sales history” and “View the user’s items’ sales history” are identical, so whichever one you see works fine. :slight_smile:

1 Like

Is there any dummy purchase code for testing my envato purchase code validation? Stripe API has test card number 4242 4242 4242 4242. I am searching for dummy envato purchase code for testing purpose.

No there is no way to test it now, you will just have to wing it and ask your customer for a purchase key.

Very, very high chance your account will soon be disabled if you do that. My suggestion is to ask a customer for a purchase code when they have a support inquiry and then you can do all the tests you want. There are tons of verifications mechanisms in place to avoid self purchases and gaming the system. If you get caught self purchasing you will be disabled, no questions asked. I strongly urge you not to self-purchase / self-rate, etc.

2 Likes

Oh thank you so much for this input, i only assumed that with no means of testing the api, we would be left off with no other option. But cheers for letting me know.

I understand, but considering you’re bound to get a support question, it’s safer to ask for the purchase code for confirmation and do it through “fair-play” methods rather than purchasing your own file! Cheers! :slight_smile:

1 Like

Hello all.
You can’t purchase your own item if you are logged in into the same account.
What you can do however, it’s lower the price of your item to a minimal, and ask a friend of your to buy it, just to get a purchase code and do your tests.
This way you won’t do anything illegal, and you won’t have to ask your customers for a purchase key, because let’s face it, that is not very professional, is it? :slight_smile:

PS. If anyone is looking for a working PHP script to validate your customers purchase codes, you can try this one. https://github.com/abdulawal39/verify-envato-purchase-code/blob/master/class.verify-purchase.php

I am using it and it’s working fine, you just need to create and register an API here https://build.envato.com/register/ and replace the XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX with your bearer from the API you just created.

Same thing. You still have a very high chance of being disabled for this. Terms Here

When determining whether misleading pricing has occurred, we may consider any evidence that the advertised price is not reflective of the actual intended sale price, including (but not limited to):

  • The usual/reasonable pricing for similar items of that type within the broader industry;
  • Whether the author has made any sales at the advertised price (or at any price close to that price); or
  • Whether the author has been observed to temporarily lower the price in response to a sales inquiry from a customer

You are NOT ALLOWED to self purchase, reduce the price to self purchase, ask a friend to “purchase for a lower price” absolutely ANY tactic where you artificially inflate your sale count regardless of the excuse.

If a friend purchases a full price, doesn’t rate or doesn’t ask for a refund in the future for bogus reasons, all is well, although if that IP can be linked back to your account, you both risk being disabled.

Play fair. Ask your first buyer for a purchase code or contact Envato Authors Help and Support for more details on the matter.

Please be very careful on these matters. ANY attempt to game the system or artificially bump sales that is detected will result in your account being disabled without warning.

Yes you are absolutely right, but as you say, as long as your friend doesn’t ask for a refund, this would count as a regular sale, and it’s not like you are trying to scam anyone.

And I don’t think that asking a customer for the purchase code it’s a good technique, to be fair I think Envato should provide some test codes for authors, to avoid this kind of situations.

Actually, been doing it for over 11 years for those who contact me directly via email, and for others I have my own scripts in place to check. How else am I suppose to prove ownership? Everyone has some sort of code like this (i.e. PayPal one time passcode when talking to support)

And if you don’t want to ask for a purchase code, simple, ask them to send you a message via your Envato Contact form, where the purchase can easily be verified.

Indeed it’s a regular sale, but if your friend has the ability to access your account from the same machine for example, that will trigger a lot of problems. It can be interpreted as a self-purchase.

Heya @crispyApp,

Apologies, I was away for the last few weeks.

I would recommend taking a few minutes to set up your own dummy API. You can copy/paste the example responses in my first post at the top of this thread, and write a small script to return one or the other based on the input. That’s what I do for my own projects. :slight_smile:

Once your application works with the dummy script, it should work with the real API. Just give it a fake purchase code and make sure you’re getting a 404 back so you know there aren’t any authentication issues.

Edit: Here’s an example: Mock purchase code validation · GitHub

Cheers!

:pencil2:   Edit: I’ve created a sandbox that you can use to test your code! Check the testing your code section at the top of this thread.

2 Likes

Hello! I am .net developer. Please provide me c# code for verify purchase. I need your help, help me please…

Hey, you can use Easy Envato to verify your purchase codes

The extension can be used on all major chromium-based browsers, including New Edge, Opera, Google Chrome.

Available on Chrome Web Store
https://chrome.google.com/webstore/detail/easy-envato/hnchmgnmhafhgdkcinjjgkdgeehnadoe

Github Repository
https://github.com/UnitedOver/easy-envato

Can someone recommend Envato purchase code verification script which performs some level of caching on the data to limit the number of API calls? The support team says Envato’s started looking more closely at their API traffic to ensure they can maintain a better service.

That’s generally for automated calls which you make via your server, if you are just planning to verify purchase code manually for support related things then this change won’t affect you, so there is no need to have a something which cache purchase code data as for support related stuff the data should always be up to date.

1 Like

Hello dear sirs!

I wander if envato api responses with 404 code for refunded purchase codes. I see some strange responses with empty license field and the amount field is 0.00. Is this OK?

Yes, envato responds with 404 for invalid/refunded purchase codes.

1 Like

@baileyherbert I get started implementing the license activation using the npm package. It worked when I tested I purchase that I’ve made. But now I’d like to test a sale but it’s my first product and I don’t have any sales to test. Do you have implemented some dummy API for JS like that one for PHP?

And how do you manage the license to a single domain end-product?

Thanks for the help and support on this topic.