To try, I created a API for myself with the correct permissions (View and search Envato sites (selected by default), Download your purchased items, View your items’ sales history, List purchases you’ve has made) and tried an Item Code I bought myself.
Details above are not the correct ones.
I get always the response:
[body] => {"error":404,"description":"No sale belonging to the current user found with that code"}
[response] => Array
(
[code] => 404
[message] => Not Found
)
But the Personal Token is valid and the purchase has been made. What am I doing wrong?
If you are a Buyer/customer:
Before you create a new token the following 3 permissions should be selected from the list of permission available on the Token page.
It doesn’t look like you have any items for sale yet, is that right? Which means you won’t be able to test that endpoint (/author/sale) because it only works for your own items, not items you’ve purchased from other authors.
You have two options to test in this case:
You can replace the /author/sale endpoint with /buyer/purchase to use a code for one of your purchases. The response should be identical, except the buyer field will be missing. This will require the purchase:verify permission on the personal token, which is labeled on build.envato.com as “Verify purchases the user has made.”