woothemes/woocommerce — pull request #5033 by claudiosmweb (2014-03-04 01:39:47+00:00)
Title: Customers API / Methods PUT/POST/DELETE

Here is my suggestion on how we can do this.

### Documentation ####

#### Add customer ####

```
POST /customers
```

**Data:**

| Group | Field | Info | Optional |
| --- |---| --- | --- |
| root | email | Customer email | required |
| root | username | Customer username | optional |
| root | password | Customer password | optional |
| root | first_name | Customer first name | optional |
| root | last_name | Customer last name | optional |
| billing_address | first_name | Billing first name | optional |
| billing_address | last_name | Billing last name | optional |
| billing_address | company | Billing company name | optional |
| billing_address | address_1 | Billing address line 1 | optional |
| billing_address | address_2 | Billing address line 2 | optional |
| billing_address | city | Billing city | optional |
| billing_address | state | Billing state (code) | optional |
| billing_address | postcode | Billing postcode | optional |
| billing_address | country | Billing contry (code) | optional |
| billing_address | email | Billing contact email | optional |
| billing_address | phone | Billing contact phone | optional |
| shipping_address | first_name | Shipping first name | optional |
| shipping_address | last_name | Shipping last name | optional |
| shipping_address | company | Shipping company name | optional |
| shipping_address | address_1 | Shipping address line 1 | optional |
| shipping_address | address_2 | Shipping address line 2 | optional |
| shipping_address | city | Shipping city | optional |
| shipping_address | state | Shipping state (code) | optional |
| shipping_address | postcode | Shipping postcode | optional |
| shipping_address | country | Shipping contry (code) | optional |

**Return:**

Returns the user data equal to `GET /customers/`.

#### Edit customer ####

```
PUT /customers/
```

**Data:**

| Group | Field | Info | Optional |
| --- |---| --- | --- |
| root | email | Customer email | optional |
| root | password | Customer password | optional |
| root | first_name | Customer first name | optional |
| root | last_name | Customer last name | optional |
| billing_address | first_name | Billing first name | optional |
| billing_address | last_name | Billing last name | optional |
| billing_address | company | Billing company name | optional |
| billing_address | address_1 | Billing address line 1 | optional |
| billing_address | address_2 | Billing address line 2 | optional |
| billing_address | city | Billing city | optional |
| billing_address | state | Billing state (code) | optional |
| billing_address | postcode | Billing postcode | optional |
| billing_address | country | Billing contry (code) | optional |
| billing_address | email | Billing contact email | optional |
| billing_address | phone | Billing contact phone | optional |
| shipping_address | first_name | Shipping first name | optional |
| shipping_address | last_name | Shipping last name | optional |
| shipping_address | company | Shipping company name | optional |
| shipping_address | address_1 | Shipping address line 1 | optional |
| shipping_address | address_2 | Shipping address line 2 | optional |
| shipping_address | city | Shipping city | optional |
| shipping_address | state | Shipping state (code) | optional |
| shipping_address | postcode | Shipping postcode | optional |
| shipping_address | country | Shipping contry (code) | optional |

**Return:**

Returns the user data equal to `GET /customers/`.

#### Delete customer ####

```
DELTE /customers/
```

**Return:**

Returns a success message.