# EDD WP-CLI Commands Overview

This doc contains a list of all of the commands you can use in WP-CLI for EDD.

The following commands are available:

- [wp edd customers](#customers)
- [wp edd details](#details)
- [wp edd discounts](#discounts)
- [wp edd products](#products)
- [wp edd sales](#sales)
- [wp edd stats](#stats)

Each of these commands has optional parameters that are detailed below. You can see a list of the available commands at anytime by simply entering:

```
wp edd
```

This will display a list of all registered commands:

![](https://easydigitaldownloads.com/wp-content/uploads/2022/01/edd-cli-commands-800x627.png)Customers
---------

The *edd customers* command will allow you to view and create customers from the command line.

### Viewing Customers

```
$ wp edd customers
customer-54e23021ef7b6@test.com
Customer User ID:
Username:
Display Name:
Email: customer-54e23021ef7b6@test.com


Purchases: 0
Total Spent: 0.00 USD
Total Downloads: 0


customer-54e23021ef164@test.com
Customer User ID:
Username:
Display Name:
Email: customer-54e23021ef164@test.com


Purchases: 0
Total Spent: 0.00 USD
Total Downloads: 0


customer-54e23021eeb6d@test.com
Customer User ID:
Username:
Display Name:
Email: customer-54e23021eeb6d@test.com


Purchases: 0
Total Spent: 0.00 USD
Total Downloads: 0
..
```

You can get the information for a specific customer by passing in 
*--id=#*:

```
$ wp edd customers --id=1
chris@chriskdesigns.com
Customer User ID: 2
Username: customer1
Display Name: Customer One
Email: chris@chriskdesigns.com


Purchases: 5
Total Spent: 28.00 USD
Total Downloads: 0
```

You can also pass in an email address with --email=john@test.com

```
$ wp edd customers --email=admin@local.dev
admin@local.dev
Customer User ID: 1
Username: admin
Display Name: Admin User
Email: admin@local.dev


Purchases: 57
Total Spent: 388.46 USD
Total Downloads: 20
```

### Creating Customers

Creating customers can be done one at a time, or in bulk.

#### Creating a Single Customer

**With an automatically generated email address**

```
wp edd customers --create=1
```

**With a specific email address**

```
wp edd customers --create=1 --email=john@test.com
```

**With a specific email and name**

```
wp edd customers --create=1 --email=john@test.com --name=&quot;John Doe&quot;
```

**Adding in a user ID**

```
wp edd customers --create=1 --email=john@test.com --name=&quot;John Doe&quot; user_id=1
```

#### Creating Customers in Bulk



```
wp edd customers --create=1000
```

Details
-------

The *wp edd details* command will provide a list of details about your Easy Digital Downloads install, including the version number, a few important settings, your tax rate, and more. It looks like this:

[![Screenshot from 2014-09-11 10:21:41](https://easydigitaldownloads.com/wp-content/uploads/2022/07/6184cc541beb9.png)](https://easydigitaldownloads.com/wp-content/uploads/2014/09/Screenshot-from-2014-09-11-102141.png)Discounts
---------

The *`wp edd discounts`* command provides a list of discount codes available in your store. It accepts an optional *--id=#* parameter to allow you to view the details of a specific discount code:

```
wp edd discount
```

![](https://easydigitaldownloads.com/wp-content/uploads/2022/07/6184cb87112be.png)Products
--------

The *wp edd discounts* command provides a list of discount codes available in your store. It accepts an optional *--id=#* parameter to allow you to view the details of a specific discount code:

```
wp edd discount
```

![](https://easydigitaldownloads.com/wp-content/uploads/2022/07/6184cb87112be.png)Sales
-----

The *wp edd sales* command will output a list of your recent store sales. Each sale record will include the payment ID, the total, the customer email, the date, the tax, any fees, the payment gateway used, and a list of products included in the purchase:

```
wp edd sales
```

[![Screenshot from 2014-09-11 10:38:47](https://easydigitaldownloads.com/wp-content/uploads/2022/07/6184cb78b2981.png)](https://easydigitaldownloads.com/wp-content/uploads/2014/09/Screenshot-from-2014-09-11-103847.png)Stats
-----

The *wp edd stats* command will show you sales and earnings stats for your store. Running it without any parameters will give you the stats for the current month:

It also accepts several different parameters that let you view the stats for specific dates and/or products:

- wp edd stats --date=this\_month
- wp edd stats --start-date=01/02/2014 --end-date=02/23/2014
- wp edd stats --date=last\_year
- wp edd stats --date=last\_year --product=15

You can pass any date string to the
*--date*, --*start-date* and *--end-date* parameters, or you can pass one of the following pre-defined periods:

- today
- yesterday
- this\_week
- last\_week
- this\_month
- last\_month
- this\_quarter
- last\_quarter
- this\_year
- last\_year

If you want to get the sales and earnings for a specific product, pass in
*--produxt=#* where *\#* is the ID number of the product: