EDD REST API - Endpoints

The  EDD REST API includes six endpoints for accessing information, each for performing a specific kind of request:

  • stats - For retrieving earnings / sales stats specific dates, date ranges, and specific products.
  • products - For retrieving info about store products.
  • customers - For retrieving customer stats.
  • sales - For retrieving recent sales and info about each sale (items purchased, buyer, amount, etc).
  • discounts - For retrieving info about all available discounts.
  • download-logs - For retrieving logs of file downloads.

The endpoints are used like so:

http://example.com/edd-api/<endpoint>/

For example:

http://example.com/edd-api/sales/

When combined with the API key and token, the complete URL looks like this:

http://example.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70

Visibility

All endpoints require the API key and token except for the products endpoint. This is because products are intended to be public at all times by default.

Response Format

The response given by the EDD API is available in two formats:

To specify the format returned (jSON will be used if none is specified), simply add the  format argument to the URL:

http://yoursite.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&format=xml

A sample JSON response looks like this:

{
    "sales": [
        {
            "ID": 611,
            "subtotal": "20",
            "tax": 0,
            "fees": false,
            "total": "20",
            "gateway": "manual",
            "email": "johntest23@test.com",
            "date": "2013-02-25 11:42:05",
            "products": [
                {
                    "name": "Simple Notices Pro",
                    "price": "20",
                    "price_name": "Price one"
                }
            ]
        }
    ]
}

A sample XML response (for the same query) looks like this:

<edd>
  <sales>
    <ID>611</ID>
    <subtotal>20</subtotal>
    <tax>0</tax>
    <fees>false</fees>
    <total>20</total>
    <gateway>manual</gateway>
    <email>johntest23@test.com</email>
    <date>2013-02-25 11:42:05</date>
    <products>
      <name>Simple Notices Pro</name>
      <price>20</price>
      <price_name>Price one</price_name>
    </products>
  </sales>
</edd>