EDD REST API – Introduction
Easy Digital Downloads includes a complete RESTful API that allows stored data to be retrieved remotely in either a JSON or XML format. The API includes methods for retrieving info about store products, store customers, store sales, and store earnings.
The API is accessed via the edd-api end point of your store, like so:
https://yoursite.com/edd-api/
NOTE: If you are getting a 404 error when visiting the link above, you may need to re-save your permalinks. Do this by going to Dashboard > Settings > Permalinks > Save.
To access the API, you will need to provide a valid public API key and also a valid token. An API key and token can be generated for any user by going to Downloads → Tools → API Keys:
The secret key is used for internal authentication and should never be used directly to access the API.
Individual users may go to their own profile and find their own key:
Once you have an API key, you can begin utilizing the EDD API. Both the API key and the token need to be appended to the URL as query parameters, like so:
https://yoursite.com/edd-api/?key=XXX&token=XXX
Paging Parameters
By default, the EDD API will return 10 results per page for the customers, sales, and products queries.
If a query has 20 results, the first ten will be displayed by default, but then the second 10 can be accessed by adding &page=2 to the query string, like so:
https://yoursite.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&page=2
You can change the number of results returned by using the number parameter. This example will return 25 results per page:
https://yoursite.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&number=25
If you want to retrieve all results (no paging), set number to -1.
FAQ
Can you create orders, products, or customers via API?
No, you cannot create via the API. Our REST API currently only supports pulling data from your store.