API and license keys for Author's own items

Not sure if this is a silly question, but how can authors test API integrations for their own items?
Example of usage is Envato Market plugin.

We need to be able to test this to implement it right.

Currently only purchasing one of our own items grants us a license key to test it. This is not a good solution and it also violates the the Envato policy.

Any ideas? Are we missing something?

1 Like

Sadly, there’s no way to test Envato API.

I was in search of testing functionality too. Couldn’t find it, so contacted Envato support and got a reply that no testing endpoint exists. With this in mind, my (and your) only solution is trial and error method :slight_smile:

I’m not really sure what you’re trying to implement, but maybe this helps:

Maybe you are talking about purchase codes, not API keys? Not sure though if I understand correctly :slight_smile:

@hevada, thanks for your input. I guess OP (just like me) is looking for test environment where he can test his script using “fake” (created for testing purposes only) purchase codes, etc.

Such an API test environment is provided by many companies, so developers can make test purchases and then play with them via API.

You are both right. I would like to test the feature of updating the theme through WordPress Dasboard, using (fake) credentials - an item license key and an user API key.

Currently I can create an API key, but I would also need a valid license key to test the updating of the items I am selling.

There is an easier method to do that: using Envato Market plugin (which takes care of purchase code validation and API key validation). You just have to include the plugin in your theme.

You include the Envato Market plugin zip from github in your theme:

Then you use the TGM Plugin Activation from here http://tgmpluginactivation.com/ and in the init.php file of TGM Plugin Activation you include the link to the included Envato Market .zip file.

This way, when the user installs your theme, they will see the Envato Market plugin as required (if they don’t have it already). And the Envato Market plugin will take care about notifying the user about theme updates in admin dashboard.

And this way, you don’t have to test keys or codes :slight_smile:

Unfortunately, the easiest solution is not the best solution usually. Many authors (including me) need custom stuff, and not all of them use WordPress or want to include external plugins.

Beside that, many authors create non-WordPress items, so WP plugin won’t work anyways for their needs.

I know and I understand. I know having a sandbox would makes things easier…

But there isn’t one…In this case, you could create an “invented” key then you can hardcode the response (based on the example responses available on API page). At least this is what I usually do with APIs that don’t provide a sandbox :slight_smile:

Thank you @hevada for your reply.
Envato Market plugin is a good starting point, but I would prefer if I could integrate the API key field into the theme options and not as a separate plugin.

I am not sure if hardcoding the reply would help in this case, as the theme update will not go through. The theme still needs to be downloaded from the Envato server. The successful test of the feature can’t be done without a valid license key.

Is there somewhere I can file a feature request for Envato to implement a solution to this?

From what I know, Envato encourages the usage of Envato Market plugin for updates of themes/plugins on the customer side and also encourages authors to integrate the Envato Market plugin in their themes/plugins. For a smooth and consistent user experience.

But if you want to ask/request for a specific custom implementation I’d suggest contacting Envato Help&Support by opening a ticket here:
Envato Help and Support

They will know better what to advise you with this.

1 Like

Thank you @hevada, I just submited the ticket.

1 Like

I got response from Envato team, basically it seems they are not very interested in resolving this stalemate:
“Unfortunately, we do not currently offer a test account, or a test purchase code to try…
You are not allowed to purchase your own item either”…

We had to have one item sold, and then we started to create our script.
After that we need to request to the customer to send us their purchase code so we could have a way to test our script. It was really the only solution we had at the time.

Best regards.