# EDD REST API - Customers

 The [EDD REST API](https://easydigitaldownloads.com/docs/edd-rest-api-introduction/) provides an endpoint called `/customers/`. The customers endpoint allows for you to query the database and retrieve a list of customers that have purchased items from your shop. A basic customers query looks like this:

```
https://yoursite.com/edd-api/customers/?key=c281cf0a95be875d9eeb284fb004c938&amp;token=5f9432f3ffa5945755ebc66179810d70&amp;number=25
```

 For each customer returned, the following information is returned for each customer:

- **id** - The WordPress user ID. If the customer purchased as a guest, this will return as -1.
- **username** - The WordPress user login name. If the customer purchased as a guest, this will return as nothing.
- **display\_name** - The WordPress user display name. If the customer purchased as a guest, this will return as nothing.
- **first\_name** - The customer first name.
- **last\_name** - The customer last name.
- **email** - The customer&#039;s email address.
- **total\_purchases** - The total number of purchases the customer has made.
- **total\_spent** - The total amount the customer has spent.
- **total\_downloads** - The total number of files the customer has downloaded.

 Along with the data returned for each customer is a *stats* object that shows the total number of customers in the database.

 A customers query response looks like this:

```
{
    &quot;customers&quot;: [
        {
            &quot;info&quot;: {
                &quot;id&quot;: -1,
                &quot;username&quot;: &quot;Guest&quot;,
                &quot;display_name&quot;: &quot;Guest&quot;,
                &quot;first_name&quot;: &quot;Guest&quot;,
                &quot;last_name&quot;: &quot;Guest&quot;,
                &quot;email&quot;: &quot;johnson@test.com&quot;
            },
            &quot;stats&quot;: {
                &quot;total_purchases&quot;: 2,
                &quot;total_spent&quot;: &quot;20&quot;,
                &quot;total_downloads&quot;: 0
            }
        },
        {
            &quot;info&quot;: {
                &quot;id&quot;: -1,
                &quot;username&quot;: &quot;Guest&quot;,
                &quot;display_name&quot;: &quot;Guest&quot;,
                &quot;first_name&quot;: &quot;Guest&quot;,
                &quot;last_name&quot;: &quot;Guest&quot;,
                &quot;email&quot;: &quot;asda@test.com&quot;
            },
            &quot;stats&quot;: {
                &quot;total_purchases&quot;: 0,
                &quot;total_spent&quot;: &quot;0&quot;,
                &quot;total_downloads&quot;: 0
            }
        }
    ]
}
```

 If you wish to retrieve the info for a specific customer, you can add the *&amp;customer={identifier}* parameter, like this:

```
https://yoursite.com/edd-api/customers/?key=c281cf0a95be875d9eeb284fb004c938&amp;token=5f9432f3ffa5945755ebc66179810d70&amp;customer=1
```

 or

```
https://yoursite.com/edd-api/customers/?key=c281cf0a95be875d9eeb284fb004c938&amp;token=5f9432f3ffa5945755ebc66179810d70&amp;customer=email@domain.com
```

 The response for a single customer will be like this:

```
{
    &quot;customers&quot;: [
        {
            &quot;info&quot;: {
                &quot;id&quot;: 1,
                &quot;username&quot;: &quot;pippin&quot;,
                &quot;display_name&quot;: &quot;Pippin Williamson&quot;,
                &quot;first_name&quot;: &quot;Pippin&quot;,
                &quot;last_name&quot;: &quot;Williamson&quot;,
                &quot;email&quot;: &quot;pippin@pippinsplugins.com&quot;
            },
            &quot;stats&quot;: {
                &quot;total_purchases&quot;: 61,
                &quot;total_spent&quot;: 1139.68,
                &quot;total_downloads&quot;: 31
            }
        }
    ]
}
```